ParallelAgent works with LLMAgent but not with custom agents — is additional setup needed? #2277
Replies: 1 comment
|
Check the implementation of each custom agent's For blocking I/O, use an async client and import asyncio
# Inside your custom agent's async _run_async_impl:
result = await asyncio.to_thread(blocking_extract, document)
# Yield your normal ADK Event containing the result here.
There is no extra |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I'm working with the ADK Agents and have encountered an issue when using ParallelAgent with custom agents.
Context:
I have created 3 custom agents (not using LLMAgent) and grouped them under a ParallelAgent.
When running, I notice that these agents are executed sequentially(one after the other), not in parallel as expected.
However, if I replace the custom agents with LLMAgent instances, the parallel execution works as intended — the LLM calls are dispatched concurrently.
Questions:
Why does ParallelAgent support true parallel execution with LLMAgent but not with custom agents?
Is there any additional configuration or specific interface/behavior required for custom agents to be compatible with ParallelAgent and actually run in parallel?
parallel agent code :
parallel_extraction_agent = ParallelAgent(
name="parallel_extraction_agent",
description="This agent orchestrates multiple sub agents to extract specific information from the medical record",
sub_agents=[accommodations_extraction_agent, info_agent, synopsis_agent],
)
All reactions