adk-python
adk-python copied to clipboard
'coroutine' object has no attribute 'sub_agents' after upgrade to 1.0.0
I use Multi-agent, below is the code.
async def get_coordinator_agent():
gis_data_search_agent, exit_stack = await create_gis_data_search_agent()
gis_command_agent, command_exit_stack = await create_gis_command_agent()
root_tool_agent = LlmAgent(
model=LiteLlm(model=default_model_name),
name=coordinator_agent_name,
instruction=coordinator_agent_instruction,
sub_agents=[
gis_data_search_agent,
gis_command_agent
]
)
return root_tool_agent, command_exit_stack
root_agent = get_coordinator_agent()
that code works with 0.5.0 version, after I upgrade to 1.0.0 , it's show me "Error in event_generator: 'coroutine' object has no attribute 'sub_agents' "
Do you mean to post this for https://github.com/google/adk-python/issues? or you are seeing similar issues in Java version of ADK?
@wanyedu This code snippet was a temp solution for MCP tools. We've revamp how to instantiate an agent with MCP tools.
Now, we don't need to handle exit_stack.
You could check out below samples for the latest agent.py structure:
- https://github.com/google/adk-python/tree/main/contributing/samples/mcp_stdio_server_agent
- https://github.com/google/adk-python/tree/main/contributing/samples/mcp_sse_agent