diff --git a/src/collections/configure/types/vectorizer.ts b/src/collections/configure/types/vectorizer.ts index 46b88cc3..67d55b12 100644 --- a/src/collections/configure/types/vectorizer.ts +++ b/src/collections/configure/types/vectorizer.ts @@ -196,7 +196,7 @@ export type VectorizerConfigCreateType = V extends 'img2vec-neural' : V extends 'text2vec-openai' ? Text2VecOpenAIConfigCreate | undefined : V extends 'text2vec-azure-openai' - ? Text2VecAzureOpenAIConfigCreate + ? Text2VecAzureOpenAIConfigCreate | undefined : V extends 'text2vec-palm' ? Text2VecPalmConfigCreate | undefined : V extends 'text2vec-transformers' diff --git a/src/collections/configure/unit.test.ts b/src/collections/configure/unit.test.ts index c38d6deb..546230ef 100644 --- a/src/collections/configure/unit.test.ts +++ b/src/collections/configure/unit.test.ts @@ -604,7 +604,7 @@ describe('Unit testing of the vectorizer factory class', () => { }); it('should create the correct Text2VecAzureOpenAIConfig type with just isAzure: true', () => { - const config = configure.vectorizer.text2VecAzureOpenAI({}); + const config = configure.vectorizer.text2VecAzureOpenAI(); expect(config).toEqual>({ name: undefined, vectorIndex: { diff --git a/src/collections/configure/vectorizer.ts b/src/collections/configure/vectorizer.ts index 0bcd3d33..46d26133 100644 --- a/src/collections/configure/vectorizer.ts +++ b/src/collections/configure/vectorizer.ts @@ -245,9 +245,9 @@ export const vectorizer = { * @returns {VectorConfigCreate, N, I, 'text2vec-azure-openai'>} The configuration object. */ text2VecAzureOpenAI: ( - opts: ConfigureTextVectorizerOptions + opts?: ConfigureTextVectorizerOptions ): VectorConfigCreate, N, I, 'text2vec-azure-openai'> => { - const { name, sourceProperties, vectorIndexConfig, ...config } = opts; + const { name, sourceProperties, vectorIndexConfig, ...config } = opts || {}; return makeVectorizer(name, { sourceProperties, vectorIndexConfig,