Open MikeBirdTech opened 8 months ago
@kevin666aa are you aware of this issue? There seem to be two problems:
For 2. this is a mist print in groupchat. I will fix that.
raise ValueError(
f"No agent can execute the function {self.messages[-1]['name']}. "
"Please check the function_map of the agents."
)
# should be self.messages[-1]["function_call"]["name"]
Still looking into the issues
@Arrendy I need to know a bit more about this run. Can you print this after initialize groupchat:
for agent in groupchat.agents:
print(agent.name, agent._function_map)
after running this code and getting the error?
print(groupchat.messages[-1])
for agent in groupchat.agents:
print(agent.name, agent._function_map)
if agent.can_execute_function(groupchat.messages[-1]["function_call"]["name"]):
print(f'{agent.name} can execute this function', groupchat.messages[-1]["function_call"]["name"])
I'm also getting this error when using a group chat with multiple agents. Is there anything I can provide that would help diagnose this problem?
I am encountering the same issue here. The function is registered using llm_config
but the function_map
is empty and it returns that "No agent can execute the function ...". Let me know what I can provide to debug this issue.
Registering in the llm_config only provides the agent with awareness of the function. To allow an agent to execute the function, you also need to manually add it to function_map. The latest version in the main branch also supports decorator syntax for doing this. See https://microsoft.github.io/autogen/docs/reference/agentchat/conversable_agent/#register_for_llm. Make sure you clone the repo for the latest code. The next release to Pypi should cover this functionality.
@MikeBirdTech , have you tried with the latest version?
Autogen is trying to call functions that are the names of agents but don't exist.
No agent can execute the function document_writer
There's no function called
document_writer
but there's an agent calleddocument_writer
Prompt:
"Who should read this paper: https://arxiv.org/abs/2308.08155"
Functions:
Agents:
Logs: