Skip to content

Commit

Permalink
Add type check
Browse files Browse the repository at this point in the history
  • Loading branch information
pamelafox committed Oct 17, 2024
1 parent 06c0956 commit 53e784c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/backend/prepdocslib/searchmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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,
)

Expand Down

0 comments on commit 53e784c

Please sign in to comment.