From 53e784c7d11398ec23df1d663e17745622645104 Mon Sep 17 00:00:00 2001 From: Pamela Fox Date: Thu, 17 Oct 2024 10:00:38 -0700 Subject: [PATCH] Add type check --- app/backend/prepdocslib/searchmanager.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/backend/prepdocslib/searchmanager.py b/app/backend/prepdocslib/searchmanager.py index 959e1131bf..f75af03514 100644 --- a/app/backend/prepdocslib/searchmanager.py +++ b/app/backend/prepdocslib/searchmanager.py @@ -233,7 +233,7 @@ async def create_index(self, vectorizers: Optional[List[VectorSearchVectorizer]] existing_index.vector_search.vectorizers is None or len(existing_index.vector_search.vectorizers) == 0 ): - if self.embeddings is not None: + if self.embeddings is not None and isinstance(self.embeddings, AzureOpenAIEmbeddingService): logger.info("Adding vectorizer to search index %s", self.search_info.index_name) existing_index.vector_search.vectorizers = [ AzureOpenAIVectorizer( @@ -248,7 +248,7 @@ async def create_index(self, vectorizers: Optional[List[VectorSearchVectorizer]] await search_index_client.create_or_update_index(existing_index) else: logger.info( - "Can't add vectorizer to search index %s since embeddings service isn't defined", + "Can't add vectorizer to search index %s since no Azure OpenAI embeddings service is defined", self.search_info, )