This note was generated with AI assistance, but the code reading order should be fine (all use official Eino examples; personally I felt the official tutorial was a bit hard to understand).
adk/agentic/research_assistant/ — AgenticModel + AgenticMessage full-featured research assistant
adk/agentic/retry_max_output_tokens/ — auto-retry on output truncation
📖 Prerequisites: This guide assumes you have already mastered the content of sections one through five in the Intro Notes.
Quick Look: ChatModel → AgenticModel Type Mapping Table (Read This First!)
Before diving into details, memorize the core mapping — Agentic means adding Typed to every type name, and replacing every Message with AgenticMessage:
🧠 One-line summary: The Agentic series is Eino’s complete wrapper for the Responses API — replace ChatModel with AgenticModel, replace Message with AgenticMessage, and the usage of other concepts (Agent / Runner / Middleware / Tool) stays the same, but all use the Typed generic variants.
Background: Chat Completions API → Responses API
In the Intro Notes, all code is based on the Chat Completions API (ChatModel + *schema.Message). This is the API form introduced by OpenAI in 2022.
But starting in 2025, mainstream model vendors began pushing the Responses API, which is a new generation of API form. The core differences between the two:
✅ Executed directly on the vendor side (e.g. web_search)
Output truncation detection
No standard signal
status=incomplete + reason=max_output_tokens
I. Core Concept: AgenticMessage and ContentBlock
1.1 Why do we need AgenticMessage?
In the Chat Completions API, a single model call returns only one message. The Responses API returns all structured intermediate steps in a single call. To carry this “multi-event” return, the original *schema.Message (with only one Role + Content string) is no longer enough:
│ text: "Based on the analysis, the answer is 42" │
18
│ ] │
19
└──────────────────────────────────────────────┘
20
One message containing multiple ordered structured Blocks
1.2 ContentBlock Type Quick Reference
Each Block has a Type field indicating its category:
Block type
Meaning
Produced by
Appears in which message
reasoning
The model’s reasoning / thinking process
Model
Assistant message
text
Normal text output
Model
Assistant message
server_tool_call
Calling a server-side tool (e.g. web_search)
Model
Assistant message
function_tool_call
Calling a client-side local tool
Model
Assistant message
function_tool_result
Local tool execution result
Framework
User message (fed back to model)
thinking
Deep thinking content
Model
Assistant message
🧠 Key understanding: server_tool_call executes on the model vendor’s servers (your code can’t see the execution process), while function_tool_call is returned to your Agent for local execution.
💡 Server-side vs local tools: The call and execution of a server-side tool both happen on the vendor side. Your code will only see a server_tool_call block in content_blocks, and there will be no corresponding function_tool_result — the result is consumed internally by the model.
III. Typed Generic System
3.1 Complete Assembly Example (compared with Intro Notes §3)
The Agent assembly steps are exactly the same as Section III of the Intro Notes, only the types are switched to Typed + AgenticMessage:
Need server-side search (web_search) → AgenticModel ✅
6
Need to see the model's reasoning process → AgenticModel ✅
7
Need auto-retry on output truncation → AgenticModel ✅
8
Need to mix reasoning + tools + text in one call → AgenticModel ✅
9
Existing ChatModelAgent code runs fine → Don't migrate, unless you need the above
🧠 Progressive adoption: Agentic is not meant to replace ChatModel — they are two parallel systems. When you need advanced features, the migration path is also clear: change the types from ChatModel/Message to AgenticModel/AgenticMessage, and the rest of the logic is largely unchanged.