Replies: 2 comments 1 reply
-
🤖 Hey there @ziqizhang! Great to see you diving into another challenge with LangChain. Let’s unravel this mystery together. The issue you're experiencing seems to be related to the management of asynchronous resources or connections in the Weaviate client when used within the LangChain framework. The Weaviate client might be opening network connections that are not being properly closed, which can lead to the In Python, especially with asynchronous code, it's common to manage such resources using context managers ( To resolve this issue, you should ensure that all network connections or asynchronous tasks initiated by the Weaviate client are properly awaited and closed. If the Weaviate client provides a method to close connections or a context manager interface, it should be used whenever the client is no longer needed. If the client does not provide such mechanisms, you might need to implement a workaround that ensures all resources are properly managed and released. Without specific details on how the Weaviate client manages its connections and whether it provides a way to close them, it's challenging to provide a precise solution. However, the general advice is to review and ensure proper management of asynchronous resources and connections when integrating external clients into frameworks or applications. As for your question about known issues or conflicts between the LangChain framework and other Python packages, especially those that use asynchronous operations, I wasn't able to find any specific information in the LangChain repository. However, it's always a good practice to ensure proper resource management when integrating external libraries or clients into your application, as improper resource management can lead to issues like the one you're experiencing. For more information, you might want to review the Weaviate client's documentation or source code to understand how it manages its connections and whether it provides a way to close them. If you're still experiencing issues, please provide more details about how you're using the Weaviate client in your application, and I'll do my best to assist you further. Sources
|
Beta Was this translation helpful? Give feedback.
-
I'm getting the same issue with weaviate client 3.26.2 and langchain 0.1.16. Even if I don't trigger any of the code that uses the weaviate library, simply having Looking at the weaviate codebase, I don't see anything that jumps out to me that would trigger this behavior. It might be in one of weaviate's dependencies instead of weaviate itself, it's hard to tell. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Checked other resources
Commit to Help
Example Code
Description
I followed Langchain documentation to write a testing code for making asynchronous calls. I have a simple AsyncCallBackHandler that prints the response on completion. This passed to the ChatOpenAI object in the method 'test'. Then in 'test_batch' I build 3 lists each makes 5 calls to 'test'.
The code seems to conflict with weaviate (https://weaviate.io/) the vector DB I need to use. This is because, when running the above code, I keep getting multiple warning message below and the program hangs after a random time:
However, the problem is gone if I comment out the last import line:
import weaviate # conflict
That's it, a single, import line that imports the weaviate package causes this issue. Removing the import the warning messages are gone.
This seems to indicate some conflict between weaviate and langchain. Any help?
System Info
langchain=0.1.9
python=3.10.12
ubuntu 22.04
weaviate-client = "3.24.1"
Beta Was this translation helpful? Give feedback.
All reactions