From 6b07490b55340a0af35759f24cdfe7ae0e2a5076 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 208125fe..b174eb1e 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 61477951..0bcd3d33 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, + }, }, }); },