Closed SavvySupport closed 1 week ago
The errors you're encountering with the "Tool Calling Agent" and "OpenAI Tools Agent" components in Langflow seem to be related to two main issues: KeyError
in the tracing service and unclosed asyncio event loops.
KeyError in Tracing Service: The KeyError
occurs in the LangSmithTracer
class when trying to end a trace that doesn't exist in the _children
dictionary. This can happen if the trace name used in end_trace
doesn't match any trace name previously added with add_trace
. To resolve this, ensure that the trace names are consistent and correctly managed throughout the tracing process [1].
Unclosed Event Loops: The ResourceWarning
about unclosed event loops suggests that some asyncio event loops are not being properly closed. Langflow manages event loops by checking if the current loop is running and handling coroutines in separate threads if necessary. Ensure that all coroutines are awaited and that event loops are closed properly, especially when using asyncio.run
or managing loops in threads [2].
NotImplementedError in AgentAsyncHandler: The NotImplementedError
for on_chat_model_start
indicates that this method is not implemented in the AgentAsyncHandler
class. This class is expected to handle various events, and you might need to implement this method if it's required for your use case [3].
To address these issues, you may need to review the flow setup and ensure that all necessary methods are implemented and that event loops are correctly managed.
To continue talking to Dosu, mention @dosu.
Hi @SavvySupport, thank you for the feedback. We have an upcoming release with enhanced agent capabilities. Please try to use the Agent Component in the upcoming release. I hope this will solve the issue.
I believe the issue has been resolved. If you encounter any further problems, please feel free to reopen the issue.
Bug Description
In terminal, I can see errors come up when trying to run the "Tool Calling Agent". Same occurs when trying to run the "OpenAI Tools Agent".
Reproduction
[11/08/24 03:55:56] ERROR 2024-11-08 03:55:56 - ERROR - service - Error ending trace Search API (SearchAPI-1sPfu) service.py:185 Traceback (most recent call last):
Expected behavior
Who can help?
No response
Operating System
MacOS Ventura 13.5.1
Langflow Version
1.0.19.post2
Python Version
3.10
Screenshot
https://prnt.sc/_dn5tkLiHKid
Flow File
https://prnt.sc/_dn5tkLiHKid