From 1952e4826dbf9d4a5ba99dfebf004f3cefdc2562 Mon Sep 17 00:00:00 2001 From: flipace Date: Wed, 18 Sep 2024 10:49:37 +0200 Subject: [PATCH] Update `text2vec-azure-openai` to utilize `isAzure: true` flag and mark `resourceName` + `deploymentId` as optional This relates to the changes in https://github.com/weaviate/weaviate/pull/5776 --- src/collections/config/types/vectorizer.ts | 10 ++++++---- src/collections/configure/vectorizer.ts | 5 ++++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/collections/config/types/vectorizer.ts b/src/collections/config/types/vectorizer.ts index 208125f..b174eb1 100644 --- a/src/collections/config/types/vectorizer.ts +++ b/src/collections/config/types/vectorizer.ts @@ -180,10 +180,12 @@ export type Text2VecAWSConfig = { export type Text2VecAzureOpenAIConfig = { /** The base URL to use where API requests should go. */ baseURL?: string; - /** The deployment ID to use */ - deploymentId: string; - /** The resource name to use. */ - resourceName: string; + /** The deployment ID to use. If left empty, must be provided via X-Azure-Deployment-Id header */ + deploymentId?: string; + /** The resource name to use. If left empty, must be provided via X-Azure-Resource-Name header */ + resourceName?: string; + /** Will automatically be set to true. You don't need to set this manually. */ + isAzure?: true; /** Whether to vectorize the collection name. */ vectorizeCollectionName?: boolean; }; diff --git a/src/collections/configure/vectorizer.ts b/src/collections/configure/vectorizer.ts index 6147795..c6f69f9 100644 --- a/src/collections/configure/vectorizer.ts +++ b/src/collections/configure/vectorizer.ts @@ -253,7 +253,10 @@ export const vectorizer = { vectorIndexConfig, vectorizerConfig: { name: 'text2vec-azure-openai', - config, + config: { + ...config, + isAzure: true, + } }, }); },