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

Async function calling does not work in nested chat [Bug]: #2673

Open
deepak-akkil opened this issue May 13, 2024 · 1 comment
Open

Async function calling does not work in nested chat [Bug]: #2673

deepak-akkil opened this issue May 13, 2024 · 1 comment
Labels
bug Something isn't working function/tool suggestion and execution of function/tool call nested-chat nested chat and society of mind agent

Comments

@deepak-akkil
Copy link

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

@deepak-akkil deepak-akkil added the bug Something isn't working label May 13, 2024
@deepak-akkil deepak-akkil changed the title Async function calling in nested chat [Bug]: Async function calling does not work in nested chat [Bug]: May 13, 2024
@ekzhu ekzhu added function/tool suggestion and execution of function/tool call nested-chat nested chat and society of mind agent labels May 21, 2024
@ekzhu
Copy link
Collaborator

ekzhu commented May 21, 2024

@qingyun-wu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working function/tool suggestion and execution of function/tool call nested-chat nested chat and society of mind agent
Projects
None yet
Development

No branches or pull requests

2 participants