Skip to content

Commit 67bacc2

Browse files
committed
Merge remote-tracking branch 'origin/main' into fix-thought-signature-pruning
2 parents 58d6953 + c6dec00 commit 67bacc2

57 files changed

Lines changed: 3583 additions & 896 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.agents/skills/adk-agent-builder/SKILL.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,37 @@ description: Central hub for building, testing, and iterating on ADK agents. Tri
55

66
# ADK Agent Builder
77

8-
This file serves as a directory of specialized reference guides for developing agents with ADK. To avoid context pollution, read only the relevant reference file based on your current task.
8+
This file serves as a directory of specialized reference guides for developing
9+
agents with ADK. To avoid context pollution, read only the relevant reference
10+
file based on your current task.
911

1012
## Core Concepts Directory
1113

1214
Refer to these files for foundational knowledge:
15+
1316
- **Getting Started & Basic Agents**: [getting-started.md](references/getting-started.md)
1417
- Environment setup, API key configuration, and minimal agent definitions.
1518
- **Tool Catalog**: [tool-catalog.md](references/tool-catalog.md)
1619
- How to bind function tools, MCP tools, OpenAPI specs, and Google API tools.
1720
- **Agent Modes (Task / Single-Turn)**: [task-mode.md](references/task-mode.md)
1821
- Multi-turn structured delegation and autonomous single-turn execution patterns.
22+
- **Import Paths**: [import-paths.md](references/import-paths.md)
23+
- Canonical and verbose import paths for core components, tools, and
24+
events.
1925

2026
## Workflow & Graph Orchestration
2127

2228
Refer to these files when building complex graphs:
29+
2330
- **Function Nodes**: [function-nodes.md](references/function-nodes.md)
2431
- How to use functions as nodes, type resolution, and generators.
2532
- **Routing & Conditions**: [routing-and-conditions.md](references/routing-and-conditions.md)
2633
- Edge patterns, dict-based routing, self-loops, and conditional execution.
2734
- **LLM Agent Nodes**: [llm-agent-nodes.md](references/llm-agent-nodes.md)
2835
- How to use LLM agents as workflow nodes, task wrappers, and handling output schemas.
36+
- **Advanced Patterns**:
37+
[advanced-patterns.md](references/advanced-patterns.md)
38+
- Nested workflows, custom node types, and graph validation rules.
2939

3040
## Advanced Orchestration Patterns
3141

@@ -40,6 +50,14 @@ Refer to these files when building complex graphs:
4050

4151
- **State & Events**: [state-and-events.md](references/state-and-events.md)
4252
- Using context API, sharing global state, and yield event structures.
53+
- **Session & Memory**:
54+
[session-and-state.md](references/session-and-state.md)
55+
- Session state mutation, scope conventions, and database session
56+
services.
57+
- **Callbacks & Plugins**:
58+
[callbacks-and-plugins.md](references/callbacks-and-plugins.md)
59+
- Implementing callbacks, plugin manager integration, and override
60+
behavior.
4361
- **Multi-Agent Systems**: [multi-agent.md](references/multi-agent.md)
4462
- Hierarchical execution (e.g., `SequentialAgent`, `LoopAgent`, `ParallelAgent`).
4563
- **Testing Strategies**: [testing.md](references/testing.md)

.agents/skills/adk-sample-creator/SKILL.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ Each sample should have a `README.md` with the following structure:
8989

9090
- **Overview**: What the sample does.
9191
- **Sample Inputs**: Examples of inputs to test with. Each prompt must be wrapped in backticks. If a prompt has an explanation, always add a blank line between the prompt and the explanation, and indent the explanation by two spaces.
92-
- **Graph**: Visualization of the graph flow (Mermaid recommended for workflows).
92+
- **Graph**: Visualization of the graph flow (Mermaid recommended). For Workflow root agents, visualize the graph flow of nodes. For LlmAgent root agents that orchestrate tools or sub-agents, visualize the topology of the agent and its tools/sub-agents instead of internal workflow nodes.
9393
- **How To**: Explanation of key techniques used (e.g., `ctx.run_node`).
9494
- **Related Guides**: Links to relevant developer guides in `docs/guides/` that explain the concepts or classes used.
9595

@@ -112,11 +112,18 @@ Brief description.
112112

113113
## Graph
114114

115+
For Workflow root agents:
115116
```mermaid
116117
graph TD
117118
START --> MyNode
118119
```
119120

121+
For LlmAgent root agents:
122+
```mermaid
123+
graph TD
124+
MyAgent[my_agent] -->|calls| MyTool(my_tool)
125+
```
126+
120127
## How To
121128

122129
Explain the details.

.github/workflows/continuous-integration.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ jobs:
6767

6868
- name: Install uv
6969
uses: astral-sh/setup-uv@v7
70+
with:
71+
enable-cache: true
7072

7173
- name: Generate Baseline
7274
env:
@@ -134,6 +136,8 @@ jobs:
134136

135137
- name: Install the latest version of uv
136138
uses: astral-sh/setup-uv@v7
139+
with:
140+
enable-cache: true
137141

138142
- name: Install dependencies
139143
run: |
@@ -148,5 +152,3 @@ jobs:
148152
-n auto \
149153
--ignore=tests/unittests/artifacts/test_artifact_service.py \
150154
--ignore=tests/unittests/tools/google_api_tool/test_googleapi_to_openapi_converter.py
151-
152-

.github/workflows/discussion_answering.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,7 @@ jobs:
6565
REPO: 'adk-python'
6666
INTERACTIVE: 0
6767
PYTHONPATH: contributing/samples/adk_team
68+
DISCUSSION_JSON: ${{ toJson(github.event.discussion) }}
6869
run: |
69-
# Write discussion data to temporary file to avoid secret masking issues
70-
cat > /tmp/discussion.json << 'EOF'
71-
${{ toJson(github.event.discussion) }}
72-
EOF
70+
python -c "import os; open('/tmp/discussion.json', 'w').write(os.environ['DISCUSSION_JSON'])"
7371
python -m adk_answering_agent.main --discussion-file /tmp/discussion.json

.github/workflows/release-publish.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ jobs:
7070
uses: astral-sh/setup-uv@v7
7171
with:
7272
version: "latest"
73+
enable-cache: true
7374

7475
- name: Set up Python
7576
uses: actions/setup-python@v6

.pre-commit-config.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ repos:
6161
entry: scripts/compliance_checks.py
6262
language: script
6363
files: \.py$
64+
# This script documents and matches the very patterns it forbids, so
65+
# it must not scan itself or other dev-only tooling.
66+
exclude: ^scripts/
6467
- repo: https://github.com/executablebooks/mdformat
6568
rev: 0.7.22
6669
hooks:

contributing/samples/mcp/mcp_sse_agent/agent.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
15+
import logging
1616
import os
1717
import pprint
1818
from typing import Any
@@ -24,6 +24,13 @@
2424
from google.adk.tools.mcp_tool.mcp_toolset import MCPToolset
2525
from google.adk.tools.tool_context import ToolContext
2626

27+
# Configure logging; the mcp_tool logger must be set to
28+
# DEBUG to capture http_debug_info
29+
logging.basicConfig(level=logging.INFO)
30+
logging.getLogger('google_adk.google.adk.tools.mcp_tool.mcp_tool').setLevel(
31+
logging.DEBUG
32+
)
33+
2734
_allowed_path = os.path.dirname(os.path.abspath(__file__))
2835

2936
connection_params = SseConnectionParams(
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"events": [
3+
{
4+
"author": "user",
5+
"content": {
6+
"parts": [
7+
{
8+
"text": "Hello! What can you help me with?"
9+
}
10+
],
11+
"role": "user"
12+
},
13+
"id": "e-1",
14+
"invocationId": "i-1",
15+
"nodeInfo": {
16+
"path": ""
17+
}
18+
},
19+
{
20+
"author": "interactions_test_agent",
21+
"content": {
22+
"parts": [
23+
{
24+
"text": "Hello! I am \"interactions_test_agent,\" an agent designed for testing the Interactions API integration.\n\nI can help you with two main tasks:\n1. **Searching the web:** If you have questions that require up-to-date information, I can search the web for you.\n2. **Checking the weather:** I can provide the current weather for a specific city.\n\nHow can I assist you today?"
25+
}
26+
],
27+
"role": "model"
28+
},
29+
"finishReason": "STOP",
30+
"id": "e-2",
31+
"invocationId": "i-1",
32+
"nodeInfo": {
33+
"path": "interactions_test_agent@1"
34+
}
35+
}
36+
]
37+
}
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
{
2+
"events": [
3+
{
4+
"author": "user",
5+
"content": {
6+
"parts": [
7+
{
8+
"text": "What's the weather like in Tokyo?"
9+
}
10+
],
11+
"role": "user"
12+
},
13+
"id": "e-1",
14+
"invocationId": "i-1",
15+
"nodeInfo": {
16+
"path": ""
17+
}
18+
},
19+
{
20+
"author": "interactions_test_agent",
21+
"content": {
22+
"parts": [
23+
{
24+
"functionCall": {
25+
"args": {
26+
"city": "Tokyo"
27+
},
28+
"id": "fc-1",
29+
"name": "get_current_weather"
30+
}
31+
}
32+
],
33+
"role": "model"
34+
},
35+
"finishReason": "STOP",
36+
"id": "e-2",
37+
"invocationId": "i-1",
38+
"longRunningToolIds": [],
39+
"nodeInfo": {
40+
"path": "interactions_test_agent@1"
41+
}
42+
},
43+
{
44+
"author": "interactions_test_agent",
45+
"content": {
46+
"parts": [
47+
{
48+
"functionResponse": {
49+
"id": "fc-1",
50+
"name": "get_current_weather",
51+
"response": {
52+
"city": "Tokyo",
53+
"condition": "Partly Cloudy",
54+
"humidity": 60,
55+
"temperature_f": 68
56+
}
57+
}
58+
}
59+
],
60+
"role": "user"
61+
},
62+
"id": "e-3",
63+
"invocationId": "i-1",
64+
"nodeInfo": {
65+
"path": "interactions_test_agent@1"
66+
}
67+
},
68+
{
69+
"author": "interactions_test_agent",
70+
"content": {
71+
"parts": [
72+
{
73+
"text": "I have retrieved the weather information for Tokyo. It is currently 68\u00b0F and partly cloudy with 60% humidity."
74+
}
75+
],
76+
"role": "model"
77+
},
78+
"finishReason": "STOP",
79+
"id": "e-4",
80+
"invocationId": "i-1",
81+
"nodeInfo": {
82+
"path": "interactions_test_agent@1"
83+
}
84+
}
85+
]
86+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"events": [
3+
{
4+
"author": "user",
5+
"content": {
6+
"parts": [
7+
{
8+
"text": "Use google search to find out who wrote the novel '1984'."
9+
}
10+
],
11+
"role": "user"
12+
},
13+
"id": "e-1",
14+
"invocationId": "i-1",
15+
"nodeInfo": {
16+
"path": ""
17+
}
18+
},
19+
{
20+
"author": "interactions_test_agent",
21+
"content": {
22+
"parts": [
23+
{
24+
"text": "search_suggestions='<style>\\n.container {\\n align-items: center;\\n border-radius: 8px;\\n display: flex;\\n font-family: Google Sans, Roboto, sans-serif;\\n font-size: 14px;\\n line-height: 20px;\\n padding: 8px 12px;\\n}\\n.chip {\\n display: inline-block;\\n border: solid 1px;\\n border-radius: 16px;\\n min-width: 14px;\\n padding: 5px 16px;\\n text-align: center;\\n user-select: none;\\n margin: 0 8px;\\n -webkit-tap-highlight-color: transparent;\\n}\\n.carousel {\\n overflow: auto;\\n scrollbar-width: none;\\n white-space: nowrap;\\n margin-right: -12px;\\n}\\n.headline {\\n display: flex;\\n margin-right: 4px;\\n}\\n.gradient-container {\\n position: relative;\\n}\\n.gradient {\\n position: absolute;\\n transform: translate(3px, -9px);\\n height: 36px;\\n width: 9px;\\n}\\n@media (prefers-color-scheme: light) {\\n .container {\\n background-color: #fafafa;\\n box-shadow: 0 0 0 1px #0000000f;\\n }\\n .headline-label {\\n color: #1f1f1f;\\n }\\n .chip {\\n background-color: #ffffff;\\n border-color: #d2d2d2;\\n color: #5e5e5e;\\n text-decoration: none;\\n }\\n .chip:hover {\\n background-color: #f2f2f2;\\n }\\n .chip:focus {\\n background-color: #f2f2f2;\\n }\\n .chip:active {\\n background-color: #d8d8d8;\\n border-color: #b6b6b6;\\n }\\n .logo-dark {\\n display: none;\\n }\\n .gradient {\\n background: linear-gradient(90deg, #fafafa 15%, #fafafa00 100%);\\n }\\n}\\n@media (prefers-color-scheme: dark) {\\n .container {\\n background-color: #1f1f1f;\\n box-shadow: 0 0 0 1px #ffffff26;\\n }\\n .headline-label {\\n color: #fff;\\n }\\n .chip {\\n background-color: #2c2c2c;\\n border-color: #3c4043;\\n color: #fff;\\n text-decoration: none;\\n }\\n .chip:hover {\\n background-color: #353536;\\n }\\n .chip:focus {\\n background-color: #353536;\\n }\\n .chip:active {\\n background-color: #464849;\\n border-color: #53575b;\\n }\\n .logo-light {\\n display: none;\\n }\\n .gradient {\\n background: linear-gradient(90deg, #1f1f1f 15%, #1f1f1f00 100%);\\n }\\n}\\n</style>\\n<div class=\"container\">\\n <div class=\"headline\">\\n <svg class=\"logo-light\" width=\"18\" height=\"18\" viewBox=\"9 9 35 35\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M42.8622 27.0064C42.8622 25.7839 42.7525 24.6084 42.5487 23.4799H26.3109V30.1568H35.5897C35.1821 32.3041 33.9596 34.1222 32.1258 35.3448V39.6864H37.7213C40.9814 36.677 42.8622 32.2571 42.8622 27.0064V27.0064Z\" fill=\"#4285F4\"/>\\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M26.3109 43.8555C30.9659 43.8555 34.8687 42.3195 37.7213 39.6863L32.1258 35.3447C30.5898 36.3792 28.6306 37.0061 26.3109 37.0061C21.8282 37.0061 18.0195 33.9811 16.6559 29.906H10.9194V34.3573C13.7563 39.9841 19.5712 43.8555 26.3109 43.8555V43.8555Z\" fill=\"#34A853\"/>\\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M16.6559 29.8904C16.3111 28.8559 16.1074 27.7588 16.1074 26.6146C16.1074 25.4704 16.3111 24.3733 16.6559 23.3388V18.8875H10.9194C9.74388 21.2072 9.06992 23.8247 9.06992 26.6146C9.06992 29.4045 9.74388 32.022 10.9194 34.3417L15.3864 30.8621L16.6559 29.8904V29.8904Z\" fill=\"#FBBC05\"/>\\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M26.3109 16.2386C28.85 16.2386 31.107 17.1164 32.9095 18.8091L37.8466 13.8719C34.853 11.082 30.9659 9.3736 26.3109 9.3736C19.5712 9.3736 13.7563 13.245 10.9194 18.8875L16.6559 23.3388C18.0195 19.2636 21.8282 16.2386 26.3109 16.2386V16.2386Z\" fill=\"#EA4335\"/>\\n </svg>\\n <svg class=\"logo-dark\" width=\"18\" height=\"18\" viewBox=\"0 0 48 48\" xmlns=\"http://www.w3.org/2000/svg\">\\n <circle cx=\"24\" cy=\"23\" fill=\"#FFF\" r=\"22\"/>\\n <path d=\"M33.76 34.26c2.75-2.56 4.49-6.37 4.49-11.26 0-.89-.08-1.84-.29-3H24.01v5.99h8.03c-.4 2.02-1.5 3.56-3.07 4.56v.75l3.91 2.97h.88z\" fill=\"#4285F4\"/>\\n <path d=\"M15.58 25.77A8.845 8.845 0 0 0 24 31.86c1.92 0 3.62-.46 4.97-1.31l4.79 3.71C31.14 36.7 27.65 38 24 38c-5.93 0-11.01-3.4-13.45-8.36l.17-1.01 4.06-2.85h.8z\" fill=\"#34A853\"/>\\n <path d=\"M15.59 20.21a8.864 8.864 0 0 0 0 5.58l-5.03 3.86c-.98-2-1.53-4.25-1.53-6.64 0-2.39.55-4.64 1.53-6.64l1-.22 3.81 2.98.22 1.08z\" fill=\"#FBBC05\"/>\\n <path d=\"M24 14.14c2.11 0 4.02.75 5.52 1.98l4.36-4.36C31.22 9.43 27.81 8 24 8c-5.93 0-11.01 3.4-13.45 8.36l5.03 3.85A8.86 8.86 0 0 1 24 14.14z\" fill=\"#EA4335\"/>\\n </svg>\\n <div class=\"gradient-container\"><div class=\"gradient\"></div></div>\\n </div>\\n <div class=\"carousel\">\\n<a class=\"chip\" href=\"https://www.google.com/search?q=who+wrote+the+novel+1984&client=app-vertex-grounding&safesearch=active\">who wrote the novel 1984</a>\\n </div>\\n</div>'"
25+
},
26+
{
27+
"text": "The novel *1984* was written by the English author **George Orwell** (whose real name was Eric Arthur Blair). It was published in 1949."
28+
}
29+
],
30+
"role": "model"
31+
},
32+
"finishReason": "STOP",
33+
"id": "e-2",
34+
"invocationId": "i-1",
35+
"nodeInfo": {
36+
"path": "interactions_test_agent@1"
37+
}
38+
}
39+
]
40+
}

0 commit comments

Comments
 (0)