Add adk module: two LlmAgents in a SequentialAgent with a tool and shared session state on Google ADK for Java 1.11.0

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RjfyTgmERTWLqzafu34Cth
This commit is contained in:
2026-10-14 06:47:50 +00:00
co-authored by Claude Sonnet 5.5
parent 3b52a434f5
commit d5725f66ba
12 changed files with 341 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
# adk
Companion code for *Google Agent Development Kit (ADK) for Java: Your First Multi-Agent App* on
[ankurm.com](https://ankurm.com). Two `LlmAgent`s in a `SequentialAgent`: a researcher that calls a tool and
saves its answer to session state, and a writer whose instruction reads that state.
There is no Gemini key here. `ScriptedLlm` is a small `BaseLlm` that behaves like a tool-calling model, so the
agents, the tool call, the session and the state hand-off all run for real while the model is the one
scripted part.
```bash
mvn test -pl adk # rewrites output/*.txt
```
| File | Role |
|---|---|
| `OrderTools` | The tool: a public static method with `@Schema` parameter annotations |
| `ScriptedLlm` | The stand-in model; records every `LlmRequest` it receives |
| `SupportPipeline` | The two agents and the `SequentialAgent` that runs them |
| `SupportPipelineTest` | Three tests; each writes `output/NN-*.txt`. Map entries inside tool results print in a different order from run to run, so compare content, not line order |
Verified against `com.google.adk:google-adk` **1.11.0**, JDK 25, JUnit 6.1.3.