Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Azure AI Search] RuntimeWarning: coroutine 'SearchClient.close' was never awaited #27097

Open
5 tasks done
nowjean opened this issue Oct 4, 2024 · 1 comment
Open
5 tasks done
Labels
investigate Ɑ: vector store Related to vector store module

Comments

@nowjean
Copy link

nowjean commented Oct 4, 2024

Checked other resources

  • I added a very descriptive title to this issue.
  • I searched the LangChain documentation with the integrated search.
  • I used the GitHub search to find a similar question and didn't find it.
  • I am sure that this is a bug in LangChain rather than my code.
  • The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package).

Example Code

The following code:

from langchain_community.vectorstores.azuresearch import AzureSearch
  vector_store: AzureSearch = AzureSearch(
            azure_search_endpoint=search_endpoint,
            azure_search_key=azure_search_key,
            azure_ad_access_token=None,
            index_name=index_name,
            embedding_function=aoai_embeddings.embed_query,
            semantic_configuration_name="lseSemanticConfig"
        )

Error Message and Stack Trace (if applicable)

it does RuntimeWarning: coroutine 'SearchClient.close' was never awaited
loop.run_until_complete(self.async_client.close())

Description

I'm trying to using from langchain_community.vectorstores.azuresearch import AzureSearch

I expected to see no error or warning.
Instead, it does RuntimeWarning: coroutine 'SearchClient.close' was never awaited
loop.run_until_complete(self.async_client.close())

Normally, It's okay and working correctly, but when i concurrent request to my endpoint, i got this warnnig.
Can i ignore this code or not?

System Info

System Information

OS: Linux
OS Version: #49~20.04.1-Ubuntu SMP Wed Jul 12 12:44:56 UTC 2023
Python Version: 3.11.9 (main, Apr 6 2024, 17:59:24) [GCC 9.4.0]

Package Information

langchain_core: 0.3.0
langchain: 0.3.0
langchain_community: 0.3.0
langsmith: 0.1.129
langchain_openai: 0.2.0
langchain_text_splitters: 0.3.0
langgraph: Installed. No version info available.

Optional packages not installed

langserve

Other Dependencies

aiohttp: 3.9.5
async-timeout: Installed. No version info available.
dataclasses-json: 0.6.7
httpx: 0.27.0
jsonpatch: 1.33
numpy: 1.26.4
openai: 1.44.0
orjson: 3.10.6
packaging: 24.1
pydantic: 2.8.2
pydantic-settings: 2.5.2
PyYAML: 6.0.1
requests: 2.32.3
SQLAlchemy: 2.0.31
tenacity: 8.5.0
tiktoken: 0.7.0
typing-extensions: 4.12.2

@langcarl langcarl bot added the investigate label Oct 4, 2024
@dosubot dosubot bot added the Ɑ: vector store Related to vector store module label Oct 4, 2024
@pokotylo
Copy link
Contributor

pokotylo commented Oct 4, 2024

Probably related #24921

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
investigate Ɑ: vector store Related to vector store module
Projects
None yet
Development

No branches or pull requests

2 participants