langchain
ffe6ca98 - community: Fix Bug in Azure Search Vectorstore search asyncronously (#24081)

Commit
1 year ago
community: Fix Bug in Azure Search Vectorstore search asyncronously (#24081) Thank you for contributing to LangChain! **Description**: This PR fixes a bug described in the issue in #24064, when using the AzureSearch Vectorstore with the asyncronous methods to do search which is also the method used for the retriever. The proposed change includes just change the access of the embedding as optional because is it not used anywhere to retrieve documents. Actually, the syncronous methods of retrieval do not use the embedding neither. With this PR the code given by the user in the issue works. ```python vectorstore = AzureSearch( azure_search_endpoint=os.getenv("AI_SEARCH_ENDPOINT_SECRET"), azure_search_key=os.getenv("AI_SEARCH_API_KEY"), index_name=os.getenv("AI_SEARCH_INDEX_NAME_SECRET"), fields=fields, embedding_function=encoder, ) retriever = vectorstore.as_retriever(search_type="hybrid", k=2) await vectorstore.avector_search("what is the capital of France") await retriever.ainvoke("what is the capital of France") ``` **Issue**: The Azure Search Vectorstore is not working when searching for documents with asyncronous methods, as described in issue #24064 **Dependencies**: There are no extra dependencies required for this change. --------- Co-authored-by: isaac hershenson <ihershenson@hmc.edu>
Author
Parents
Loading