|
| 1 | +# 🔬 ADK Markdown Snippet Verification Report |
| 2 | + |
| 3 | +* **Source File**: [single_turn.md](file:///Users/shahins/projects/mine/adk-python/docs/guides/agents/llm_agent/single_turn.md) |
| 4 | +* **Verified On**: `2026-06-23 19:02:40` |
| 5 | + |
| 6 | +## 📈 Executive Summary |
| 7 | + |
| 8 | +| Snippet | Preceding Heading | Load Phase | Run Phase | Coverage | Details | |
| 9 | +| :--- | :--- | :---: | :---: | :---: | :--- | |
| 10 | +| **Snippet 1** | `Example` | ❌ **FAIL** | ➖ **SKIPPED** | — | `ImportError: cannot import name 'build_node' from 'google.adk.workflow' (/Users/shahins/projects/mine/adk-python/src/google/adk/workflow/__init__.py)` | |
| 11 | +| **Snippet 2** | `Example` | ✅ **PASS** | ✅ **PASS** | `100` | All checks passed successfully. | |
| 12 | +| **Snippet 3** | `Context-Aware Sub-Agent Example` | ❌ **FAIL** | ➖ **SKIPPED** | — | `NameError: name 'LlmAgent' is not defined` | |
| 13 | + |
| 14 | +--- |
| 15 | + |
| 16 | +## 🔍 Detailed Snippet Reports |
| 17 | + |
| 18 | +### ❌ Snippet 1: `Example` |
| 19 | + |
| 20 | +#### 📝 Code Block |
| 21 | +```python |
| 22 | +from google.adk.agents import LlmAgent |
| 23 | +from google.adk.workflow import Workflow, build_node |
| 24 | + |
| 25 | +# Defaults to mode="single_turn" when run as a node |
| 26 | +writer_agent = LlmAgent( |
| 27 | + name="writer", |
| 28 | + instruction="Write a short story about the input topic." |
| 29 | +) |
| 30 | + |
| 31 | +writer_node = build_node(writer_agent) |
| 32 | + |
| 33 | +wf = Workflow( |
| 34 | + name="story_generator", |
| 35 | + edges=[ |
| 36 | + ("START", writer_node), |
| 37 | + (writer_node, "END") |
| 38 | + ] |
| 39 | +) |
| 40 | +``` |
| 41 | + |
| 42 | +#### 🖥️ Loadability & Runnability Logs |
| 43 | +``` |
| 44 | +🔬 Testing file: snippet_1_example.py |
| 45 | +============================================================ |
| 46 | +📋 Phase 1: Loading & Compiling... |
| 47 | +❌ Load Failure: Failed to compile/load 'snippet_1_example.py': |
| 48 | +------------------------------------------------------------ |
| 49 | +Traceback (most recent call last): |
| 50 | + File "/Users/shahins/projects/mine/adk-python/.agents/skills/adk-verify-snippets/scripts/run.py", line 206, in main |
| 51 | + module = load_target_module(file_path) |
| 52 | + File "/Users/shahins/projects/mine/adk-python/.agents/skills/adk-verify-snippets/scripts/run.py", line 52, in load_target_module |
| 53 | + spec.loader.exec_module(module) |
| 54 | + ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^ |
| 55 | + File "<frozen importlib._bootstrap_external>", line 762, in exec_module |
| 56 | + File "<frozen importlib._bootstrap>", line 491, in _call_with_frames_removed |
| 57 | + File "/private/var/folders/cm/82x0j39d2076xcfjpm5qcxxr00gp60/T/verify_snippets_09387wsx/snippet_1_example.py", line 2, in <module> |
| 58 | + from google.adk.workflow import Workflow, build_node |
| 59 | +ImportError: cannot import name 'build_node' from 'google.adk.workflow' (/Users/shahins/projects/mine/adk-python/src/google/adk/workflow/__init__.py) |
| 60 | +------------------------------------------------------------ |
| 61 | +``` |
| 62 | + |
| 63 | +#### 📊 Coverage Report |
| 64 | +``` |
| 65 | +📊 Phase 4: Code Coverage Report (Target File) |
| 66 | +============================================================ |
| 67 | +Name Stmts Miss Branch BrPart Cover |
| 68 | +------------------------------------------------------------------------------------------------------------------------------------------ |
| 69 | +/private/var/folders/cm/82x0j39d2076xcfjpm5qcxxr00gp60/T/verify_snippets_09387wsx/snippet_1_example.py 5 3 0 0 40% |
| 70 | +------------------------------------------------------------------------------------------------------------------------------------------ |
| 71 | +TOTAL 5 3 0 0 40% |
| 72 | +============================================================ |
| 73 | +
|
| 74 | +``` |
| 75 | + |
| 76 | +--- |
| 77 | + |
| 78 | +### ✅ Snippet 2: `Example` |
| 79 | + |
| 80 | +#### 📝 Code Block |
| 81 | +```python |
| 82 | +from google.adk.agents import LlmAgent |
| 83 | + |
| 84 | +# Define a specialized single-turn sub-agent |
| 85 | +translator_agent = LlmAgent( |
| 86 | + name="translator", |
| 87 | + instruction="Translate the input text to Spanish.", |
| 88 | + mode="single_turn" # Must be explicit if not auto-wrapped in workflow |
| 89 | +) |
| 90 | + |
| 91 | +# Define the parent agent and assign the sub-agent |
| 92 | +bilingual_writer = LlmAgent( |
| 93 | + name="bilingual_writer", |
| 94 | + instruction="Write a poem about the topic, then use the translator tool to translate it.", |
| 95 | + sub_agents=[translator_agent] # Exposes 'translator' as a tool to bilingual_writer |
| 96 | +) |
| 97 | +``` |
| 98 | + |
| 99 | +#### 🖥️ Loadability & Runnability Logs |
| 100 | +``` |
| 101 | +🔬 Testing file: snippet_2_example.py |
| 102 | +============================================================ |
| 103 | +📋 Phase 1: Loading & Compiling... |
| 104 | +✅ Load Success: 'snippet_2_example.py' compiled and loaded without any issues. |
| 105 | +
|
| 106 | +📋 Phase 2: Component Discovery... |
| 107 | +
|
| 108 | +📋 Phase 3: Executing Agent... |
| 109 | +
|
| 110 | +🔍 Discovered ADK Agent in target file. |
| 111 | +🚀 Running execution test with input: 'Test input topic'... |
| 112 | +
|
| 113 | +🎬 [Event] Author: bilingual_writer |
| 114 | +📝 Content Output: |
| 115 | +---------------------------------------- |
| 116 | +### Test Input |
| 117 | +
|
| 118 | +A lonely string of text arrives, |
| 119 | +To see if the machine survives. |
| 120 | +A test input, a simple key, |
| 121 | +To unlock what the code might be. |
| 122 | +
|
| 123 | +Through functions, loops, and logic gates, |
| 124 | +It travels where the program waits. |
| 125 | +Will it pass, or will it break? |
| 126 | +What difference will a symbol make? |
| 127 | +
|
| 128 | +A gentle pulse, a quiet spark, |
| 129 | +A guiding light within the dark. |
| 130 | +The test succeeds, the output clear, |
| 131 | +No bugs to find, no faults to fear. |
| 132 | +
|
| 133 | +*** |
| 134 | +
|
| 135 | +Now, translating this poem into Spanish... |
| 136 | +---------------------------------------- |
| 137 | +🎬 [Event] Author: translator |
| 138 | +🎬 [Event] Author: translator |
| 139 | +🎬 [Event] Author: bilingual_writer |
| 140 | +📝 Content Output: |
| 141 | +---------------------------------------- |
| 142 | +Aquí tienes la traducción del poema al español: |
| 143 | +
|
| 144 | +### Entrada de Prueba |
| 145 | +
|
| 146 | +Una solitaria cadena de texto llega, |
| 147 | +Para ver si la máquina sobrevive. |
| 148 | +Una entrada de prueba, una simple clave, |
| 149 | +Para desbloquear lo que el código podría ser. |
| 150 | +
|
| 151 | +A través de funciones, bucles y puertas lógicas, |
| 152 | +Viaja hacia donde el programa espera. |
| 153 | +¿Pasará, o se romperá? |
| 154 | +¿Qué diferencia hará un símbolo? |
| 155 | +
|
| 156 | +Un suave pulso, una chispa silenciosa, |
| 157 | +Una luz guía en la oscuridad. |
| 158 | +La prueba tiene éxito, el resultado es claro, |
| 159 | +Sin errores que encontrar, ni fallos que temer. |
| 160 | +---------------------------------------- |
| 161 | +🎬 [Event] Author: bilingual_writer |
| 162 | +🎬 [Event] Author: bilingual_writer |
| 163 | +📝 Content Output: |
| 164 | +---------------------------------------- |
| 165 | +Here is the translation of the poem: |
| 166 | +
|
| 167 | +### Entrada de Prueba |
| 168 | +
|
| 169 | +Una solitaria cadena de texto llega, |
| 170 | +Para ver si la máquina sobrevive. |
| 171 | +Una entrada de prueba, una simple clave, |
| 172 | +Para desbloquear lo que el código podría ser. |
| 173 | +
|
| 174 | +A través de funciones, bucles y puertas lógicas, |
| 175 | +Viaja hacia donde el programa espera. |
| 176 | +¿Pasará, o se romperá? |
| 177 | +¿Qué diferencia hará un símbolo? |
| 178 | +
|
| 179 | +Un suave pulso, una chispa silenciosa, |
| 180 | +Una luz guía en la oscuridad. |
| 181 | +La prueba tiene éxito, el resultado es claro, |
| 182 | +Sin errores que encontrar, ni fallos que temer. |
| 183 | +---------------------------------------- |
| 184 | +
|
| 185 | +✅ Run Success: Component 'Agent' executed successfully. |
| 186 | +
|
| 187 | +=== STDERR/TRACEBACK === |
| 188 | +/Users/shahins/projects/mine/adk-python/src/google/adk/models/llm_request.py:256: UserWarning: [EXPERIMENTAL] feature FeatureName.JSON_SCHEMA_FOR_FUNC_DECL is enabled. |
| 189 | + declaration = tool._get_declaration() |
| 190 | +``` |
| 191 | + |
| 192 | +#### 📊 Coverage Report |
| 193 | +``` |
| 194 | +📊 Phase 4: Code Coverage Report (Target File) |
| 195 | +============================================================ |
| 196 | +Name Stmts Miss Branch BrPart Cover |
| 197 | +------------------------------------------------------------------------------------------------------------------------------------------ |
| 198 | +/private/var/folders/cm/82x0j39d2076xcfjpm5qcxxr00gp60/T/verify_snippets_09387wsx/snippet_2_example.py 3 0 0 0 100% |
| 199 | +------------------------------------------------------------------------------------------------------------------------------------------ |
| 200 | +TOTAL 3 0 0 0 100% |
| 201 | +============================================================ |
| 202 | +
|
| 203 | +``` |
| 204 | + |
| 205 | +--- |
| 206 | + |
| 207 | +### ❌ Snippet 3: `Context-Aware Sub-Agent Example` |
| 208 | + |
| 209 | +#### 📝 Code Block |
| 210 | +```python |
| 211 | +verifier_agent = LlmAgent( |
| 212 | + name="verifier", |
| 213 | + instruction="Verify that the draft meets all constraints discussed in the chat.", |
| 214 | + mode="single_turn", |
| 215 | + include_contents="default" # Allows the sub-agent to see the parent's conversation history |
| 216 | +) |
| 217 | + |
| 218 | +editor_agent = LlmAgent( |
| 219 | + name="editor", |
| 220 | + instruction="Discuss the draft with the user and use verifier to check constraints.", |
| 221 | + sub_agents=[verifier_agent] |
| 222 | +) |
| 223 | +``` |
| 224 | + |
| 225 | +#### 🖥️ Loadability & Runnability Logs |
| 226 | +``` |
| 227 | +🔬 Testing file: snippet_3_contextaware_subagent_example.py |
| 228 | +============================================================ |
| 229 | +📋 Phase 1: Loading & Compiling... |
| 230 | +❌ Load Failure: Failed to compile/load 'snippet_3_contextaware_subagent_example.py': |
| 231 | +------------------------------------------------------------ |
| 232 | +Traceback (most recent call last): |
| 233 | + File "/Users/shahins/projects/mine/adk-python/.agents/skills/adk-verify-snippets/scripts/run.py", line 206, in main |
| 234 | + module = load_target_module(file_path) |
| 235 | + File "/Users/shahins/projects/mine/adk-python/.agents/skills/adk-verify-snippets/scripts/run.py", line 52, in load_target_module |
| 236 | + spec.loader.exec_module(module) |
| 237 | + ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^ |
| 238 | + File "<frozen importlib._bootstrap_external>", line 762, in exec_module |
| 239 | + File "<frozen importlib._bootstrap>", line 491, in _call_with_frames_removed |
| 240 | + File "/private/var/folders/cm/82x0j39d2076xcfjpm5qcxxr00gp60/T/verify_snippets_09387wsx/snippet_3_contextaware_subagent_example.py", line 1, in <module> |
| 241 | + verifier_agent = LlmAgent( |
| 242 | + ^^^^^^^^ |
| 243 | +NameError: name 'LlmAgent' is not defined |
| 244 | +------------------------------------------------------------ |
| 245 | +``` |
| 246 | + |
| 247 | +#### 📊 Coverage Report |
| 248 | +``` |
| 249 | +📊 Phase 4: Code Coverage Report (Target File) |
| 250 | +============================================================ |
| 251 | +Name Stmts Miss Branch BrPart Cover |
| 252 | +---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 253 | +/private/var/folders/cm/82x0j39d2076xcfjpm5qcxxr00gp60/T/verify_snippets_09387wsx/snippet_3_contextaware_subagent_example.py 2 1 0 0 50% |
| 254 | +---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 255 | +TOTAL 2 1 0 0 50% |
| 256 | +============================================================ |
| 257 | +
|
| 258 | +``` |
| 259 | + |
| 260 | +--- |
| 261 | + |
0 commit comments