Skip to content

Commit 26ed6fe

Browse files
haranrkcopybara-github
authored andcommitted
docs(guides): note single_turn works for non-LlmAgent agents
Extend the LlmAgent single-turn guide with a section showing that `single_turn` composition is not limited to `LlmAgent`: a server-backed `ManagedAgent` can be a single-turn sub-agent via `mode='single_turn'`, is auto-exposed as an inline tool, preserves its internal events in the shared session, and is stateless per call. Co-authored-by: Haran Rajkumar <haranrk@google.com> PiperOrigin-RevId: 945962977
1 parent fc98549 commit 26ed6fe

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

docs/guides/agents/llm_agent/single_turn.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,28 @@ bilingual_writer = LlmAgent(
9696
)
9797
```
9898

99+
### Non-LlmAgent single-turn sub-agents
100+
101+
`single_turn` composition is not limited to `LlmAgent`. A `ManagedAgent`
102+
(server-backed) can also be a single-turn sub-agent by setting
103+
`mode='single_turn'`; ADK auto-exposes it to the parent as an inline tool, and
104+
its internal events are preserved in the shared session. Each single-turn managed
105+
call is stateless (isolated per call), so pass a self-contained request.
106+
107+
```python
108+
from google.adk.agents import LlmAgent, ManagedAgent
109+
110+
specialist = ManagedAgent(
111+
name="search_specialist",
112+
mode="single_turn",
113+
agent_id="...",
114+
environment={"type": "remote"},
115+
description="Answers questions needing fresh, grounded web facts.",
116+
)
117+
118+
coordinator = LlmAgent(name="coordinator", sub_agents=[specialist])
119+
```
120+
99121
--------------------------------------------------------------------------------
100122

101123
## How Context Isolation Works

0 commit comments

Comments
 (0)