agent-starter-pack 0.15.7__py3-none-any.whl → 0.17.0__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.
Potentially problematic release.
This version of agent-starter-pack might be problematic. Click here for more details.
- {agents → agent_starter_pack/agents}/adk_base/.template/templateconfig.yaml +1 -1
- {agents/live_api → agent_starter_pack/agents/adk_live}/.template/templateconfig.yaml +5 -7
- agent_starter_pack/agents/adk_live/README.md +32 -0
- agent_starter_pack/agents/adk_live/app/agent.py +48 -0
- agent_starter_pack/agents/adk_live/tests/unit/test_dummy.py +38 -0
- {agents → agent_starter_pack/agents}/agentic_rag/.template/templateconfig.yaml +1 -1
- agent_starter_pack/agents/crewai_coding_crew/app/agent.py +47 -0
- agent_starter_pack/agents/langgraph_base_react/app/agent.py +34 -0
- {src → agent_starter_pack}/base_template/GEMINI.md +1 -1
- {src → agent_starter_pack}/base_template/Makefile +130 -61
- {src → agent_starter_pack}/base_template/README.md +6 -6
- {src → agent_starter_pack}/base_template/deployment/terraform/dev/apis.tf +1 -1
- {src → agent_starter_pack}/base_template/deployment/terraform/dev/log_sinks.tf +31 -25
- {src → agent_starter_pack}/base_template/deployment/terraform/dev/providers.tf +1 -1
- {src → agent_starter_pack}/base_template/deployment/terraform/dev/variables.tf +1 -1
- {src → agent_starter_pack}/base_template/deployment/terraform/github.tf +14 -0
- {src → agent_starter_pack}/base_template/deployment/terraform/locals.tf +1 -1
- {src → agent_starter_pack}/base_template/deployment/terraform/log_sinks.tf +37 -28
- {src → agent_starter_pack}/base_template/deployment/terraform/providers.tf +1 -1
- {src → agent_starter_pack}/base_template/deployment/terraform/variables.tf +1 -1
- {src → agent_starter_pack}/base_template/deployment/terraform/{% if cookiecutter.cicd_runner == 'google_cloud_build' %}build_triggers.tf{% else %}unused_build_triggers.tf{% endif %} +4 -2
- {src → agent_starter_pack}/base_template/pyproject.toml +22 -21
- {src → agent_starter_pack}/base_template/{% if cookiecutter.cicd_runner == 'github_actions' %}.github{% else %}unused_github{% endif %}/workflows/deploy-to-prod.yaml +5 -5
- {src → agent_starter_pack}/base_template/{% if cookiecutter.cicd_runner == 'github_actions' %}.github{% else %}unused_github{% endif %}/workflows/pr_checks.yaml +3 -3
- {src → agent_starter_pack}/base_template/{% if cookiecutter.cicd_runner == 'github_actions' %}.github{% else %}unused_github{% endif %}/workflows/staging.yaml +74 -11
- {src → agent_starter_pack}/base_template/{% if cookiecutter.cicd_runner == 'google_cloud_build' %}.cloudbuild{% else %}unused_.cloudbuild{% endif %}/deploy-to-prod.yaml +6 -6
- {src → agent_starter_pack}/base_template/{% if cookiecutter.cicd_runner == 'google_cloud_build' %}.cloudbuild{% else %}unused_.cloudbuild{% endif %}/pr_checks.yaml +4 -4
- {src → agent_starter_pack}/base_template/{% if cookiecutter.cicd_runner == 'google_cloud_build' %}.cloudbuild{% else %}unused_.cloudbuild{% endif %}/staging.yaml +95 -13
- {src → agent_starter_pack}/base_template/{{cookiecutter.agent_directory}}/utils/tracing.py +1 -1
- {src → agent_starter_pack}/base_template/{{cookiecutter.agent_directory}}/utils/typing.py +4 -4
- {src → agent_starter_pack}/cli/commands/setup_cicd.py +1 -1
- {src → agent_starter_pack}/cli/main.py +2 -2
- {src → agent_starter_pack}/cli/utils/gcp.py +1 -1
- {src → agent_starter_pack}/cli/utils/remote_template.py +12 -9
- {src → agent_starter_pack}/cli/utils/template.py +19 -15
- agent_starter_pack/deployment_targets/agent_engine/deployment/terraform/{% if not cookiecutter.is_adk_live %}service.tf{% else %}unused_service.tf{% endif %} +82 -0
- agent_starter_pack/deployment_targets/agent_engine/tests/integration/test_agent_engine_app.py +387 -0
- agent_starter_pack/deployment_targets/agent_engine/tests/load_test/README.md +84 -0
- agent_starter_pack/deployment_targets/agent_engine/tests/load_test/load_test.py +255 -0
- {src → agent_starter_pack}/deployment_targets/agent_engine/{{cookiecutter.agent_directory}}/agent_engine_app.py +40 -14
- {src → agent_starter_pack}/deployment_targets/agent_engine/{{cookiecutter.agent_directory}}/utils/deployment.py +13 -4
- agent_starter_pack/deployment_targets/agent_engine/{{cookiecutter.agent_directory}}/utils/{% if cookiecutter.is_adk_live %}expose_app.py{% else %}unused_expose_app.py{% endif %} +520 -0
- {src → agent_starter_pack}/deployment_targets/cloud_run/Dockerfile +3 -3
- {src → agent_starter_pack}/deployment_targets/cloud_run/deployment/terraform/dev/service.tf +4 -4
- {src → agent_starter_pack}/deployment_targets/cloud_run/deployment/terraform/service.tf +7 -7
- {src → agent_starter_pack}/deployment_targets/cloud_run/tests/integration/test_server_e2e.py +207 -5
- {src → agent_starter_pack}/deployment_targets/cloud_run/tests/load_test/README.md +82 -0
- agent_starter_pack/deployment_targets/cloud_run/tests/load_test/load_test.py +249 -0
- {src → agent_starter_pack}/deployment_targets/cloud_run/{{cookiecutter.agent_directory}}/server.py +190 -146
- {src/frontends/live_api_react → agent_starter_pack/frontends/adk_live_react}/frontend/package-lock.json +39 -1007
- {src/frontends/live_api_react → agent_starter_pack/frontends/adk_live_react}/frontend/package.json +1 -9
- {src/frontends/live_api_react → agent_starter_pack/frontends/adk_live_react}/frontend/src/App.tsx +1 -1
- {src/frontends/live_api_react → agent_starter_pack/frontends/adk_live_react}/frontend/src/components/logger/Logger.tsx +8 -3
- {src/frontends/live_api_react → agent_starter_pack/frontends/adk_live_react}/frontend/src/components/logger/logger.scss +26 -0
- {src/frontends/live_api_react → agent_starter_pack/frontends/adk_live_react}/frontend/src/components/side-panel/SidePanel.tsx +11 -5
- {src/frontends/live_api_react → agent_starter_pack/frontends/adk_live_react}/frontend/src/components/side-panel/side-panel.scss +146 -115
- agent_starter_pack/frontends/adk_live_react/frontend/src/components/transcription-preview/TranscriptionPreview.tsx +106 -0
- agent_starter_pack/frontends/adk_live_react/frontend/src/components/transcription-preview/transcription-preview.scss +150 -0
- {src/frontends/live_api_react → agent_starter_pack/frontends/adk_live_react}/frontend/src/hooks/use-live-api.ts +8 -2
- {src/frontends/live_api_react → agent_starter_pack/frontends/adk_live_react}/frontend/src/multimodal-live-types.ts +38 -2
- {src/frontends/live_api_react → agent_starter_pack/frontends/adk_live_react}/frontend/src/utils/audio-recorder.ts +1 -1
- {src/frontends/live_api_react → agent_starter_pack/frontends/adk_live_react}/frontend/src/utils/audio-streamer.ts +1 -1
- {src/frontends/live_api_react → agent_starter_pack/frontends/adk_live_react}/frontend/src/utils/multimodal-live-client.ts +204 -23
- {src/frontends/live_api_react → agent_starter_pack/frontends/adk_live_react}/frontend/src/utils/utils.ts +27 -5
- {src → agent_starter_pack}/frontends/streamlit/frontend/utils/local_chat_history.py +2 -0
- {src → agent_starter_pack}/resources/docs/adk-cheatsheet.md +5 -5
- agent_starter_pack/resources/idx/.idx/dev.nix +64 -0
- agent_starter_pack/resources/idx/idx-template.json +6 -0
- {src → agent_starter_pack}/resources/idx/idx-template.nix +2 -3
- {src → agent_starter_pack}/resources/locks/uv-adk_base-agent_engine.lock +1079 -954
- {src → agent_starter_pack}/resources/locks/uv-adk_base-cloud_run.lock +1441 -1309
- agent_starter_pack/resources/locks/uv-adk_live-agent_engine.lock +4229 -0
- agent_starter_pack/resources/locks/uv-adk_live-cloud_run.lock +4822 -0
- {src → agent_starter_pack}/resources/locks/uv-agentic_rag-agent_engine.lock +1107 -997
- {src → agent_starter_pack}/resources/locks/uv-agentic_rag-cloud_run.lock +1485 -1368
- {src → agent_starter_pack}/resources/locks/uv-crewai_coding_crew-agent_engine.lock +1294 -1297
- {src → agent_starter_pack}/resources/locks/uv-crewai_coding_crew-cloud_run.lock +2028 -1807
- {src → agent_starter_pack}/resources/locks/uv-langgraph_base_react-agent_engine.lock +1176 -1197
- {src → agent_starter_pack}/resources/locks/uv-langgraph_base_react-cloud_run.lock +1947 -1679
- {src → agent_starter_pack}/utils/generate_locks.py +12 -7
- {src → agent_starter_pack}/utils/lock_utils.py +2 -2
- {src → agent_starter_pack}/utils/watch_and_rebuild.py +1 -1
- {agent_starter_pack-0.15.7.dist-info → agent_starter_pack-0.17.0.dist-info}/METADATA +17 -18
- agent_starter_pack-0.17.0.dist-info/RECORD +179 -0
- agent_starter_pack-0.17.0.dist-info/entry_points.txt +2 -0
- llm.txt +1 -1
- agent_starter_pack-0.15.7.dist-info/RECORD +0 -176
- agent_starter_pack-0.15.7.dist-info/entry_points.txt +0 -2
- agents/crewai_coding_crew/app/agent.py +0 -86
- agents/langgraph_base_react/app/agent.py +0 -73
- agents/live_api/README.md +0 -37
- agents/live_api/app/agent.py +0 -72
- agents/live_api/tests/integration/test_server_e2e.py +0 -260
- agents/live_api/tests/load_test/load_test.py +0 -40
- agents/live_api/tests/unit/test_server.py +0 -144
- src/deployment_targets/agent_engine/tests/integration/test_agent_engine_app.py +0 -186
- src/deployment_targets/agent_engine/tests/load_test/README.md +0 -37
- src/deployment_targets/agent_engine/tests/load_test/load_test.py +0 -126
- src/deployment_targets/cloud_run/tests/load_test/load_test.py +0 -122
- src/resources/idx/.idx/dev.nix +0 -50
- src/resources/idx/idx-template.json +0 -21
- src/resources/locks/uv-live_api-cloud_run.lock +0 -6118
- {agents → agent_starter_pack/agents}/README.md +0 -0
- {agents → agent_starter_pack/agents}/adk_base/README.md +0 -0
- {agents → agent_starter_pack/agents}/adk_base/app/__init__.py +0 -0
- {agents → agent_starter_pack/agents}/adk_base/app/agent.py +0 -0
- {agents → agent_starter_pack/agents}/adk_base/notebooks/adk_app_testing.ipynb +0 -0
- {agents → agent_starter_pack/agents}/adk_base/notebooks/evaluating_adk_agent.ipynb +0 -0
- {agents → agent_starter_pack/agents}/adk_base/tests/integration/test_agent.py +0 -0
- {agents → agent_starter_pack/agents}/agentic_rag/README.md +0 -0
- {agents → agent_starter_pack/agents}/agentic_rag/app/__init__.py +0 -0
- {agents → agent_starter_pack/agents}/agentic_rag/app/agent.py +0 -0
- {agents → agent_starter_pack/agents}/agentic_rag/app/retrievers.py +0 -0
- {agents → agent_starter_pack/agents}/agentic_rag/app/templates.py +0 -0
- {agents → agent_starter_pack/agents}/agentic_rag/notebooks/adk_app_testing.ipynb +0 -0
- {agents → agent_starter_pack/agents}/agentic_rag/notebooks/evaluating_adk_agent.ipynb +0 -0
- {agents → agent_starter_pack/agents}/agentic_rag/tests/integration/test_agent.py +0 -0
- {agents → agent_starter_pack/agents}/crewai_coding_crew/.template/templateconfig.yaml +0 -0
- {agents → agent_starter_pack/agents}/crewai_coding_crew/README.md +0 -0
- {agents → agent_starter_pack/agents}/crewai_coding_crew/app/crew/config/agents.yaml +0 -0
- {agents → agent_starter_pack/agents}/crewai_coding_crew/app/crew/config/tasks.yaml +0 -0
- {agents → agent_starter_pack/agents}/crewai_coding_crew/app/crew/crew.py +0 -0
- {agents → agent_starter_pack/agents}/crewai_coding_crew/notebooks/evaluating_crewai_agent.ipynb +0 -0
- {agents → agent_starter_pack/agents}/crewai_coding_crew/notebooks/evaluating_langgraph_agent.ipynb +0 -0
- {agents → agent_starter_pack/agents}/crewai_coding_crew/tests/integration/test_agent.py +0 -0
- {agents → agent_starter_pack/agents}/langgraph_base_react/.template/templateconfig.yaml +0 -0
- {agents → agent_starter_pack/agents}/langgraph_base_react/README.md +0 -0
- {agents → agent_starter_pack/agents}/langgraph_base_react/notebooks/evaluating_langgraph_agent.ipynb +0 -0
- {agents → agent_starter_pack/agents}/langgraph_base_react/tests/integration/test_agent.py +0 -0
- {src → agent_starter_pack}/base_template/.gitignore +0 -0
- {src → agent_starter_pack}/base_template/deployment/README.md +0 -0
- {src → agent_starter_pack}/base_template/deployment/terraform/apis.tf +0 -0
- {src → agent_starter_pack}/base_template/deployment/terraform/dev/iam.tf +0 -0
- {src → agent_starter_pack}/base_template/deployment/terraform/dev/storage.tf +0 -0
- {src → agent_starter_pack}/base_template/deployment/terraform/dev/vars/env.tfvars +0 -0
- {src → agent_starter_pack}/base_template/deployment/terraform/iam.tf +0 -0
- {src → agent_starter_pack}/base_template/deployment/terraform/service_accounts.tf +0 -0
- {src → agent_starter_pack}/base_template/deployment/terraform/storage.tf +0 -0
- {src → agent_starter_pack}/base_template/deployment/terraform/vars/env.tfvars +0 -0
- {src → agent_starter_pack}/base_template/deployment/terraform/{% if cookiecutter.cicd_runner == 'github_actions' %}wif.tf{% else %}unused_wif.tf{% endif %} +0 -0
- {src → agent_starter_pack}/base_template/tests/unit/test_dummy.py +0 -0
- {src → agent_starter_pack}/base_template/{{cookiecutter.agent_directory}}/utils/gcs.py +0 -0
- {src → agent_starter_pack}/cli/commands/create.py +0 -0
- {src → agent_starter_pack}/cli/commands/enhance.py +0 -0
- {src → agent_starter_pack}/cli/commands/list.py +0 -0
- {src → agent_starter_pack}/cli/utils/__init__.py +0 -0
- {src → agent_starter_pack}/cli/utils/cicd.py +0 -0
- {src → agent_starter_pack}/cli/utils/datastores.py +0 -0
- {src → agent_starter_pack}/cli/utils/logging.py +0 -0
- {src → agent_starter_pack}/cli/utils/version.py +0 -0
- {src → agent_starter_pack}/data_ingestion/README.md +0 -0
- {src → agent_starter_pack}/data_ingestion/data_ingestion_pipeline/components/ingest_data.py +0 -0
- {src → agent_starter_pack}/data_ingestion/data_ingestion_pipeline/components/process_data.py +0 -0
- {src → agent_starter_pack}/data_ingestion/data_ingestion_pipeline/pipeline.py +0 -0
- {src → agent_starter_pack}/data_ingestion/data_ingestion_pipeline/submit_pipeline.py +0 -0
- {src → agent_starter_pack}/data_ingestion/pyproject.toml +0 -0
- {src → agent_starter_pack}/data_ingestion/uv.lock +0 -0
- {src → agent_starter_pack}/deployment_targets/agent_engine/deployment_metadata.json +0 -0
- {src → agent_starter_pack}/deployment_targets/agent_engine/notebooks/intro_agent_engine.ipynb +0 -0
- {src → agent_starter_pack}/deployment_targets/agent_engine/tests/load_test/.results/.placeholder +0 -0
- {src → agent_starter_pack}/deployment_targets/cloud_run/tests/load_test/.results/.placeholder +0 -0
- {src/frontends/live_api_react → agent_starter_pack/frontends/adk_live_react}/frontend/public/favicon.ico +0 -0
- {src/frontends/live_api_react → agent_starter_pack/frontends/adk_live_react}/frontend/public/index.html +0 -0
- {src/frontends/live_api_react → agent_starter_pack/frontends/adk_live_react}/frontend/public/robots.txt +0 -0
- {src/frontends/live_api_react → agent_starter_pack/frontends/adk_live_react}/frontend/src/App.scss +0 -0
- {src/frontends/live_api_react → agent_starter_pack/frontends/adk_live_react}/frontend/src/App.test.tsx +0 -0
- {src/frontends/live_api_react → agent_starter_pack/frontends/adk_live_react}/frontend/src/components/audio-pulse/AudioPulse.tsx +0 -0
- {src/frontends/live_api_react → agent_starter_pack/frontends/adk_live_react}/frontend/src/components/audio-pulse/audio-pulse.scss +0 -0
- {src/frontends/live_api_react → agent_starter_pack/frontends/adk_live_react}/frontend/src/components/logger/mock-logs.ts +0 -0
- {src/frontends/live_api_react → agent_starter_pack/frontends/adk_live_react}/frontend/src/contexts/LiveAPIContext.tsx +0 -0
- {src/frontends/live_api_react → agent_starter_pack/frontends/adk_live_react}/frontend/src/hooks/use-media-stream-mux.ts +0 -0
- {src/frontends/live_api_react → agent_starter_pack/frontends/adk_live_react}/frontend/src/hooks/use-screen-capture.ts +0 -0
- {src/frontends/live_api_react → agent_starter_pack/frontends/adk_live_react}/frontend/src/hooks/use-webcam.ts +0 -0
- {src/frontends/live_api_react → agent_starter_pack/frontends/adk_live_react}/frontend/src/index.css +0 -0
- {src/frontends/live_api_react → agent_starter_pack/frontends/adk_live_react}/frontend/src/index.tsx +0 -0
- {src/frontends/live_api_react → agent_starter_pack/frontends/adk_live_react}/frontend/src/react-app-env.d.ts +0 -0
- {src/frontends/live_api_react → agent_starter_pack/frontends/adk_live_react}/frontend/src/reportWebVitals.ts +0 -0
- {src/frontends/live_api_react → agent_starter_pack/frontends/adk_live_react}/frontend/src/setupTests.ts +0 -0
- {src/frontends/live_api_react → agent_starter_pack/frontends/adk_live_react}/frontend/src/utils/audioworklet-registry.ts +0 -0
- {src/frontends/live_api_react → agent_starter_pack/frontends/adk_live_react}/frontend/src/utils/store-logger.ts +0 -0
- {src/frontends/live_api_react → agent_starter_pack/frontends/adk_live_react}/frontend/src/utils/worklets/audio-processing.ts +0 -0
- {src/frontends/live_api_react → agent_starter_pack/frontends/adk_live_react}/frontend/src/utils/worklets/vol-meter.ts +0 -0
- {src/frontends/live_api_react → agent_starter_pack/frontends/adk_live_react}/frontend/tsconfig.json +0 -0
- {src → agent_starter_pack}/frontends/streamlit/frontend/side_bar.py +0 -0
- {src → agent_starter_pack}/frontends/streamlit/frontend/streamlit_app.py +0 -0
- {src → agent_starter_pack}/frontends/streamlit/frontend/style/app_markdown.py +0 -0
- {src → agent_starter_pack}/frontends/streamlit/frontend/utils/chat_utils.py +0 -0
- {src → agent_starter_pack}/frontends/streamlit/frontend/utils/message_editing.py +0 -0
- {src → agent_starter_pack}/frontends/streamlit/frontend/utils/multimodal_utils.py +0 -0
- {src → agent_starter_pack}/frontends/streamlit/frontend/utils/stream_handler.py +0 -0
- {src → agent_starter_pack}/frontends/streamlit/frontend/utils/title_summary.py +0 -0
- {src → agent_starter_pack}/resources/containers/data_processing/Dockerfile +0 -0
- {src → agent_starter_pack}/resources/containers/e2e-tests/Dockerfile +0 -0
- {agent_starter_pack-0.15.7.dist-info → agent_starter_pack-0.17.0.dist-info}/WHEEL +0 -0
- {agent_starter_pack-0.15.7.dist-info → agent_starter_pack-0.17.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -18,7 +18,7 @@ settings:
|
|
|
18
18
|
requires_data_ingestion: false
|
|
19
19
|
requires_session: true
|
|
20
20
|
deployment_targets: ["agent_engine", "cloud_run"]
|
|
21
|
-
extra_dependencies: ["google-adk
|
|
21
|
+
extra_dependencies: ["google-adk>=1.15.0,<2.0.0"]
|
|
22
22
|
tags: ["adk"]
|
|
23
23
|
frontend_type: "None"
|
|
24
24
|
|
|
@@ -12,13 +12,11 @@
|
|
|
12
12
|
# See the License for the specific language governing permissions and
|
|
13
13
|
# limitations under the License.
|
|
14
14
|
|
|
15
|
-
description: "
|
|
15
|
+
description: "Real-time multimodal agent with ADK and Gemini Live API for low-latency voice and video interaction."
|
|
16
16
|
settings:
|
|
17
17
|
requires_data_ingestion: false
|
|
18
|
-
frontend_type: "
|
|
19
|
-
deployment_targets: ["cloud_run"]
|
|
20
|
-
extra_dependencies: [
|
|
21
|
-
|
|
22
|
-
"google-genai>=1.16.0",
|
|
23
|
-
]
|
|
18
|
+
frontend_type: "adk_live_react"
|
|
19
|
+
deployment_targets: ["agent_engine", "cloud_run"]
|
|
20
|
+
extra_dependencies: ["google-adk>=1.16.0,<2.0.0", "click>=8.0.0,<9.0.0", "uvicorn>=0.18.0,<1.0.0", "fastapi>=0.75.0,<1.0.0", "backoff>=2.0.0,<3.0.0"]
|
|
21
|
+
tags: ["adk", "adk_live"]
|
|
24
22
|
example_question: "What's the weather in San Francisco?"
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# ADK Live Agent
|
|
2
|
+
|
|
3
|
+
Real-time conversational agent built with Google ADK and Gemini's live audio model. Supports audio, video, and text interactions with native tool calling.
|
|
4
|
+
|
|
5
|
+

|
|
6
|
+
|
|
7
|
+
**Key components:**
|
|
8
|
+
|
|
9
|
+
- **Python Backend** (in `app/` folder): ADK-powered agent using Gemini's live audio model with native tool calling and deployment support for Cloud Run and Agent Engine
|
|
10
|
+
|
|
11
|
+
- **React Frontend** (in `frontend/` folder): Web console for interacting with the live agent via audio, video, and text
|
|
12
|
+
|
|
13
|
+

|
|
14
|
+
|
|
15
|
+
Once running, click the play button to connect and interact with the agent. Try asking "What's the weather like in San Francisco?" to see tool calling in action.
|
|
16
|
+
|
|
17
|
+
## Additional Resources for Multimodal Live API
|
|
18
|
+
|
|
19
|
+
Explore these resources to learn more about the Multimodal Live API and see examples of its usage:
|
|
20
|
+
|
|
21
|
+
- [Project Pastra](https://github.com/heiko-hotz/gemini-multimodal-live-dev-guide/tree/main): a comprehensive developer guide for the Gemini Multimodal Live API.
|
|
22
|
+
- [ADK Samples: Realtime Conversational Agent](https://github.com/google/adk-samples/tree/main/python/agents/realtime-conversational-agent): Full-stack, reusable template using Agent Development Kit (ADK) with the Gemini Live API.
|
|
23
|
+
- [Google Cloud Multimodal Live API demos and samples](https://github.com/GoogleCloudPlatform/generative-ai/tree/main/gemini/multimodal-live-api): Collection of code samples and demo applications leveraging multimodal live API in Vertex AI
|
|
24
|
+
- [Gemini 2 Cookbook](https://github.com/google-gemini/cookbook/tree/main/gemini-2): Practical examples and tutorials for working with Gemini 2
|
|
25
|
+
- [Multimodal Live API Web Console](https://github.com/google-gemini/multimodal-live-api-web-console): Interactive React-based web interface for testing and experimenting with Gemini Multimodal Live API.
|
|
26
|
+
|
|
27
|
+
## Current Status & Future Work
|
|
28
|
+
|
|
29
|
+
This pattern is under active development. Key areas planned for future enhancement include:
|
|
30
|
+
|
|
31
|
+
* **Observability:** Implementing comprehensive monitoring and tracing features.
|
|
32
|
+
* **Load Testing:** Integrating load testing capabilities.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Copyright 2025 Google LLC
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
import os
|
|
16
|
+
|
|
17
|
+
import google.auth
|
|
18
|
+
import vertexai
|
|
19
|
+
from google.adk.agents import Agent
|
|
20
|
+
|
|
21
|
+
_, project_id = google.auth.default()
|
|
22
|
+
os.environ.setdefault("GOOGLE_CLOUD_PROJECT", project_id)
|
|
23
|
+
os.environ.setdefault("GOOGLE_CLOUD_LOCATION", "us-central1")
|
|
24
|
+
os.environ.setdefault("GOOGLE_GENAI_USE_VERTEXAI", "True")
|
|
25
|
+
|
|
26
|
+
vertexai.init(project=project_id, location="us-central1")
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def get_weather(query: str) -> str:
|
|
30
|
+
"""Simulates a web search. Use it get information on weather.
|
|
31
|
+
|
|
32
|
+
Args:
|
|
33
|
+
query: A string containing the location to get weather information for.
|
|
34
|
+
|
|
35
|
+
Returns:
|
|
36
|
+
A string with the simulated weather information for the queried location.
|
|
37
|
+
"""
|
|
38
|
+
if "sf" in query.lower() or "san francisco" in query.lower():
|
|
39
|
+
return "It's 60 degrees and foggy."
|
|
40
|
+
return "It's 90 degrees and sunny."
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
root_agent = Agent(
|
|
44
|
+
name="root_agent",
|
|
45
|
+
model="gemini-live-2.5-flash-preview-native-audio-09-2025",
|
|
46
|
+
instruction="You are a helpful AI assistant designed to provide accurate and useful information.",
|
|
47
|
+
tools=[get_weather],
|
|
48
|
+
)
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Copyright 2025 Google LLC
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
"""
|
|
15
|
+
You can add your unit tests here.
|
|
16
|
+
This is where you test your business logic, including agent functionality,
|
|
17
|
+
data processing, and other core components of your application.
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
from app.agent import get_weather
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def test_get_weather_san_francisco() -> None:
|
|
24
|
+
"""Test get_weather function returns correct weather for San Francisco."""
|
|
25
|
+
result = get_weather("What's the weather in San Francisco?")
|
|
26
|
+
assert result == "It's 60 degrees and foggy."
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def test_get_weather_san_francisco_abbreviation() -> None:
|
|
30
|
+
"""Test get_weather function returns correct weather for SF abbreviation."""
|
|
31
|
+
result = get_weather("weather in sf")
|
|
32
|
+
assert result == "It's 60 degrees and foggy."
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def test_get_weather_other_location() -> None:
|
|
36
|
+
"""Test get_weather function returns default weather for other locations."""
|
|
37
|
+
result = get_weather("What's the weather in New York?")
|
|
38
|
+
assert result == "It's 90 degrees and sunny."
|
|
@@ -19,7 +19,7 @@ settings:
|
|
|
19
19
|
requires_session: true
|
|
20
20
|
deployment_targets: ["agent_engine", "cloud_run"]
|
|
21
21
|
extra_dependencies: [
|
|
22
|
-
"google-adk
|
|
22
|
+
"google-adk>=1.15.0,<2.0.0",
|
|
23
23
|
"langchain-google-vertexai~=2.0.7",
|
|
24
24
|
"langchain~=0.3.24",
|
|
25
25
|
"langchain-core~=0.3.55",
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Copyright 2025 Google LLC
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
# mypy: disable-error-code="union-attr"
|
|
16
|
+
from langchain_google_vertexai import ChatVertexAI
|
|
17
|
+
from langgraph.prebuilt import create_react_agent
|
|
18
|
+
|
|
19
|
+
from .crew.crew import DevCrew
|
|
20
|
+
|
|
21
|
+
LOCATION = "global"
|
|
22
|
+
LLM = "gemini-2.5-flash"
|
|
23
|
+
|
|
24
|
+
llm = ChatVertexAI(model=LLM, location=LOCATION, temperature=0)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def coding_tool(code_instructions: str) -> str:
|
|
28
|
+
"""Use this tool to write a python program given a set of requirements and or instructions."""
|
|
29
|
+
inputs = {"code_instructions": code_instructions}
|
|
30
|
+
return DevCrew().crew().kickoff(inputs=inputs)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
system_message = (
|
|
34
|
+
"You are an expert Lead Software Engineer Manager.\n"
|
|
35
|
+
"Your role is to speak to a user and understand what kind of code they need to "
|
|
36
|
+
"build.\n"
|
|
37
|
+
"Part of your task is therefore to gather requirements and clarifying ambiguity "
|
|
38
|
+
"by asking followup questions. Don't ask all the questions together as the user "
|
|
39
|
+
"has a low attention span, rather ask a question at the time.\n"
|
|
40
|
+
"Once the problem to solve is clear, you will call your tool for writing the "
|
|
41
|
+
"solution.\n"
|
|
42
|
+
"Remember, you are an expert in understanding requirements but you cannot code, "
|
|
43
|
+
"use your coding tool to generate a solution. Keep the test cases if any, they "
|
|
44
|
+
"are useful for the user."
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
agent = create_react_agent(model=llm, tools=[coding_tool], prompt=system_message)
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Copyright 2025 Google LLC
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
# mypy: disable-error-code="union-attr"
|
|
16
|
+
from langchain_google_vertexai import ChatVertexAI
|
|
17
|
+
from langgraph.prebuilt import create_react_agent
|
|
18
|
+
|
|
19
|
+
LOCATION = "global"
|
|
20
|
+
LLM = "gemini-2.5-flash"
|
|
21
|
+
|
|
22
|
+
llm = ChatVertexAI(model=LLM, location=LOCATION, temperature=0)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def get_weather(query: str) -> str:
|
|
26
|
+
"""Simulates a web search. Use it get information on weather"""
|
|
27
|
+
if "sf" in query.lower() or "san francisco" in query.lower():
|
|
28
|
+
return "It's 60 degrees and foggy."
|
|
29
|
+
return "It's 90 degrees and sunny."
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
agent = create_react_agent(
|
|
33
|
+
model=llm, tools=[get_weather], prompt="You are a helpful assistant"
|
|
34
|
+
)
|
|
@@ -1,99 +1,128 @@
|
|
|
1
|
+
# ==============================================================================
|
|
2
|
+
# Installation & Setup
|
|
3
|
+
# ==============================================================================
|
|
4
|
+
|
|
1
5
|
# Install dependencies using uv package manager
|
|
2
6
|
install:
|
|
3
|
-
@command -v uv >/dev/null 2>&1 || { echo "uv is not installed. Installing uv..."; curl -LsSf https://astral.sh/uv/0.
|
|
4
|
-
{%- if cookiecutter.settings.get("commands", {}).get("override", {}).get("install") %}
|
|
7
|
+
@command -v uv >/dev/null 2>&1 || { echo "uv is not installed. Installing uv..."; curl -LsSf https://astral.sh/uv/0.8.13/install.sh | sh; source $HOME/.local/bin/env; }
|
|
8
|
+
{%- if cookiecutter.settings.get("commands", {}).get("override", {}).get("install") %}
|
|
5
9
|
{{cookiecutter.settings.get("commands", {}).get("override", {}).get("install")}}
|
|
6
10
|
{%- else %}
|
|
7
|
-
uv sync --dev{% if cookiecutter.
|
|
8
|
-
{%- endif %}
|
|
9
|
-
|
|
10
|
-
{%- if cookiecutter.settings.get("commands", {}).get("extra", {}) %}
|
|
11
|
-
{%- for cmd_name, cmd_value in cookiecutter.settings.get("commands", {}).get("extra", {}).items() %}
|
|
12
|
-
|
|
13
|
-
# {{ cmd_value.get("description") }}
|
|
14
|
-
{{ cmd_name }}:
|
|
15
|
-
{%- if cmd_value is mapping %}
|
|
16
|
-
{%- if cmd_value.command is mapping and cookiecutter.deployment_target in cmd_value.command %}
|
|
17
|
-
{{ cmd_value.command[cookiecutter.deployment_target] }}
|
|
18
|
-
{%- else %}
|
|
19
|
-
{{ cmd_value.command if cmd_value.command is string else "" }}
|
|
20
|
-
{%- endif %}
|
|
21
|
-
{%- else %}
|
|
22
|
-
{{ cmd_value }}
|
|
11
|
+
uv sync --dev{% if not cookiecutter.is_adk and not cookiecutter.is_adk_live %} --extra streamlit{%- endif %}{% if cookiecutter.is_adk_live %} && (cd frontend && npm install){%- endif %}
|
|
23
12
|
{%- endif %}
|
|
24
|
-
{%- endfor %}{%- endif %}
|
|
25
13
|
|
|
26
|
-
|
|
27
|
-
#
|
|
28
|
-
|
|
29
|
-
(cd frontend && npm run build)
|
|
14
|
+
# ==============================================================================
|
|
15
|
+
# Playground Targets
|
|
16
|
+
# ==============================================================================
|
|
30
17
|
|
|
31
|
-
{%- endif %}
|
|
32
18
|
# Launch local dev playground
|
|
33
|
-
playground:{%- if cookiecutter.
|
|
19
|
+
playground:{%- if cookiecutter.is_adk_live %} build-frontend-if-needed{%- endif %}
|
|
34
20
|
{%- if cookiecutter.settings.get("commands", {}).get("override", {}).get("playground") %}
|
|
21
|
+
{%- if cookiecutter.settings.get("commands", {}).get("override", {}).get("playground") is mapping %}
|
|
22
|
+
{{cookiecutter.settings.get("commands", {}).get("override", {}).get("playground").get(cookiecutter.deployment_target, "")}}
|
|
23
|
+
{%- else %}
|
|
35
24
|
{{cookiecutter.settings.get("commands", {}).get("override", {}).get("playground")}}
|
|
25
|
+
{%- endif %}
|
|
36
26
|
{%- else %}
|
|
37
27
|
@echo "==============================================================================="
|
|
38
28
|
@echo "| 🚀 Starting your agent playground... |"
|
|
39
29
|
@echo "| |"
|
|
40
|
-
{%- if cookiecutter.
|
|
30
|
+
{%- if cookiecutter.is_adk_live %}
|
|
41
31
|
@echo "| 🌐 Access your app at: http://localhost:8000 |"
|
|
42
32
|
{%- endif %}
|
|
43
33
|
@echo "| 💡 Try asking: {{cookiecutter.example_question}}|"
|
|
44
|
-
{%- if
|
|
34
|
+
{%- if cookiecutter.is_adk %}
|
|
45
35
|
@echo "| |"
|
|
46
36
|
@echo "| 🔍 IMPORTANT: Select the '{{cookiecutter.agent_directory}}' folder to interact with your agent. |"
|
|
47
37
|
{%- endif %}
|
|
48
38
|
@echo "==============================================================================="
|
|
49
|
-
{%- if
|
|
39
|
+
{%- if cookiecutter.is_adk_live %}
|
|
40
|
+
{%- if cookiecutter.deployment_target == 'agent_engine' %}
|
|
41
|
+
uv run python -m {{cookiecutter.agent_directory}}.utils.expose_app --mode local --local-agent {{cookiecutter.agent_directory}}.agent.root_agent
|
|
42
|
+
{%- else %}
|
|
43
|
+
uv run uvicorn {{cookiecutter.agent_directory}}.server:app --host localhost --port 8000 --reload
|
|
44
|
+
{%- endif %}
|
|
45
|
+
{%- elif cookiecutter.is_adk %}
|
|
50
46
|
uv run adk web . --port 8501 --reload_agents
|
|
51
47
|
{%- else %}
|
|
52
48
|
{%- if cookiecutter.deployment_target == 'cloud_run' %}
|
|
53
|
-
|
|
54
|
-
uv run uvicorn {{cookiecutter.agent_directory}}.server:app --host 0.0.0.0 --port 8000 --reload
|
|
55
|
-
{%- else %}
|
|
56
|
-
uv run uvicorn {{cookiecutter.agent_directory}}.server:app --host 0.0.0.0 --port 8000 --reload &
|
|
57
|
-
{%- endif %}
|
|
49
|
+
uv run uvicorn {{cookiecutter.agent_directory}}.server:app --host localhost --port 8000 --reload &
|
|
58
50
|
{%- endif %}
|
|
59
|
-
{%- if cookiecutter.agent_name != 'live_api' %}
|
|
60
51
|
{% if cookiecutter.deployment_target == 'agent_engine' %}PYTHONPATH=. {% endif %}uv run streamlit run frontend/streamlit_app.py --browser.serverAddress=localhost --server.enableCORS=false --server.enableXsrfProtection=false
|
|
61
52
|
{%- endif %}
|
|
62
53
|
{%- endif %}
|
|
54
|
+
{%- if cookiecutter.settings.get("commands", {}).get("extra", {}) %}
|
|
55
|
+
|
|
56
|
+
# ==============================================================================
|
|
57
|
+
# Agent-Specific Commands
|
|
58
|
+
# ==============================================================================
|
|
59
|
+
{%- for cmd_name, cmd_value in cookiecutter.settings.get("commands", {}).get("extra", {}).items() %}
|
|
60
|
+
{%- if cmd_value is mapping %}
|
|
61
|
+
{%- if cmd_value.command is mapping %}
|
|
62
|
+
{%- if cookiecutter.deployment_target in cmd_value.command %}
|
|
63
|
+
|
|
64
|
+
# {{ cmd_value.get("description") }}
|
|
65
|
+
{{ cmd_name }}:
|
|
66
|
+
{{ cmd_value.command[cookiecutter.deployment_target] }}
|
|
63
67
|
{%- endif %}
|
|
68
|
+
{%- else %}
|
|
64
69
|
|
|
65
|
-
#
|
|
66
|
-
{
|
|
67
|
-
|
|
70
|
+
# {{ cmd_value.get("description") }}
|
|
71
|
+
{{ cmd_name }}:
|
|
72
|
+
{{ cmd_value.command if cmd_value.command is string else "" }}
|
|
68
73
|
{%- endif %}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
--memory "4Gi" \
|
|
75
|
-
--project $$PROJECT_ID \
|
|
76
|
-
--region "us-central1" \
|
|
77
|
-
--no-allow-unauthenticated \
|
|
78
|
-
--no-cpu-throttling \
|
|
79
|
-
--labels "{% if "adk" in cookiecutter.tags %}created-by=adk{% if cookiecutter.agent_garden %},{% endif %}{% endif %}{% if cookiecutter.agent_garden %}deployed-with=agent-garden{% if cookiecutter.agent_sample_id %},vertex-agent-sample-id={{cookiecutter.agent_sample_id}},vertex-agent-sample-publisher={{cookiecutter.agent_sample_publisher}}{% endif %}{% endif %}" \
|
|
80
|
-
--set-env-vars \
|
|
81
|
-
"COMMIT_SHA=$(shell git rev-parse HEAD){%- if cookiecutter.data_ingestion %}{%- if cookiecutter.datastore_type == "vertex_ai_search" %},DATA_STORE_ID={{cookiecutter.project_name}}-datastore,DATA_STORE_REGION=us{%- elif cookiecutter.datastore_type == "vertex_ai_vector_search" %},VECTOR_SEARCH_INDEX={{cookiecutter.project_name}}-vector-search,VECTOR_SEARCH_INDEX_ENDPOINT={{cookiecutter.project_name}}-vector-search-endpoint,VECTOR_SEARCH_BUCKET=$$PROJECT_ID-{{cookiecutter.project_name}}-vs{%- endif %}{%- endif %}" \
|
|
82
|
-
$(if $(IAP),--iap) \
|
|
83
|
-
$(if $(PORT),--port=$(PORT))
|
|
84
|
-
{%- elif cookiecutter.deployment_target == 'agent_engine' %}
|
|
85
|
-
# Export dependencies to requirements file using uv export.
|
|
86
|
-
uv export --no-hashes --no-header --no-dev --no-emit-project --no-annotate > .requirements.txt 2>/dev/null || \
|
|
87
|
-
uv export --no-hashes --no-header --no-dev --no-emit-project > .requirements.txt && uv run {{cookiecutter.agent_directory}}/agent_engine_app.py
|
|
74
|
+
{%- else %}
|
|
75
|
+
|
|
76
|
+
# {{ cmd_value.get("description", "") }}
|
|
77
|
+
{{ cmd_name }}:
|
|
78
|
+
{{ cmd_value }}
|
|
88
79
|
{%- endif %}
|
|
80
|
+
{%- endfor %}
|
|
81
|
+
{%- endif %}
|
|
82
|
+
{%- if cookiecutter.is_adk_live %}
|
|
83
|
+
|
|
84
|
+
# ==============================================================================
|
|
85
|
+
# ADK Live Commands
|
|
86
|
+
# ==============================================================================
|
|
87
|
+
|
|
88
|
+
# Build the frontend for production
|
|
89
|
+
build-frontend:
|
|
90
|
+
(cd frontend && npm run build)
|
|
91
|
+
|
|
92
|
+
# Build the frontend only if needed (conditional build)
|
|
93
|
+
build-frontend-if-needed:
|
|
94
|
+
@if [ ! -d "frontend/build" ] || [ ! -f "frontend/build/index.html" ]; then \
|
|
95
|
+
echo "Frontend build directory not found or incomplete. Building..."; \
|
|
96
|
+
$(MAKE) build-frontend; \
|
|
97
|
+
elif [ "frontend/package.json" -nt "frontend/build/index.html" ] || \
|
|
98
|
+
find frontend/src -newer frontend/build/index.html 2>/dev/null | head -1 | grep -q .; then \
|
|
99
|
+
echo "Frontend source files are newer than build. Rebuilding..."; \
|
|
100
|
+
$(MAKE) build-frontend; \
|
|
101
|
+
else \
|
|
102
|
+
echo "Frontend build is up to date. Skipping build..."; \
|
|
103
|
+
fi
|
|
89
104
|
{%- if cookiecutter.deployment_target == 'cloud_run' %}
|
|
90
105
|
|
|
91
106
|
# Launch local development server with hot-reload
|
|
92
107
|
local-backend:
|
|
93
|
-
uv run uvicorn {{cookiecutter.agent_directory}}.server:app --host
|
|
108
|
+
uv run uvicorn {{cookiecutter.agent_directory}}.server:app --host localhost --port 8000 --reload
|
|
109
|
+
{%- endif %}
|
|
110
|
+
{%- if cookiecutter.deployment_target == 'agent_engine' %}
|
|
111
|
+
|
|
112
|
+
# Launch local development server with hot-reload
|
|
113
|
+
local-backend:
|
|
114
|
+
uv run python -m {{cookiecutter.agent_directory}}.utils.expose_app --mode local --port 8000 --local-agent {{cookiecutter.agent_directory}}.agent.root_agent
|
|
115
|
+
|
|
116
|
+
# Connect to remote deployed agent
|
|
117
|
+
playground-remote: build-frontend-if-needed
|
|
118
|
+
@echo "==============================================================================="
|
|
119
|
+
@echo "| 🚀 Connecting to REMOTE agent... |"
|
|
120
|
+
@echo "| |"
|
|
121
|
+
@echo "| 🌐 Access your app at: http://localhost:8000 |"
|
|
122
|
+
@echo "| ☁️ Connected to deployed agent engine |"
|
|
123
|
+
@echo "==============================================================================="
|
|
124
|
+
uv run python -m {{cookiecutter.agent_directory}}.utils.expose_app --mode remote
|
|
94
125
|
{%- endif %}
|
|
95
|
-
{%- if cookiecutter.deployment_target == 'cloud_run' %}
|
|
96
|
-
{%- if cookiecutter.agent_name == 'live_api' %}
|
|
97
126
|
|
|
98
127
|
# Start the frontend UI separately for development (requires backend running separately)
|
|
99
128
|
ui:
|
|
@@ -106,7 +135,7 @@ playground-dev:
|
|
|
106
135
|
@echo "| |"
|
|
107
136
|
@echo "| 🌐 Frontend: http://localhost:8501 |"
|
|
108
137
|
@echo "| 🌐 Backend: http://localhost:8000 |"
|
|
109
|
-
@echo "| 💡 Try asking:
|
|
138
|
+
@echo "| 💡 Try asking: {{cookiecutter.example_question}}|"
|
|
110
139
|
@echo "| 🔄 Both frontend and backend will auto-reload on changes |"
|
|
111
140
|
@echo "==============================================================================="
|
|
112
141
|
@echo "Starting backend server..."
|
|
@@ -114,15 +143,51 @@ playground-dev:
|
|
|
114
143
|
@echo "Starting frontend dev server..."
|
|
115
144
|
$(MAKE) ui
|
|
116
145
|
{%- endif %}
|
|
146
|
+
|
|
147
|
+
# ==============================================================================
|
|
148
|
+
# Backend Deployment Targets
|
|
149
|
+
# ==============================================================================
|
|
150
|
+
|
|
151
|
+
# Deploy the agent remotely
|
|
152
|
+
{%- if cookiecutter.deployment_target == 'cloud_run' %}
|
|
153
|
+
# Usage: make backend [IAP=true] [PORT=8080] - Set IAP=true to enable Identity-Aware Proxy, PORT to specify container port
|
|
154
|
+
{%- endif %}
|
|
155
|
+
backend:
|
|
156
|
+
{%- if cookiecutter.deployment_target == 'cloud_run' %}
|
|
157
|
+
PROJECT_ID=$$(gcloud config get-value project) && \
|
|
158
|
+
gcloud beta run deploy {{cookiecutter.project_name}} \
|
|
159
|
+
--source . \
|
|
160
|
+
--memory "4Gi" \
|
|
161
|
+
--project $$PROJECT_ID \
|
|
162
|
+
--region "us-central1" \
|
|
163
|
+
--no-allow-unauthenticated \
|
|
164
|
+
--no-cpu-throttling \
|
|
165
|
+
--labels "{% if cookiecutter.is_adk %}created-by=adk{% if cookiecutter.agent_garden %},{% endif %}{% endif %}{% if cookiecutter.agent_garden %}deployed-with=agent-garden{% if cookiecutter.agent_sample_id %},vertex-agent-sample-id={{cookiecutter.agent_sample_id}},vertex-agent-sample-publisher={{cookiecutter.agent_sample_publisher}}{% endif %}{% endif %}" \
|
|
166
|
+
--set-env-vars \
|
|
167
|
+
"COMMIT_SHA=$(shell git rev-parse HEAD){%- if cookiecutter.data_ingestion %}{%- if cookiecutter.datastore_type == "vertex_ai_search" %},DATA_STORE_ID={{cookiecutter.project_name}}-datastore,DATA_STORE_REGION=us{%- elif cookiecutter.datastore_type == "vertex_ai_vector_search" %},VECTOR_SEARCH_INDEX={{cookiecutter.project_name}}-vector-search,VECTOR_SEARCH_INDEX_ENDPOINT={{cookiecutter.project_name}}-vector-search-endpoint,VECTOR_SEARCH_BUCKET=$$PROJECT_ID-{{cookiecutter.project_name}}-vs{%- endif %}{%- endif %}" \
|
|
168
|
+
$(if $(IAP),--iap) \
|
|
169
|
+
$(if $(PORT),--port=$(PORT))
|
|
170
|
+
{%- elif cookiecutter.deployment_target == 'agent_engine' %}
|
|
171
|
+
# Export dependencies to requirements file using uv export.
|
|
172
|
+
uv export --no-hashes --no-header --no-dev --no-emit-project --no-annotate > .requirements.txt 2>/dev/null || \
|
|
173
|
+
uv export --no-hashes --no-header --no-dev --no-emit-project > .requirements.txt && uv run {{cookiecutter.agent_directory}}/agent_engine_app.py
|
|
117
174
|
{%- endif %}
|
|
118
175
|
|
|
176
|
+
|
|
177
|
+
# ==============================================================================
|
|
178
|
+
# Infrastructure Setup
|
|
179
|
+
# ==============================================================================
|
|
180
|
+
|
|
119
181
|
# Set up development environment resources using Terraform
|
|
120
182
|
setup-dev-env:
|
|
121
183
|
PROJECT_ID=$$(gcloud config get-value project) && \
|
|
122
184
|
(cd deployment/terraform/dev && terraform init && terraform apply --var-file vars/env.tfvars --var dev_project_id=$$PROJECT_ID --auto-approve)
|
|
123
|
-
|
|
124
185
|
{%- if cookiecutter.data_ingestion %}
|
|
125
186
|
|
|
187
|
+
# ==============================================================================
|
|
188
|
+
# Data Ingestion (RAG capabilities)
|
|
189
|
+
# ==============================================================================
|
|
190
|
+
|
|
126
191
|
# Run the data ingestion pipeline for RAG capabilities
|
|
127
192
|
data-ingestion:
|
|
128
193
|
PROJECT_ID=$$(gcloud config get-value project) && \
|
|
@@ -142,6 +207,10 @@ data-ingestion:
|
|
|
142
207
|
--pipeline-name="data-ingestion-pipeline")
|
|
143
208
|
{%- endif %}
|
|
144
209
|
|
|
210
|
+
# ==============================================================================
|
|
211
|
+
# Testing & Code Quality
|
|
212
|
+
# ==============================================================================
|
|
213
|
+
|
|
145
214
|
# Run unit and integration tests
|
|
146
215
|
test:
|
|
147
216
|
uv run pytest tests/unit && uv run pytest tests/integration
|
|
@@ -58,11 +58,11 @@ make install && make playground
|
|
|
58
58
|
{%- endfor %}
|
|
59
59
|
{%- endif %}
|
|
60
60
|
{%- if cookiecutter.deployment_target == 'cloud_run' %}
|
|
61
|
-
| `make playground` | Launch local development environment with backend and frontend{%- if
|
|
61
|
+
| `make playground` | Launch local development environment with backend and frontend{%- if cookiecutter.is_adk %} - leveraging `adk web` command. {%- endif %}|
|
|
62
62
|
| `make backend` | Deploy agent to Cloud Run (use `IAP=true` to enable Identity-Aware Proxy) |
|
|
63
63
|
| `make local-backend` | Launch local development server |
|
|
64
64
|
{%- if cookiecutter.deployment_target == 'cloud_run' %}
|
|
65
|
-
{%- if cookiecutter.
|
|
65
|
+
{%- if cookiecutter.is_adk_live %}
|
|
66
66
|
| `make ui` | Launch Agent Playground front-end only |
|
|
67
67
|
{%- endif %}
|
|
68
68
|
{%- endif %}
|
|
@@ -80,7 +80,7 @@ make install && make playground
|
|
|
80
80
|
|
|
81
81
|
For full command options and usage, refer to the [Makefile](Makefile).
|
|
82
82
|
|
|
83
|
-
{% if cookiecutter.
|
|
83
|
+
{% if cookiecutter.is_adk_live %}
|
|
84
84
|
## Usage
|
|
85
85
|
|
|
86
86
|
This template follows a "bring your own agent" approach - you focus on your business logic in `{{cookiecutter.agent_directory}}/agent.py`, and the template handles the surrounding components (UI, infrastructure, deployment, monitoring).
|
|
@@ -158,7 +158,7 @@ You can test deployment towards a Dev Environment using the following command:
|
|
|
158
158
|
gcloud config set project <your-dev-project-id>
|
|
159
159
|
make backend
|
|
160
160
|
```
|
|
161
|
-
{% if cookiecutter.
|
|
161
|
+
{% if cookiecutter.is_adk_live %}
|
|
162
162
|
**Note:** For secure access to your deployed backend, consider using Identity-Aware Proxy (IAP) by running `make backend IAP=true`.
|
|
163
163
|
{%- endif %}
|
|
164
164
|
|
|
@@ -169,9 +169,9 @@ See [deployment/README.md](deployment/README.md) for instructions.
|
|
|
169
169
|
|
|
170
170
|
The repository includes a Terraform configuration for the setup of a production Google Cloud project. Refer to [deployment/README.md](deployment/README.md) for detailed instructions on how to deploy the infrastructure and application.
|
|
171
171
|
|
|
172
|
-
{% if cookiecutter.
|
|
172
|
+
{% if not cookiecutter.is_adk_live %}
|
|
173
173
|
## Monitoring and Observability
|
|
174
|
-
> You can use [this Looker Studio dashboard]({%- if
|
|
174
|
+
> You can use [this Looker Studio dashboard]({%- if cookiecutter.is_adk %}https://lookerstudio.google.com/reporting/46b35167-b38b-4e44-bd37-701ef4307418/page/tEnnC{%- else %}https://lookerstudio.google.com/c/reporting/fa742264-4b4b-4c56-81e6-a667dd0f853f/page/tEnnC{%- endif %}
|
|
175
175
|
) template for visualizing events being logged in BigQuery. See the "Setup Instructions" tab to getting started.
|
|
176
176
|
|
|
177
177
|
The application uses OpenTelemetry for comprehensive observability with all events being sent to Google Cloud Trace and Logging for monitoring and to BigQuery for long term storage.
|
|
@@ -25,7 +25,7 @@ locals {
|
|
|
25
25
|
"serviceusage.googleapis.com",
|
|
26
26
|
"logging.googleapis.com",
|
|
27
27
|
"cloudtrace.googleapis.com",
|
|
28
|
-
{%- if
|
|
28
|
+
{%- if cookiecutter.is_adk and cookiecutter.session_type == "alloydb" %}
|
|
29
29
|
"compute.googleapis.com",
|
|
30
30
|
"servicenetworking.googleapis.com",
|
|
31
31
|
"alloydb.googleapis.com",
|
|
@@ -12,13 +12,6 @@
|
|
|
12
12
|
# See the License for the specific language governing permissions and
|
|
13
13
|
# limitations under the License.
|
|
14
14
|
|
|
15
|
-
resource "google_project_iam_member" "bigquery_data_editor" {
|
|
16
|
-
|
|
17
|
-
project = var.dev_project_id
|
|
18
|
-
role = "roles/bigquery.dataEditor"
|
|
19
|
-
member = module.log_export_to_bigquery.writer_identity
|
|
20
|
-
}
|
|
21
|
-
|
|
22
15
|
resource "google_bigquery_dataset" "feedback_dataset" {
|
|
23
16
|
project = var.dev_project_id
|
|
24
17
|
dataset_id = replace("${var.project_name}_feedback", "-", "_")
|
|
@@ -35,29 +28,42 @@ resource "google_bigquery_dataset" "telemetry_logs_dataset" {
|
|
|
35
28
|
depends_on = [resource.google_project_service.services]
|
|
36
29
|
}
|
|
37
30
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
31
|
+
resource "google_logging_project_sink" "feedback_export_to_bigquery" {
|
|
32
|
+
name = "${var.project_name}_feedback"
|
|
33
|
+
project = var.dev_project_id
|
|
34
|
+
destination = "bigquery.googleapis.com/projects/${var.dev_project_id}/datasets/${google_bigquery_dataset.feedback_dataset.dataset_id}"
|
|
35
|
+
filter = var.feedback_logs_filter
|
|
36
|
+
|
|
37
|
+
bigquery_options {
|
|
38
|
+
use_partitioned_tables = true
|
|
39
|
+
}
|
|
40
|
+
|
|
47
41
|
unique_writer_identity = true
|
|
48
42
|
depends_on = [google_bigquery_dataset.feedback_dataset]
|
|
49
43
|
}
|
|
50
44
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
45
|
+
resource "google_logging_project_sink" "log_export_to_bigquery" {
|
|
46
|
+
name = "${var.project_name}_telemetry"
|
|
47
|
+
project = var.dev_project_id
|
|
48
|
+
destination = "bigquery.googleapis.com/projects/${var.dev_project_id}/datasets/${google_bigquery_dataset.telemetry_logs_dataset.dataset_id}"
|
|
49
|
+
filter = var.telemetry_logs_filter
|
|
50
|
+
|
|
51
|
+
bigquery_options {
|
|
52
|
+
use_partitioned_tables = true
|
|
53
|
+
}
|
|
54
54
|
|
|
55
|
-
log_sink_name = "${var.project_name}_telemetry"
|
|
56
|
-
parent_resource_type = "project"
|
|
57
|
-
parent_resource_id = var.dev_project_id
|
|
58
|
-
destination_uri = "bigquery.googleapis.com/projects/${var.dev_project_id}/datasets/${google_bigquery_dataset.telemetry_logs_dataset.dataset_id}"
|
|
59
|
-
filter = var.telemetry_logs_filter
|
|
60
|
-
bigquery_options = { use_partitioned_tables = true }
|
|
61
55
|
unique_writer_identity = true
|
|
62
56
|
depends_on = [google_bigquery_dataset.telemetry_logs_dataset]
|
|
63
57
|
}
|
|
58
|
+
|
|
59
|
+
resource "google_project_iam_member" "bigquery_data_editor" {
|
|
60
|
+
project = var.dev_project_id
|
|
61
|
+
role = "roles/bigquery.dataEditor"
|
|
62
|
+
member = google_logging_project_sink.log_export_to_bigquery.writer_identity
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
resource "google_project_iam_member" "feedback_bigquery_data_editor" {
|
|
66
|
+
project = var.dev_project_id
|
|
67
|
+
role = "roles/bigquery.dataEditor"
|
|
68
|
+
member = google_logging_project_sink.feedback_export_to_bigquery.writer_identity
|
|
69
|
+
}
|