agent-starter-pack 0.10.1__py3-none-any.whl → 0.11.1__py3-none-any.whl

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.
Files changed (50) hide show
  1. {agent_starter_pack-0.10.1.dist-info → agent_starter_pack-0.11.1.dist-info}/METADATA +10 -3
  2. {agent_starter_pack-0.10.1.dist-info → agent_starter_pack-0.11.1.dist-info}/RECORD +43 -49
  3. agents/crewai_coding_crew/.template/templateconfig.yaml +2 -2
  4. agents/crewai_coding_crew/tests/integration/test_agent.py +1 -1
  5. agents/langgraph_base_react/.template/templateconfig.yaml +1 -1
  6. agents/langgraph_base_react/tests/integration/test_agent.py +1 -1
  7. src/base_template/deployment/terraform/dev/iam.tf +12 -11
  8. src/base_template/deployment/terraform/dev/variables.tf +2 -7
  9. src/base_template/deployment/terraform/github.tf +14 -0
  10. src/base_template/deployment/terraform/iam.tf +10 -7
  11. src/base_template/deployment/terraform/service_accounts.tf +4 -5
  12. src/base_template/deployment/terraform/variables.tf +2 -7
  13. src/base_template/deployment/terraform/{% if cookiecutter.cicd_runner == 'google_cloud_build' %}build_triggers.tf{% else %}unused_build_triggers.tf{% endif %} +4 -2
  14. src/base_template/pyproject.toml +2 -2
  15. src/base_template/{% if cookiecutter.cicd_runner == 'github_actions' %}.github{% else %}unused_github{% endif %}/workflows/deploy-to-prod.yaml +3 -0
  16. src/base_template/{% if cookiecutter.cicd_runner == 'github_actions' %}.github{% else %}unused_github{% endif %}/workflows/staging.yaml +1 -0
  17. src/base_template/{% if cookiecutter.cicd_runner == 'google_cloud_build' %}.cloudbuild{% else %}unused_.cloudbuild{% endif %}/deploy-to-prod.yaml +1 -0
  18. src/base_template/{% if cookiecutter.cicd_runner == 'google_cloud_build' %}.cloudbuild{% else %}unused_.cloudbuild{% endif %}/staging.yaml +1 -0
  19. src/cli/commands/create.py +202 -100
  20. src/cli/commands/enhance.py +302 -0
  21. src/cli/commands/list.py +23 -11
  22. src/cli/main.py +2 -0
  23. src/cli/utils/logging.py +40 -0
  24. src/cli/utils/remote_template.py +55 -16
  25. src/cli/utils/template.py +212 -94
  26. src/deployment_targets/agent_engine/app/agent_engine_app.py +8 -0
  27. src/deployment_targets/cloud_run/app/server.py +1 -1
  28. src/deployment_targets/cloud_run/deployment/terraform/dev/service.tf +1 -1
  29. src/deployment_targets/cloud_run/deployment/terraform/service.tf +2 -2
  30. src/resources/locks/uv-adk_base-agent_engine.lock +312 -312
  31. src/resources/locks/uv-adk_base-cloud_run.lock +403 -404
  32. src/resources/locks/uv-adk_gemini_fullstack-agent_engine.lock +312 -312
  33. src/resources/locks/uv-adk_gemini_fullstack-cloud_run.lock +403 -404
  34. src/resources/locks/uv-agentic_rag-agent_engine.lock +371 -371
  35. src/resources/locks/uv-agentic_rag-cloud_run.lock +477 -478
  36. src/resources/locks/uv-crewai_coding_crew-agent_engine.lock +661 -591
  37. src/resources/locks/uv-crewai_coding_crew-cloud_run.lock +868 -760
  38. src/resources/locks/uv-langgraph_base_react-agent_engine.lock +496 -446
  39. src/resources/locks/uv-langgraph_base_react-cloud_run.lock +639 -565
  40. src/resources/locks/uv-live_api-cloud_run.lock +584 -510
  41. agents/adk_gemini_fullstack/.template/templateconfig.yaml +0 -39
  42. agents/adk_gemini_fullstack/README.md +0 -27
  43. agents/adk_gemini_fullstack/app/agent.py +0 -412
  44. agents/adk_gemini_fullstack/app/config.py +0 -46
  45. agents/adk_gemini_fullstack/notebooks/adk_app_testing.ipynb +0 -355
  46. agents/adk_gemini_fullstack/notebooks/evaluating_adk_agent.ipynb +0 -1528
  47. agents/adk_gemini_fullstack/tests/integration/test_agent.py +0 -58
  48. {agent_starter_pack-0.10.1.dist-info → agent_starter_pack-0.11.1.dist-info}/WHEEL +0 -0
  49. {agent_starter_pack-0.10.1.dist-info → agent_starter_pack-0.11.1.dist-info}/entry_points.txt +0 -0
  50. {agent_starter_pack-0.10.1.dist-info → agent_starter_pack-0.11.1.dist-info}/licenses/LICENSE +0 -0
@@ -1,355 +0,0 @@
1
- {
2
- "cells": [
3
- {
4
- "cell_type": "markdown",
5
- "metadata": {},
6
- "source": [
7
- "# ADK Application Testing\n",
8
- "\n",
9
- "This notebook demonstrates how to test an ADK (Agent Development Kit) application.\n",
10
- "It covers both local and remote testing, both with Agent Engine and Cloud Run.\n",
11
- "\n",
12
- "<img src=\"https://github.com/GoogleCloudPlatform/agent-starter-pack/blob/main/docs/images/adk_logo.png?raw=true\" width=\"400\">\n"
13
- ]
14
- },
15
- {
16
- "cell_type": "markdown",
17
- "metadata": {},
18
- "source": [
19
- "## Install dependencies"
20
- ]
21
- },
22
- {
23
- "cell_type": "code",
24
- "execution_count": null,
25
- "metadata": {},
26
- "outputs": [],
27
- "source": [
28
- "!pip install google-cloud-aiplatform --upgrade"
29
- ]
30
- },
31
- {
32
- "cell_type": "markdown",
33
- "metadata": {},
34
- "source": [
35
- "### Import libraries"
36
- ]
37
- },
38
- {
39
- "cell_type": "code",
40
- "execution_count": 1,
41
- "metadata": {},
42
- "outputs": [],
43
- "source": [
44
- "import json\n",
45
- "\n",
46
- "import requests\n",
47
- "import vertexai.agent_engines"
48
- ]
49
- },
50
- {
51
- "cell_type": "markdown",
52
- "metadata": {},
53
- "source": [
54
- "## If you are using Agent Engine\n",
55
- "See more documentation at [Agent Engine Overview](https://cloud.google.com/vertex-ai/generative-ai/docs/agent-engine/overview)"
56
- ]
57
- },
58
- {
59
- "cell_type": "markdown",
60
- "metadata": {},
61
- "source": [
62
- "### Remote Testing"
63
- ]
64
- },
65
- {
66
- "cell_type": "code",
67
- "execution_count": 4,
68
- "metadata": {},
69
- "outputs": [],
70
- "source": [
71
- "# Replace with your Agent Engine ID\n",
72
- "AGENT_ENGINE_ID = \"projects/PROJECT_ID/locations/us-central1/reasoningEngines/ENGINE_ID\""
73
- ]
74
- },
75
- {
76
- "cell_type": "code",
77
- "execution_count": 5,
78
- "metadata": {},
79
- "outputs": [],
80
- "source": [
81
- "remote_agent_engine = vertexai.agent_engines.get(AGENT_ENGINE_ID)"
82
- ]
83
- },
84
- {
85
- "cell_type": "code",
86
- "execution_count": null,
87
- "metadata": {},
88
- "outputs": [],
89
- "source": [
90
- "for event in remote_agent_engine.stream_query(message=\"hi!\", user_id=\"test\"):\n",
91
- " print(event)"
92
- ]
93
- },
94
- {
95
- "cell_type": "code",
96
- "execution_count": null,
97
- "metadata": {},
98
- "outputs": [],
99
- "source": [
100
- "remote_agent_engine.register_feedback(\n",
101
- " feedback={\n",
102
- " \"score\": 5,\n",
103
- " \"text\": \"Great response!\",\n",
104
- " \"invocation_id\": \"test-invocation-123\",\n",
105
- " \"user_id\": \"test\",\n",
106
- " }\n",
107
- ")"
108
- ]
109
- },
110
- {
111
- "cell_type": "markdown",
112
- "metadata": {},
113
- "source": [
114
- "### Local Testing\n",
115
- "\n",
116
- "You can import directly the AgentEngineApp class within your environment. \n",
117
- "To run the agent locally, follow these steps:\n",
118
- "1. Make sure all required packages are installed in your environment\n",
119
- "2. The recommended approach is to use the same virtual environment created by the 'uv' tool\n",
120
- "3. You can set up this environment by running 'make install' from your agent's root directory\n",
121
- "4. Then select this kernel (.venv folder in your project) in your Jupyter notebook to ensure all dependencies are available"
122
- ]
123
- },
124
- {
125
- "cell_type": "code",
126
- "execution_count": 2,
127
- "metadata": {},
128
- "outputs": [],
129
- "source": [
130
- "# Uncomment the following lines if you're not using the virtual environment created by uv\n",
131
- "# import sys\n",
132
- "# sys.path.append(\"../\")"
133
- ]
134
- },
135
- {
136
- "cell_type": "code",
137
- "execution_count": null,
138
- "metadata": {},
139
- "outputs": [],
140
- "source": [
141
- "from app.agent import root_agent\n",
142
- "from app.agent_engine_app import AgentEngineApp\n",
143
- "\n",
144
- "agent_engine = AgentEngineApp(agent=root_agent)"
145
- ]
146
- },
147
- {
148
- "cell_type": "code",
149
- "execution_count": null,
150
- "metadata": {},
151
- "outputs": [],
152
- "source": [
153
- "for event in agent_engine.stream_query(message=\"hi!\", user_id=\"test\"):\n",
154
- " print(event)"
155
- ]
156
- },
157
- {
158
- "cell_type": "markdown",
159
- "metadata": {},
160
- "source": [
161
- "## If you are using Cloud Run"
162
- ]
163
- },
164
- {
165
- "cell_type": "markdown",
166
- "metadata": {},
167
- "source": [
168
- "#### Remote Testing\n",
169
- "\n",
170
- "For more information about authenticating HTTPS requests to Cloud Run services, see:\n",
171
- "[Cloud Run Authentication Documentation](https://cloud.google.com/run/docs/triggering/https-request)\n",
172
- "\n",
173
- "Remote testing involves using a deployed service URL instead of localhost.\n",
174
- "\n",
175
- "Authentication is handled using GCP identity tokens instead of local credentials."
176
- ]
177
- },
178
- {
179
- "cell_type": "code",
180
- "execution_count": 20,
181
- "metadata": {},
182
- "outputs": [],
183
- "source": [
184
- "ID_TOKEN = get_ipython().getoutput(\"gcloud auth print-identity-token -q\")[0]"
185
- ]
186
- },
187
- {
188
- "cell_type": "code",
189
- "execution_count": null,
190
- "metadata": {},
191
- "outputs": [],
192
- "source": [
193
- "SERVICE_URL = \"YOUR_SERVICE_URL_HERE\" # Replace with your Cloud Run service URL"
194
- ]
195
- },
196
- {
197
- "cell_type": "markdown",
198
- "metadata": {},
199
- "source": [
200
- "You'll need to first create a Session"
201
- ]
202
- },
203
- {
204
- "cell_type": "code",
205
- "execution_count": null,
206
- "metadata": {},
207
- "outputs": [],
208
- "source": [
209
- "user_id = \"test_user_123\"\n",
210
- "session_data = {\"state\": {\"preferred_language\": \"English\", \"visit_count\": 1}}\n",
211
- "\n",
212
- "session_url = f\"{SERVICE_URL}/apps/app/users/{user_id}/sessions\"\n",
213
- "headers = {\"Content-Type\": \"application/json\", \"Authorization\": f\"Bearer {ID_TOKEN}\"}\n",
214
- "\n",
215
- "session_response = requests.post(session_url, headers=headers, json=session_data)\n",
216
- "print(f\"Session creation status code: {session_response.status_code}\")\n",
217
- "print(f\"Session creation response: {session_response.json()}\")\n",
218
- "session_id = session_response.json()[\"id\"]"
219
- ]
220
- },
221
- {
222
- "cell_type": "markdown",
223
- "metadata": {},
224
- "source": [
225
- "Then you will be able to send a message"
226
- ]
227
- },
228
- {
229
- "cell_type": "code",
230
- "execution_count": null,
231
- "metadata": {},
232
- "outputs": [],
233
- "source": [
234
- "message_data = {\n",
235
- " \"app_name\": \"app\",\n",
236
- " \"user_id\": user_id,\n",
237
- " \"session_id\": session_id,\n",
238
- " \"new_message\": {\"role\": \"user\", \"parts\": [{\"text\": \"Hello! Weather in New york?\"}]},\n",
239
- " \"streaming\": True,\n",
240
- "}\n",
241
- "\n",
242
- "message_url = f\"{SERVICE_URL}/run_sse\"\n",
243
- "message_response = requests.post(\n",
244
- " message_url, headers=headers, json=message_data, stream=True\n",
245
- ")\n",
246
- "\n",
247
- "print(f\"Message send status code: {message_response.status_code}\")\n",
248
- "\n",
249
- "# Print streamed response\n",
250
- "for line in message_response.iter_lines():\n",
251
- " if line:\n",
252
- " line_str = line.decode(\"utf-8\")\n",
253
- " if line_str.startswith(\"data: \"):\n",
254
- " event_json = line_str[6:]\n",
255
- " event = json.loads(event_json)\n",
256
- " print(f\"Received event: {event}\")"
257
- ]
258
- },
259
- {
260
- "cell_type": "markdown",
261
- "metadata": {},
262
- "source": [
263
- "### Local Testing\n",
264
- "\n",
265
- "> You can run the application locally via the `make local-backend` command."
266
- ]
267
- },
268
- {
269
- "cell_type": "markdown",
270
- "metadata": {},
271
- "source": [
272
- "#### Create a session\n",
273
- " Create a new session with user preferences and state information\n"
274
- ]
275
- },
276
- {
277
- "cell_type": "code",
278
- "execution_count": null,
279
- "metadata": {},
280
- "outputs": [],
281
- "source": [
282
- "user_id = \"test_user_123\"\n",
283
- "session_data = {\"state\": {\"preferred_language\": \"English\", \"visit_count\": 1}}\n",
284
- "\n",
285
- "session_url = f\"http://127.0.0.1:8000/apps/app/users/{user_id}/sessions\"\n",
286
- "headers = {\"Content-Type\": \"application/json\"}\n",
287
- "\n",
288
- "session_response = requests.post(session_url, headers=headers, json=session_data)\n",
289
- "print(f\"Session creation status code: {session_response.status_code}\")\n",
290
- "print(f\"Session creation response: {session_response.json()}\")\n",
291
- "session_id = session_response.json()[\"id\"]"
292
- ]
293
- },
294
- {
295
- "cell_type": "markdown",
296
- "metadata": {},
297
- "source": [
298
- "#### Send a message\n",
299
- "Send a message to the backend service and receive a streaming response\n"
300
- ]
301
- },
302
- {
303
- "cell_type": "code",
304
- "execution_count": null,
305
- "metadata": {},
306
- "outputs": [],
307
- "source": [
308
- "message_data = {\n",
309
- " \"app_name\": \"app\",\n",
310
- " \"user_id\": user_id,\n",
311
- " \"session_id\": session_id,\n",
312
- " \"new_message\": {\"role\": \"user\", \"parts\": [{\"text\": \"Hello! Weather in New york?\"}]},\n",
313
- " \"streaming\": True,\n",
314
- "}\n",
315
- "\n",
316
- "message_url = \"http://127.0.0.1:8000/run_sse\"\n",
317
- "message_response = requests.post(\n",
318
- " message_url, headers=headers, json=message_data, stream=True\n",
319
- ")\n",
320
- "\n",
321
- "print(f\"Message send status code: {message_response.status_code}\")\n",
322
- "\n",
323
- "# Print streamed response\n",
324
- "for line in message_response.iter_lines():\n",
325
- " if line:\n",
326
- " line_str = line.decode(\"utf-8\")\n",
327
- " if line_str.startswith(\"data: \"):\n",
328
- " event_json = line_str[6:]\n",
329
- " event = json.loads(event_json)\n",
330
- " print(f\"Received event: {event}\")"
331
- ]
332
- }
333
- ],
334
- "metadata": {
335
- "kernelspec": {
336
- "display_name": "Python 3",
337
- "language": "python",
338
- "name": "python3"
339
- },
340
- "language_info": {
341
- "codemirror_mode": {
342
- "name": "ipython",
343
- "version": 3
344
- },
345
- "file_extension": ".py",
346
- "mimetype": "text/x-python",
347
- "name": "python",
348
- "nbconvert_exporter": "python",
349
- "pygments_lexer": "ipython3",
350
- "version": "3.12.2"
351
- }
352
- },
353
- "nbformat": 4,
354
- "nbformat_minor": 2
355
- }