Skip to content

Commit 3fdea68

Browse files
committed
📝 docs(bot): Auto sync agents & plugin to readme
1 parent ac6bcf2 commit 3fdea68

File tree

1 file changed

+6
-8
lines changed
  • src/libs/agent-runtime/azureOpenai

1 file changed

+6
-8
lines changed

src/libs/agent-runtime/azureOpenai/index.ts

+6-8
Original file line numberDiff line numberDiff line change
@@ -81,27 +81,25 @@ export class LobeAzureOpenAI implements LobeRuntimeAI {
8181

8282
// Convert object keys to camel case, copy from `@azure/openai` in `node_modules/@azure/openai/dist/index.cjs`
8383
private camelCaseKeys = (obj: any): any => {
84-
if (typeof obj !== "object" || !obj)
85-
return obj;
84+
if (typeof obj !== 'object' || !obj) return obj;
8685
if (Array.isArray(obj)) {
8786
return obj.map((v) => this.camelCaseKeys(v));
88-
}
89-
else {
87+
} else {
9088
for (const key of Object.keys(obj)) {
9189
const value = obj[key];
9290
const newKey = this.tocamelCase(key);
9391
if (newKey !== key) {
9492
delete obj[key];
9593
}
96-
obj[newKey] = typeof obj[newKey] === "object" ? this.camelCaseKeys(value) : value;
94+
obj[newKey] = typeof obj[newKey] === 'object' ? this.camelCaseKeys(value) : value;
9795
}
9896
return obj;
9997
}
100-
}
98+
};
10199

102100
private tocamelCase = (str: string) => {
103101
return str
104102
.toLowerCase()
105-
.replace(/(_[a-z])/g, (group) => group.toUpperCase().replace("_", ""));
106-
}
103+
.replaceAll(/(_[a-z])/g, (group) => group.toUpperCase().replace('_', ''));
104+
};
107105
}

0 commit comments

Comments
 (0)