@intentsolutionsio/jeremy-adk-orchestrator 2.1.0 → 2.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -2
- package/agents/a2a-protocol-manager.md +1 -0
- package/package.json +1 -1
- package/skills/adk-deployment-specialist/SKILL.md +14 -7
- package/skills/adk-deployment-specialist/references/errors.md +16 -0
- package/skills/adk-deployment-specialist/references/examples.md +8 -0
- package/skills/adk-deployment-specialist/references/how-it-works.md +3 -0
- package/skills/adk-deployment-specialist/references/workflow-examples.md +4 -0
- package/skills/adk-deployment-specialist/scripts/deploy-agent.sh +1 -1
- package/skills/adk-deployment-specialist/scripts/test-a2a-protocol.py +13 -21
package/README.md
CHANGED
|
@@ -7,6 +7,7 @@ Expert Agent-to-Agent (A2A) protocol manager for communicating with **Vertex AI
|
|
|
7
7
|
## ⚠️ Important: What This Plugin Is For
|
|
8
8
|
|
|
9
9
|
**✅ THIS PLUGIN IS FOR:**
|
|
10
|
+
|
|
10
11
|
- **ADK agents** deployed to **Vertex AI Agent Engine** (fully-managed runtime)
|
|
11
12
|
- **A2A Protocol** communication between Claude Code and ADK agents
|
|
12
13
|
- **Multi-agent orchestration** with ADK supervisory agents
|
|
@@ -14,6 +15,7 @@ Expert Agent-to-Agent (A2A) protocol manager for communicating with **Vertex AI
|
|
|
14
15
|
- Agent Engine features: Code Execution Sandbox, Memory Bank, Sessions
|
|
15
16
|
|
|
16
17
|
**❌ THIS PLUGIN IS NOT FOR:**
|
|
18
|
+
|
|
17
19
|
- LangChain agents (use LangSmith)
|
|
18
20
|
- LlamaIndex agents (not ADK compatible)
|
|
19
21
|
- Cloud Run deployments (use `jeremy-genkit-terraform` with `--cloud-run`)
|
|
@@ -25,6 +27,7 @@ Expert Agent-to-Agent (A2A) protocol manager for communicating with **Vertex AI
|
|
|
25
27
|
This plugin enables Claude Code to communicate with ADK agents deployed on Vertex AI Agent Engine using the standardized A2A (Agent-to-Agent) Protocol. It handles task submission, status checking, session management, and AgentCard discovery for building multi-agent systems.
|
|
26
28
|
|
|
27
29
|
**Key Capabilities:**
|
|
30
|
+
|
|
28
31
|
- AgentCard discovery and capability inspection
|
|
29
32
|
- Task submission with structured inputs
|
|
30
33
|
- Session management for Memory Bank persistence
|
|
@@ -43,6 +46,7 @@ This plugin enables Claude Code to communicate with ADK agents deployed on Verte
|
|
|
43
46
|
### Required Google Cloud Setup
|
|
44
47
|
|
|
45
48
|
**1. Google Cloud Project with APIs Enabled:**
|
|
49
|
+
|
|
46
50
|
```bash
|
|
47
51
|
# Enable required APIs
|
|
48
52
|
gcloud services enable aiplatform.googleapis.com \
|
|
@@ -54,6 +58,7 @@ gcloud services enable aiplatform.googleapis.com \
|
|
|
54
58
|
```
|
|
55
59
|
|
|
56
60
|
**2. Authentication:**
|
|
61
|
+
|
|
57
62
|
```bash
|
|
58
63
|
# Application Default Credentials
|
|
59
64
|
gcloud auth application-default login
|
|
@@ -63,6 +68,7 @@ export GOOGLE_APPLICATION_CREDENTIALS="/path/to/service-account-key.json"
|
|
|
63
68
|
```
|
|
64
69
|
|
|
65
70
|
**3. Required IAM Permissions:**
|
|
71
|
+
|
|
66
72
|
```yaml
|
|
67
73
|
# Minimum required roles:
|
|
68
74
|
- roles/aiplatform.user # Query Agent Engine resources
|
|
@@ -74,6 +80,7 @@ export GOOGLE_APPLICATION_CREDENTIALS="/path/to/service-account-key.json"
|
|
|
74
80
|
### Required Python Packages
|
|
75
81
|
|
|
76
82
|
**Install via pip:**
|
|
83
|
+
|
|
77
84
|
```bash
|
|
78
85
|
# Core ADK SDK (required for agent development)
|
|
79
86
|
pip install google-adk>=1.15.1
|
|
@@ -94,6 +101,7 @@ pip install google-cloud-trace>=1.13.0
|
|
|
94
101
|
```
|
|
95
102
|
|
|
96
103
|
**All dependencies at once:**
|
|
104
|
+
|
|
97
105
|
```bash
|
|
98
106
|
pip install --upgrade \
|
|
99
107
|
'google-adk>=1.15.1' \
|
|
@@ -128,6 +136,7 @@ agent = client.agent_engines.get(
|
|
|
128
136
|
```
|
|
129
137
|
|
|
130
138
|
**Verify SDK Installation:**
|
|
139
|
+
|
|
131
140
|
```bash
|
|
132
141
|
python3 -c "import vertexai; print('Vertex AI SDK ready')"
|
|
133
142
|
python3 -c "import google.adk; print(f'ADK SDK version: {google.adk.__version__}')"
|
|
@@ -138,6 +147,7 @@ python3 -c "import google.adk; print(f'ADK SDK version: {google.adk.__version__}
|
|
|
138
147
|
**This plugin works with ADK agents deployed via:**
|
|
139
148
|
|
|
140
149
|
1. **ADK CLI Deployment:**
|
|
150
|
+
|
|
141
151
|
```bash
|
|
142
152
|
# Install ADK CLI
|
|
143
153
|
pip install google-adk
|
|
@@ -147,7 +157,8 @@ adk deploy cloud_run # Deploy to Cloud Run
|
|
|
147
157
|
# Or deploy via the Python SDK (see method 2 below) for Agent Engine
|
|
148
158
|
```
|
|
149
159
|
|
|
150
|
-
|
|
160
|
+
1. **Python SDK Deployment:**
|
|
161
|
+
|
|
151
162
|
```python
|
|
152
163
|
from google.adk.agents import Agent
|
|
153
164
|
import vertexai
|
|
@@ -171,7 +182,8 @@ remote_agent = client.agent_engines.create(
|
|
|
171
182
|
print(f"Agent deployed: {remote_agent.resource_name}")
|
|
172
183
|
```
|
|
173
184
|
|
|
174
|
-
|
|
185
|
+
1. **Terraform Deployment:**
|
|
186
|
+
|
|
175
187
|
```hcl
|
|
176
188
|
resource "google_vertex_ai_reasoning_engine" "adk_agent" {
|
|
177
189
|
display_name = "my-adk-agent"
|
|
@@ -222,9 +234,11 @@ resource "google_vertex_ai_reasoning_engine" "adk_agent" {
|
|
|
222
234
|
## Components
|
|
223
235
|
|
|
224
236
|
### Agent
|
|
237
|
+
|
|
225
238
|
- **a2a-protocol-manager**: A2A protocol expert with task orchestration capabilities
|
|
226
239
|
|
|
227
240
|
### Skills (Auto-Activating)
|
|
241
|
+
|
|
228
242
|
- **a2a-protocol-manager**: Triggers on "communicate with ADK agent", "orchestrate agents", "send task to agent"
|
|
229
243
|
- **Tool Permissions**: Read, Bash, Write, Grep (for agent communication)
|
|
230
244
|
- **Version**: 1.0.0 (2026 schema compliant)
|
|
@@ -709,30 +723,35 @@ ORDER BY total_latency DESC;
|
|
|
709
723
|
## Use Cases
|
|
710
724
|
|
|
711
725
|
### Single Agent Communication
|
|
726
|
+
|
|
712
727
|
```
|
|
713
728
|
"Communicate with the sentiment-analysis ADK agent at [endpoint]"
|
|
714
729
|
"Send customer reviews to the analysis agent"
|
|
715
730
|
```
|
|
716
731
|
|
|
717
732
|
### Multi-Agent Workflows
|
|
733
|
+
|
|
718
734
|
```
|
|
719
735
|
"Orchestrate data extraction, analysis, and synthesis agents"
|
|
720
736
|
"Run a multi-step workflow across these ADK agents: [list]"
|
|
721
737
|
```
|
|
722
738
|
|
|
723
739
|
### Session Management
|
|
740
|
+
|
|
724
741
|
```
|
|
725
742
|
"Continue the conversation with session ID abc-123"
|
|
726
743
|
"Create a new session with Memory Bank persistence"
|
|
727
744
|
```
|
|
728
745
|
|
|
729
746
|
### Status Monitoring
|
|
747
|
+
|
|
730
748
|
```
|
|
731
749
|
"Check status of task ID xyz-456"
|
|
732
750
|
"Monitor the long-running analysis task"
|
|
733
751
|
```
|
|
734
752
|
|
|
735
753
|
### Capability Discovery
|
|
754
|
+
|
|
736
755
|
```
|
|
737
756
|
"Discover capabilities of the agent at [endpoint]"
|
|
738
757
|
"What tools does this ADK agent support?"
|
|
@@ -741,14 +760,17 @@ ORDER BY total_latency DESC;
|
|
|
741
760
|
## Integration with Other Plugins
|
|
742
761
|
|
|
743
762
|
### jeremy-vertex-engine
|
|
763
|
+
|
|
744
764
|
- Orchestrator invokes agents → Inspector validates health
|
|
745
765
|
- A2A protocol calls → Performance monitoring
|
|
746
766
|
|
|
747
767
|
### jeremy-vertex-validator
|
|
768
|
+
|
|
748
769
|
- Validator checks agent code → Orchestrator deploys and tests
|
|
749
770
|
- Pre-deployment validation → Runtime orchestration
|
|
750
771
|
|
|
751
772
|
### jeremy-adk-terraform
|
|
773
|
+
|
|
752
774
|
- Terraform provisions agents → Orchestrator manages communication
|
|
753
775
|
- Infrastructure deployment → Runtime coordination
|
|
754
776
|
|
|
@@ -380,6 +380,7 @@ class ResilientA2AClient(A2AClient):
|
|
|
380
380
|
## When to Use This Agent
|
|
381
381
|
|
|
382
382
|
Activate this agent when:
|
|
383
|
+
|
|
383
384
|
- Communicating with deployed ADK agents on Agent Engine
|
|
384
385
|
- Setting up multi-agent workflows
|
|
385
386
|
- Managing stateful conversations with Memory Bank
|
package/package.json
CHANGED
|
@@ -1,15 +1,22 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: adk-deployment-specialist
|
|
3
|
-
description:
|
|
4
|
-
|
|
3
|
+
description: 'Deploy and orchestrate Vertex AI ADK agents using A2A protocol. Manages
|
|
4
|
+
AgentCard discovery, task submission, Code Execution Sandbox, and Memory Bank. Use
|
|
5
|
+
when asked to "deploy ADK agent" or "orchestrate agents". Trigger with phrases like
|
|
6
|
+
''deploy'', ''infrastructure'', or ''CI/CD''.
|
|
7
|
+
|
|
8
|
+
'
|
|
5
9
|
allowed-tools: Read, Write, Edit, Grep, Glob, Bash(cmd:*)
|
|
6
10
|
version: 2.1.0
|
|
7
11
|
author: Jeremy Longshore <jeremy@intentsolutions.io>
|
|
8
12
|
license: MIT
|
|
9
|
-
compatible-with: claude-code, codex, openclaw
|
|
10
13
|
effort: high
|
|
11
|
-
argument-hint:
|
|
12
|
-
tags:
|
|
14
|
+
argument-hint: <agent-name or project-id>
|
|
15
|
+
tags:
|
|
16
|
+
- ai
|
|
17
|
+
- deployment
|
|
18
|
+
- ci-cd
|
|
19
|
+
compatibility: Designed for Claude Code, also compatible with Codex and OpenClaw
|
|
13
20
|
---
|
|
14
21
|
# Adk Deployment Specialist
|
|
15
22
|
|
|
@@ -49,6 +56,6 @@ See `${CLAUDE_SKILL_DIR}/references/examples.md` for detailed examples.
|
|
|
49
56
|
|
|
50
57
|
## Resources
|
|
51
58
|
|
|
52
|
-
- ADK docs:
|
|
59
|
+
- ADK docs:
|
|
53
60
|
- Workload Identity (CI/CD): https://cloud.google.com/iam/docs/workload-identity-federation
|
|
54
|
-
- A2A / AgentCard patterns: see `000-docs/6767-a-SPEC-DR-STND-claude-code-plugins-standard.md`
|
|
61
|
+
- A2A / AgentCard patterns: see `000-docs/6767-a-SPEC-DR-STND-claude-code-plugins-standard.md`
|
|
@@ -3,56 +3,68 @@
|
|
|
3
3
|
## Deployment Failures
|
|
4
4
|
|
|
5
5
|
### `google.api_core.exceptions.NotFound: 404 Reasoning engine not found`
|
|
6
|
+
|
|
6
7
|
- **Cause**: The reasoning engine resource name is incorrect or the resource was deleted.
|
|
7
8
|
- **Fix**: Verify the resource name with `client.agent_engines.list()` and confirm the project/location match.
|
|
8
9
|
|
|
9
10
|
### `google.api_core.exceptions.PermissionDenied: 403 Permission denied on resource`
|
|
11
|
+
|
|
10
12
|
- **Cause**: The service account or user lacks required IAM roles.
|
|
11
13
|
- **Fix**: Grant `roles/aiplatform.user` for querying agents, `roles/aiplatform.admin` for creating/deleting. Use `gcloud projects get-iam-policy PROJECT_ID` to audit current bindings.
|
|
12
14
|
|
|
13
15
|
### `google.api_core.exceptions.InvalidArgument: 400 Invalid agent configuration`
|
|
16
|
+
|
|
14
17
|
- **Cause**: The agent definition has invalid fields, unsupported model, or malformed tools.
|
|
15
18
|
- **Fix**: Verify the model string (e.g., `gemini-2.5-flash`), ensure all tool functions have proper type hints and docstrings, and check that `requirements` list includes all needed packages.
|
|
16
19
|
|
|
17
20
|
### `google.api_core.exceptions.ResourceExhausted: 429 Quota exceeded`
|
|
21
|
+
|
|
18
22
|
- **Cause**: Project has hit the Agent Engine quota (default: 10 reasoning engines per project).
|
|
19
23
|
- **Fix**: Request quota increase via Cloud Console > IAM & Admin > Quotas, or delete unused agents with `client.agent_engines.delete(name=resource_name)`.
|
|
20
24
|
|
|
21
25
|
### Deployment hangs or times out
|
|
26
|
+
|
|
22
27
|
- **Cause**: Large dependency list, network issues, or package build failures in the remote environment.
|
|
23
28
|
- **Fix**: Minimize `requirements` to only what the agent needs. Pin exact versions. Check Cloud Build logs via `gcloud builds list --project=PROJECT_ID`.
|
|
24
29
|
|
|
25
30
|
## Authentication & Authorization Issues
|
|
26
31
|
|
|
27
32
|
### `google.auth.exceptions.DefaultCredentialsError: Could not automatically determine credentials`
|
|
33
|
+
|
|
28
34
|
- **Cause**: No Application Default Credentials configured.
|
|
29
35
|
- **Fix**: Run `gcloud auth application-default login` for local development, or set `GOOGLE_APPLICATION_CREDENTIALS` to a service account key path. For production, use Workload Identity Federation.
|
|
30
36
|
|
|
31
37
|
### `google.auth.exceptions.RefreshError: ('invalid_grant: Token has been expired or revoked')`
|
|
38
|
+
|
|
32
39
|
- **Cause**: Cached credentials are stale or the service account key was rotated.
|
|
33
40
|
- **Fix**: Re-authenticate with `gcloud auth application-default login`. For service accounts, generate a new key and update `GOOGLE_APPLICATION_CREDENTIALS`.
|
|
34
41
|
|
|
35
42
|
### Agent runs but returns permission errors at runtime
|
|
43
|
+
|
|
36
44
|
- **Cause**: The Agent Engine service agent (the identity the deployed agent runs as) lacks permissions to call downstream APIs (e.g., GKE, Cloud Run).
|
|
37
45
|
- **Fix**: Grant the Agent Engine service agent (`service-PROJECT_NUMBER@gcp-sa-aiplatform-re.iam.gserviceaccount.com`) the required roles for the APIs the agent's tools invoke.
|
|
38
46
|
|
|
39
47
|
## Orchestration Failures
|
|
40
48
|
|
|
41
49
|
### Sub-agent in SequentialAgent fails mid-pipeline
|
|
50
|
+
|
|
42
51
|
- **Cause**: One agent in the chain returned an error or produced output the next agent could not process.
|
|
43
52
|
- **Fix**: Wrap each sub-agent in error-handling instructions. Add a `try/except` around the orchestrator call. Check which sub-agent failed by inspecting the `events` in the runner response.
|
|
44
53
|
|
|
45
54
|
### ParallelAgent produces inconsistent results
|
|
55
|
+
|
|
46
56
|
- **Cause**: Parallel sub-agents share no state by default; if they depend on each other's output, results are non-deterministic.
|
|
47
57
|
- **Fix**: Use `SequentialAgent` when ordering matters. Only use `ParallelAgent` for truly independent tasks.
|
|
48
58
|
|
|
49
59
|
### LoopAgent exceeds max iterations
|
|
60
|
+
|
|
50
61
|
- **Cause**: The exit condition was never met, or the loop agent's `should_continue` logic has a bug.
|
|
51
62
|
- **Fix**: Set `max_iterations` on the `LoopAgent`. Add explicit exit conditions in the agent's instructions. Monitor iteration count in logs.
|
|
52
63
|
|
|
53
64
|
## SDK & Import Errors
|
|
54
65
|
|
|
55
66
|
### `ImportError: cannot import name 'Agent' from 'google.adk'`
|
|
67
|
+
|
|
56
68
|
- **Cause**: Using the wrong import path.
|
|
57
69
|
- **Fix**: The correct import is `from google.adk.agents import Agent`. Other common imports:
|
|
58
70
|
- `from google.adk.agents import SequentialAgent, ParallelAgent, LoopAgent`
|
|
@@ -61,6 +73,7 @@
|
|
|
61
73
|
- `from google.adk.tools import FunctionTool`
|
|
62
74
|
|
|
63
75
|
### `ModuleNotFoundError: No module named 'google.adk'`
|
|
76
|
+
|
|
64
77
|
- **Cause**: ADK SDK not installed or wrong Python environment.
|
|
65
78
|
- **Fix**: Install with `pip install google-adk>=1.15.1`. Verify with `python -c "import google.adk; print(google.adk.__version__)"`.
|
|
66
79
|
|
|
@@ -91,14 +104,17 @@ client.agent_engines.delete(name=agent.resource_name)
|
|
|
91
104
|
## A2A Protocol Errors
|
|
92
105
|
|
|
93
106
|
### AgentCard not found at `/.well-known/agent-card`
|
|
107
|
+
|
|
94
108
|
- **Cause**: The agent does not expose an A2A-compliant AgentCard, or the URL is wrong.
|
|
95
109
|
- **Fix**: Verify the agent was deployed with A2A support. The AgentCard endpoint is `/.well-known/agent-card` (note: no trailing slash). Ensure the agent framework generates this endpoint.
|
|
96
110
|
|
|
97
111
|
### `tasks/send` returns 405 Method Not Allowed
|
|
112
|
+
|
|
98
113
|
- **Cause**: The agent endpoint does not support the A2A task submission method.
|
|
99
114
|
- **Fix**: Confirm the agent was built with A2A protocol support (`a2a-sdk`). Check that the server handles POST to `/tasks/send` with JSON-RPC 2.0 format.
|
|
100
115
|
|
|
101
116
|
### Task polling returns stale status
|
|
117
|
+
|
|
102
118
|
- **Cause**: Eventual consistency or caching in the agent's task store.
|
|
103
119
|
- **Fix**: Implement exponential backoff in polling (start at 2s, max 30s). Use the task's `updatedAt` timestamp to detect stale responses.
|
|
104
120
|
|
|
@@ -5,26 +5,31 @@
|
|
|
5
5
|
These prompts activate the skill and demonstrate common usage patterns:
|
|
6
6
|
|
|
7
7
|
### Deployment
|
|
8
|
+
|
|
8
9
|
- "Deploy this ADK agent to Agent Engine with session persistence enabled."
|
|
9
10
|
- "Create a reasoning engine from my agent.py with gemini-2.5-flash."
|
|
10
11
|
- "Deploy my multi-agent pipeline to Vertex AI Agent Engine in us-central1."
|
|
11
12
|
|
|
12
13
|
### Agent Management (SDK)
|
|
14
|
+
|
|
13
15
|
- "List all deployed agents in my project using the Vertex AI SDK."
|
|
14
16
|
- "Get the status of reasoning engine ID 12345 in us-central1."
|
|
15
17
|
- "Delete the old version of my sentiment-analysis agent from Agent Engine."
|
|
16
18
|
|
|
17
19
|
### Multi-Agent Orchestration
|
|
20
|
+
|
|
18
21
|
- "Build a SequentialAgent pipeline: validate config, deploy resources, run health check."
|
|
19
22
|
- "Create a ParallelAgent that runs data extraction and sentiment analysis simultaneously."
|
|
20
23
|
- "Set up a LoopAgent that retries deployment until health check passes (max 5 iterations)."
|
|
21
24
|
|
|
22
25
|
### A2A Protocol
|
|
26
|
+
|
|
23
27
|
- "Expose an A2A AgentCard at `/.well-known/agent-card` for my deployed agent."
|
|
24
28
|
- "Send a task to the agent at [endpoint] using A2A JSON-RPC protocol."
|
|
25
29
|
- "Discover capabilities of the agent at [endpoint] via its AgentCard."
|
|
26
30
|
|
|
27
31
|
### Session & Memory
|
|
32
|
+
|
|
28
33
|
- "Create a stateful agent with VertexAiSessionService for cross-turn persistence."
|
|
29
34
|
- "Set up a runner with session auto-save for compliance."
|
|
30
35
|
- "Query my deployed agent with session_id to maintain conversation context."
|
|
@@ -32,6 +37,7 @@ These prompts activate the skill and demonstrate common usage patterns:
|
|
|
32
37
|
## Code Snippets
|
|
33
38
|
|
|
34
39
|
### Deploy an Agent
|
|
40
|
+
|
|
35
41
|
```python
|
|
36
42
|
import vertexai
|
|
37
43
|
from google.adk.agents import Agent
|
|
@@ -53,6 +59,7 @@ print(f"Deployed: {remote.resource_name}")
|
|
|
53
59
|
```
|
|
54
60
|
|
|
55
61
|
### List and Query Agents
|
|
62
|
+
|
|
56
63
|
```python
|
|
57
64
|
import vertexai
|
|
58
65
|
|
|
@@ -71,6 +78,7 @@ print(response)
|
|
|
71
78
|
```
|
|
72
79
|
|
|
73
80
|
### Multi-Agent Sequential Pipeline
|
|
81
|
+
|
|
74
82
|
```python
|
|
75
83
|
from google.adk.agents import Agent, SequentialAgent
|
|
76
84
|
|
|
@@ -16,6 +16,7 @@ User Request -> Analyze:
|
|
|
16
16
|
### Phase 2: ADK Agent Implementation
|
|
17
17
|
|
|
18
18
|
**Simple Agent (Python)**:
|
|
19
|
+
|
|
19
20
|
```python
|
|
20
21
|
from google.adk.agents import Agent
|
|
21
22
|
|
|
@@ -33,6 +34,7 @@ Help users deploy resources securely.
|
|
|
33
34
|
```
|
|
34
35
|
|
|
35
36
|
**Multi-Agent Orchestrator (Python)**:
|
|
37
|
+
|
|
36
38
|
```python
|
|
37
39
|
from google.adk.agents import Agent, SequentialAgent
|
|
38
40
|
|
|
@@ -67,6 +69,7 @@ orchestrator = SequentialAgent(
|
|
|
67
69
|
### Phase 3: Code Execution Integration
|
|
68
70
|
|
|
69
71
|
The Code Execution tool provides:
|
|
72
|
+
|
|
70
73
|
- **Security**: Isolated sandbox environment, no access to your system
|
|
71
74
|
- **State Persistence**: Stateful within a session
|
|
72
75
|
- **Stateful Sessions**: Builds on previous executions
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
**User**: "Create an ADK agent that deploys GCP resources"
|
|
8
8
|
|
|
9
9
|
**Implementation**:
|
|
10
|
+
|
|
10
11
|
```python
|
|
11
12
|
from google.adk.agents import Agent
|
|
12
13
|
from google.adk.tools import FunctionTool
|
|
@@ -58,6 +59,7 @@ remote_agent = client.agent_engines.create(
|
|
|
58
59
|
**User**: "Build a multi-agent pipeline with ADK orchestrating retrieval and analysis"
|
|
59
60
|
|
|
60
61
|
**Implementation**:
|
|
62
|
+
|
|
61
63
|
```python
|
|
62
64
|
from google.adk.agents import Agent, SequentialAgent
|
|
63
65
|
|
|
@@ -99,6 +101,7 @@ orchestrator = SequentialAgent(
|
|
|
99
101
|
**User**: "Deploy a GKE cluster agent and check its status"
|
|
100
102
|
|
|
101
103
|
**Implementation**:
|
|
104
|
+
|
|
102
105
|
```python
|
|
103
106
|
import vertexai
|
|
104
107
|
|
|
@@ -138,6 +141,7 @@ print(f"Agent status: {agent.display_name}")
|
|
|
138
141
|
**User**: "Build a stateful agent that remembers context across turns"
|
|
139
142
|
|
|
140
143
|
**Implementation**:
|
|
144
|
+
|
|
141
145
|
```python
|
|
142
146
|
from google.adk.agents import Agent
|
|
143
147
|
from google.adk.runners import Runner
|
|
@@ -72,7 +72,7 @@ echo ""
|
|
|
72
72
|
# Check Python SDK is installed
|
|
73
73
|
if ! python3 -c "import vertexai" 2>/dev/null; then
|
|
74
74
|
echo -e "${YELLOW}Vertex AI SDK not found. Installing...${NC}"
|
|
75
|
-
pip install google-cloud-aiplatform[agent_engines]>=1.120.0 google-adk>=1.15.1
|
|
75
|
+
pip install 'google-cloud-aiplatform[agent_engines]>=1.120.0' 'google-adk>=1.15.1'
|
|
76
76
|
fi
|
|
77
77
|
|
|
78
78
|
# Validate agent files
|
|
@@ -18,11 +18,7 @@ import subprocess
|
|
|
18
18
|
|
|
19
19
|
def get_access_token() -> str:
|
|
20
20
|
"""Get GCP access token"""
|
|
21
|
-
result = subprocess.run(
|
|
22
|
-
["gcloud", "auth", "print-access-token"],
|
|
23
|
-
capture_output=True,
|
|
24
|
-
text=True
|
|
25
|
-
)
|
|
21
|
+
result = subprocess.run(["gcloud", "auth", "print-access-token"], capture_output=True, text=True)
|
|
26
22
|
return result.stdout.strip()
|
|
27
23
|
|
|
28
24
|
|
|
@@ -35,10 +31,7 @@ def test_agent_card(agent_url: str, token: str) -> Dict:
|
|
|
35
31
|
agent_card_url = f"{agent_url}/.well-known/agent-card"
|
|
36
32
|
|
|
37
33
|
try:
|
|
38
|
-
req = urllib.request.Request(
|
|
39
|
-
agent_card_url,
|
|
40
|
-
headers={"Authorization": f"Bearer {token}"}
|
|
41
|
-
)
|
|
34
|
+
req = urllib.request.Request(agent_card_url, headers={"Authorization": f"Bearer {token}"})
|
|
42
35
|
with urllib.request.urlopen(req, timeout=10) as response:
|
|
43
36
|
agent_card = json.loads(response.read().decode())
|
|
44
37
|
|
|
@@ -91,18 +84,15 @@ def test_task_submission(agent_url: str, token: str, message: str) -> Optional[s
|
|
|
91
84
|
req = urllib.request.Request(
|
|
92
85
|
task_url,
|
|
93
86
|
data=json.dumps(payload).encode(),
|
|
94
|
-
headers={
|
|
95
|
-
|
|
96
|
-
"Content-Type": "application/json"
|
|
97
|
-
},
|
|
98
|
-
method="POST"
|
|
87
|
+
headers={"Authorization": f"Bearer {token}", "Content-Type": "application/json"},
|
|
88
|
+
method="POST",
|
|
99
89
|
)
|
|
100
90
|
|
|
101
91
|
with urllib.request.urlopen(req, timeout=30) as response:
|
|
102
92
|
result = json.loads(response.read().decode())
|
|
103
93
|
|
|
104
94
|
task_id = result.get("task_id")
|
|
105
|
-
print(
|
|
95
|
+
print("✓ Task submitted successfully")
|
|
106
96
|
print(f" Task ID: {task_id}")
|
|
107
97
|
print(f" Status: {result.get('status', 'unknown')}")
|
|
108
98
|
|
|
@@ -133,12 +123,14 @@ def test_task_status(agent_url: str, token: str, task_id: str, max_wait: int = 6
|
|
|
133
123
|
|
|
134
124
|
while time.time() - start_time < max_wait:
|
|
135
125
|
try:
|
|
136
|
-
status_payload = json.dumps(
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
126
|
+
status_payload = json.dumps(
|
|
127
|
+
{
|
|
128
|
+
"jsonrpc": "2.0",
|
|
129
|
+
"method": "tasks/get",
|
|
130
|
+
"params": {"id": task_id},
|
|
131
|
+
"id": f"status-{int(time.time())}",
|
|
132
|
+
}
|
|
133
|
+
).encode()
|
|
142
134
|
|
|
143
135
|
req = urllib.request.Request(
|
|
144
136
|
status_url,
|