We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e7fbcc1 commit 55c947dCopy full SHA for 55c947d
src/embedder.ts
@@ -302,9 +302,14 @@ export class Embedder {
302
this._autoChunk = config.chunking !== false;
303
304
// Create a client pool — one OpenAI client per key
305
+ const isAzure = config.baseURL?.includes('.openai.azure.com');
306
this.clients = resolvedKeys.map(key => new OpenAI({
307
apiKey: key,
308
...(config.baseURL ? { baseURL: config.baseURL } : {}),
309
+ ...(isAzure ? {
310
+ defaultHeaders: { 'api-key': key },
311
+ defaultQuery: { 'api-version': '2024-02-01' }
312
+ } : {})
313
}));
314
315
if (this.clients.length > 1) {
0 commit comments