-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Closed as not planned
Labels
0.2Issues which are related to the pre 0.4 codebaseIssues which are related to the pre 0.4 codebaseneeds-triagenested-chatnested chat and society of mind agentnested chat and society of mind agenttool-usagesuggestion and execution of function/tool callsuggestion and execution of function/tool call
Description
Describe the bug
Nested chat does not work with async tool usage
Steps to reproduce
Convert Scenario 2 example of nested chat available here to use async functions: https://microsoft.github.io/autogen/docs/notebooks/agentchat_nestedchat/
Use the following steps:
a) change function definition of check_harmful_content
to be async
b) change user_proxy.initiate_chat
to await user_proxy.a_initiate_chat
Observed Behavior:
The system gets stuck after triggering nested chat but before tool usage. After a timeout period returns with the error message:
RuntimeError: This event loop is already running
sys:1: RuntimeWarning: coroutine 'ConversableAgent.a_execute_function' was never awaited
in the line in ConversableAgent
_, func_return = loop.run_until_complete(self.a_execute_function(function_call))
Temporary work around:
import nest_asyncio
nest_asyncio.apply()
Model Used
gpt-4-turbo-preview
Expected Behavior
Async function calling works even in nested chat
Screenshots and logs
No response
Additional Information
No response
jordanbean-msft
Metadata
Metadata
Assignees
Labels
0.2Issues which are related to the pre 0.4 codebaseIssues which are related to the pre 0.4 codebaseneeds-triagenested-chatnested chat and society of mind agentnested chat and society of mind agenttool-usagesuggestion and execution of function/tool callsuggestion and execution of function/tool call