agent-starter-pack 0.16.0__py3-none-any.whl → 0.17.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.
Potentially problematic release.
This version of agent-starter-pack might be problematic. Click here for more details.
- {agents → agent_starter_pack/agents}/adk_live/.template/templateconfig.yaml +1 -1
- {agents → agent_starter_pack/agents}/adk_live/README.md +2 -1
- {src → agent_starter_pack}/base_template/Makefile +2 -2
- {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/github.tf +14 -0
- {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/{% if cookiecutter.cicd_runner == 'google_cloud_build' %}build_triggers.tf{% else %}unused_build_triggers.tf{% endif %} +4 -2
- {src → agent_starter_pack}/base_template/{% if cookiecutter.cicd_runner == 'github_actions' %}.github{% else %}unused_github{% endif %}/workflows/deploy-to-prod.yaml +3 -3
- {src → agent_starter_pack}/base_template/{% if cookiecutter.cicd_runner == 'github_actions' %}.github{% else %}unused_github{% endif %}/workflows/pr_checks.yaml +2 -2
- {src → agent_starter_pack}/base_template/{% if cookiecutter.cicd_runner == 'github_actions' %}.github{% else %}unused_github{% endif %}/workflows/staging.yaml +3 -3
- {src → agent_starter_pack}/base_template/{% if cookiecutter.cicd_runner == 'google_cloud_build' %}.cloudbuild{% else %}unused_.cloudbuild{% endif %}/deploy-to-prod.yaml +4 -4
- {src → agent_starter_pack}/base_template/{% if cookiecutter.cicd_runner == 'google_cloud_build' %}.cloudbuild{% else %}unused_.cloudbuild{% endif %}/pr_checks.yaml +3 -3
- {src → agent_starter_pack}/base_template/{% if cookiecutter.cicd_runner == 'google_cloud_build' %}.cloudbuild{% else %}unused_.cloudbuild{% endif %}/staging.yaml +7 -7
- {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 +15 -18
- agent_starter_pack/deployment_targets/agent_engine/deployment/terraform/{% if not cookiecutter.is_adk_live %}service.tf{% else %}unused_service.tf{% endif %} +82 -0
- {src → agent_starter_pack}/deployment_targets/agent_engine/{{cookiecutter.agent_directory}}/agent_engine_app.py +29 -11
- {src → agent_starter_pack}/deployment_targets/agent_engine/{{cookiecutter.agent_directory}}/utils/deployment.py +11 -6
- {src → 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 %} +110 -51
- {src → agent_starter_pack}/deployment_targets/cloud_run/{{cookiecutter.agent_directory}}/server.py +12 -0
- {src → agent_starter_pack}/resources/docs/adk-cheatsheet.md +5 -5
- {src → agent_starter_pack}/resources/locks/uv-adk_base-agent_engine.lock +741 -701
- {src → agent_starter_pack}/resources/locks/uv-adk_base-cloud_run.lock +1032 -993
- {src → agent_starter_pack}/resources/locks/uv-adk_live-agent_engine.lock +742 -702
- {src → agent_starter_pack}/resources/locks/uv-adk_live-cloud_run.lock +1033 -994
- {src → agent_starter_pack}/resources/locks/uv-agentic_rag-agent_engine.lock +769 -744
- {src → agent_starter_pack}/resources/locks/uv-agentic_rag-cloud_run.lock +1076 -1052
- {src → agent_starter_pack}/resources/locks/uv-crewai_coding_crew-agent_engine.lock +930 -916
- {src → agent_starter_pack}/resources/locks/uv-crewai_coding_crew-cloud_run.lock +1263 -1253
- {src → agent_starter_pack}/resources/locks/uv-langgraph_base_react-agent_engine.lock +814 -807
- {src → agent_starter_pack}/resources/locks/uv-langgraph_base_react-cloud_run.lock +1170 -1167
- {src → agent_starter_pack}/utils/generate_locks.py +4 -3
- {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.16.0.dist-info → agent_starter_pack-0.17.1.dist-info}/METADATA +17 -18
- agent_starter_pack-0.17.1.dist-info/RECORD +179 -0
- agent_starter_pack-0.17.1.dist-info/entry_points.txt +2 -0
- agent_starter_pack-0.16.0.dist-info/RECORD +0 -178
- agent_starter_pack-0.16.0.dist-info/entry_points.txt +0 -2
- {agents → agent_starter_pack/agents}/README.md +0 -0
- {agents → agent_starter_pack/agents}/adk_base/.template/templateconfig.yaml +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}/adk_live/app/agent.py +0 -0
- {agents → agent_starter_pack/agents}/adk_live/tests/unit/test_dummy.py +0 -0
- {agents → agent_starter_pack/agents}/agentic_rag/.template/templateconfig.yaml +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/agent.py +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/app/agent.py +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/GEMINI.md +0 -0
- {src → agent_starter_pack}/base_template/README.md +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/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/variables.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/locals.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/variables.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/pyproject.toml +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}/base_template/{{cookiecutter.agent_directory}}/utils/tracing.py +0 -0
- {src → agent_starter_pack}/base_template/{{cookiecutter.agent_directory}}/utils/typing.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/integration/test_agent_engine_app.py +0 -0
- {src → agent_starter_pack}/deployment_targets/agent_engine/tests/load_test/.results/.placeholder +0 -0
- {src → agent_starter_pack}/deployment_targets/agent_engine/tests/load_test/README.md +0 -0
- {src → agent_starter_pack}/deployment_targets/agent_engine/tests/load_test/load_test.py +0 -0
- {src → agent_starter_pack}/deployment_targets/cloud_run/Dockerfile +0 -0
- {src → agent_starter_pack}/deployment_targets/cloud_run/deployment/terraform/dev/service.tf +0 -0
- {src → agent_starter_pack}/deployment_targets/cloud_run/deployment/terraform/service.tf +0 -0
- {src → agent_starter_pack}/deployment_targets/cloud_run/tests/integration/test_server_e2e.py +0 -0
- {src → agent_starter_pack}/deployment_targets/cloud_run/tests/load_test/.results/.placeholder +0 -0
- {src → agent_starter_pack}/deployment_targets/cloud_run/tests/load_test/README.md +0 -0
- {src → agent_starter_pack}/deployment_targets/cloud_run/tests/load_test/load_test.py +0 -0
- {src → agent_starter_pack}/frontends/adk_live_react/frontend/package-lock.json +0 -0
- {src → agent_starter_pack}/frontends/adk_live_react/frontend/package.json +0 -0
- {src → agent_starter_pack}/frontends/adk_live_react/frontend/public/favicon.ico +0 -0
- {src → agent_starter_pack}/frontends/adk_live_react/frontend/public/index.html +0 -0
- {src → agent_starter_pack}/frontends/adk_live_react/frontend/public/robots.txt +0 -0
- {src → agent_starter_pack}/frontends/adk_live_react/frontend/src/App.scss +0 -0
- {src → agent_starter_pack}/frontends/adk_live_react/frontend/src/App.test.tsx +0 -0
- {src → agent_starter_pack}/frontends/adk_live_react/frontend/src/App.tsx +0 -0
- {src → agent_starter_pack}/frontends/adk_live_react/frontend/src/components/audio-pulse/AudioPulse.tsx +0 -0
- {src → agent_starter_pack}/frontends/adk_live_react/frontend/src/components/audio-pulse/audio-pulse.scss +0 -0
- {src → agent_starter_pack}/frontends/adk_live_react/frontend/src/components/logger/Logger.tsx +0 -0
- {src → agent_starter_pack}/frontends/adk_live_react/frontend/src/components/logger/logger.scss +0 -0
- {src → agent_starter_pack}/frontends/adk_live_react/frontend/src/components/logger/mock-logs.ts +0 -0
- {src → agent_starter_pack}/frontends/adk_live_react/frontend/src/components/side-panel/SidePanel.tsx +0 -0
- {src → agent_starter_pack}/frontends/adk_live_react/frontend/src/components/side-panel/side-panel.scss +0 -0
- {src → agent_starter_pack}/frontends/adk_live_react/frontend/src/components/transcription-preview/TranscriptionPreview.tsx +0 -0
- {src → agent_starter_pack}/frontends/adk_live_react/frontend/src/components/transcription-preview/transcription-preview.scss +0 -0
- {src → agent_starter_pack}/frontends/adk_live_react/frontend/src/contexts/LiveAPIContext.tsx +0 -0
- {src → agent_starter_pack}/frontends/adk_live_react/frontend/src/hooks/use-live-api.ts +0 -0
- {src → agent_starter_pack}/frontends/adk_live_react/frontend/src/hooks/use-media-stream-mux.ts +0 -0
- {src → agent_starter_pack}/frontends/adk_live_react/frontend/src/hooks/use-screen-capture.ts +0 -0
- {src → agent_starter_pack}/frontends/adk_live_react/frontend/src/hooks/use-webcam.ts +0 -0
- {src → agent_starter_pack}/frontends/adk_live_react/frontend/src/index.css +0 -0
- {src → agent_starter_pack}/frontends/adk_live_react/frontend/src/index.tsx +0 -0
- {src → agent_starter_pack}/frontends/adk_live_react/frontend/src/multimodal-live-types.ts +0 -0
- {src → agent_starter_pack}/frontends/adk_live_react/frontend/src/react-app-env.d.ts +0 -0
- {src → agent_starter_pack}/frontends/adk_live_react/frontend/src/reportWebVitals.ts +0 -0
- {src → agent_starter_pack}/frontends/adk_live_react/frontend/src/setupTests.ts +0 -0
- {src → agent_starter_pack}/frontends/adk_live_react/frontend/src/utils/audio-recorder.ts +0 -0
- {src → agent_starter_pack}/frontends/adk_live_react/frontend/src/utils/audio-streamer.ts +0 -0
- {src → agent_starter_pack}/frontends/adk_live_react/frontend/src/utils/audioworklet-registry.ts +0 -0
- {src → agent_starter_pack}/frontends/adk_live_react/frontend/src/utils/multimodal-live-client.ts +0 -0
- {src → agent_starter_pack}/frontends/adk_live_react/frontend/src/utils/store-logger.ts +0 -0
- {src → agent_starter_pack}/frontends/adk_live_react/frontend/src/utils/utils.ts +0 -0
- {src → agent_starter_pack}/frontends/adk_live_react/frontend/src/utils/worklets/audio-processing.ts +0 -0
- {src → agent_starter_pack}/frontends/adk_live_react/frontend/src/utils/worklets/vol-meter.ts +0 -0
- {src → 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/local_chat_history.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
- {src → agent_starter_pack}/resources/idx/.idx/dev.nix +0 -0
- {src → agent_starter_pack}/resources/idx/idx-template.json +0 -0
- {src → agent_starter_pack}/resources/idx/idx-template.nix +0 -0
- {agent_starter_pack-0.16.0.dist-info → agent_starter_pack-0.17.1.dist-info}/WHEEL +0 -0
- {agent_starter_pack-0.16.0.dist-info → agent_starter_pack-0.17.1.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,82 @@
|
|
|
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
|
+
# Get project information to access the project number
|
|
16
|
+
data "google_project" "project" {
|
|
17
|
+
for_each = local.deploy_project_ids
|
|
18
|
+
|
|
19
|
+
project_id = local.deploy_project_ids[each.key]
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
resource "google_vertex_ai_reasoning_engine" "app_staging" {
|
|
23
|
+
display_name = var.project_name
|
|
24
|
+
description = "Agent deployed via Terraform"
|
|
25
|
+
region = var.region
|
|
26
|
+
project = var.staging_project_id
|
|
27
|
+
|
|
28
|
+
spec {
|
|
29
|
+
service_account = google_service_account.app_sa["staging"].email
|
|
30
|
+
|
|
31
|
+
package_spec {
|
|
32
|
+
# IMPORTANT: This Python version must match the version used in CI/CD pipelines
|
|
33
|
+
# for pickling compatibility. Mismatched versions will cause deserialization errors.
|
|
34
|
+
python_version = "3.12"
|
|
35
|
+
pickle_object_gcs_uri = "gs://agent-starter-pack/dummy/agent_engine.pkl"
|
|
36
|
+
dependency_files_gcs_uri = "gs://agent-starter-pack/dummy/dependencies.tar.gz"
|
|
37
|
+
requirements_gcs_uri = "gs://agent-starter-pack/dummy/requirements.txt"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
# This lifecycle block prevents Terraform from overwriting the spec when it's
|
|
42
|
+
# updated by Agent Engine deployments outside of Terraform (e.g., via CI/CD pipelines)
|
|
43
|
+
lifecycle {
|
|
44
|
+
ignore_changes = [
|
|
45
|
+
spec,
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
# Make dependencies conditional to avoid errors.
|
|
50
|
+
depends_on = [google_project_service.deploy_project_services]
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
resource "google_vertex_ai_reasoning_engine" "app_prod" {
|
|
54
|
+
display_name = var.project_name
|
|
55
|
+
description = "Agent deployed via Terraform"
|
|
56
|
+
region = var.region
|
|
57
|
+
project = var.prod_project_id
|
|
58
|
+
|
|
59
|
+
spec {
|
|
60
|
+
service_account = google_service_account.app_sa["prod"].email
|
|
61
|
+
|
|
62
|
+
package_spec {
|
|
63
|
+
# IMPORTANT: This Python version must match the version used in CI/CD pipelines
|
|
64
|
+
# for pickling compatibility. Mismatched versions will cause deserialization errors.
|
|
65
|
+
python_version = "3.12"
|
|
66
|
+
pickle_object_gcs_uri = "gs://agent-starter-pack/dummy/agent_engine.pkl"
|
|
67
|
+
dependency_files_gcs_uri = "gs://agent-starter-pack/dummy/dependencies.tar.gz"
|
|
68
|
+
requirements_gcs_uri = "gs://agent-starter-pack/dummy/requirements.txt"
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
# This lifecycle block prevents Terraform from overwriting the spec when it's
|
|
73
|
+
# updated by Agent Engine deployments outside of Terraform (e.g., via CI/CD pipelines)
|
|
74
|
+
lifecycle {
|
|
75
|
+
ignore_changes = [
|
|
76
|
+
spec,
|
|
77
|
+
]
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
# Make dependencies conditional to avoid errors.
|
|
81
|
+
depends_on = [google_project_service.deploy_project_services]
|
|
82
|
+
}
|
|
@@ -239,6 +239,16 @@ class AgentEngineApp:
|
|
|
239
239
|
default=None,
|
|
240
240
|
help="Service account email to use for the agent engine",
|
|
241
241
|
)
|
|
242
|
+
@click.option(
|
|
243
|
+
"--staging-bucket-uri",
|
|
244
|
+
default=None,
|
|
245
|
+
help="GCS bucket URI for staging files (defaults to gs://{project}-agent-engine)",
|
|
246
|
+
)
|
|
247
|
+
@click.option(
|
|
248
|
+
"--artifacts-bucket-name",
|
|
249
|
+
default=None,
|
|
250
|
+
help="GCS bucket name for artifacts (defaults to gs://{project}-agent-engine)",
|
|
251
|
+
)
|
|
242
252
|
def deploy_agent_engine_app(
|
|
243
253
|
project: str | None,
|
|
244
254
|
location: str,
|
|
@@ -247,13 +257,31 @@ def deploy_agent_engine_app(
|
|
|
247
257
|
extra_packages: tuple[str, ...],
|
|
248
258
|
set_env_vars: str | None,
|
|
249
259
|
service_account: str | None,
|
|
260
|
+
staging_bucket_uri: str | None,
|
|
261
|
+
artifacts_bucket_name: str | None,
|
|
250
262
|
) -> AgentEngine:
|
|
251
263
|
"""Deploy the agent engine app to Vertex AI."""
|
|
264
|
+
|
|
265
|
+
logging.basicConfig(level=logging.INFO)
|
|
266
|
+
|
|
252
267
|
# Parse environment variables if provided
|
|
253
268
|
env_vars = parse_env_vars(set_env_vars)
|
|
254
269
|
|
|
255
270
|
if not project:
|
|
256
271
|
_, project = google.auth.default()
|
|
272
|
+
if not staging_bucket_uri:
|
|
273
|
+
staging_bucket_uri = f"gs://{project}-agent-engine"
|
|
274
|
+
if not artifacts_bucket_name:
|
|
275
|
+
artifacts_bucket_name = f"gs://{project}-agent-engine"
|
|
276
|
+
|
|
277
|
+
{%- if "adk" in cookiecutter.tags %}
|
|
278
|
+
create_bucket_if_not_exists(
|
|
279
|
+
bucket_name=artifacts_bucket_name, project=project, location=location
|
|
280
|
+
)
|
|
281
|
+
{%- endif %}
|
|
282
|
+
create_bucket_if_not_exists(
|
|
283
|
+
bucket_name=staging_bucket_uri, project=project, location=location
|
|
284
|
+
)
|
|
257
285
|
|
|
258
286
|
print("""
|
|
259
287
|
╔═══════════════════════════════════════════════════════════╗
|
|
@@ -263,18 +291,7 @@ def deploy_agent_engine_app(
|
|
|
263
291
|
╚═══════════════════════════════════════════════════════════╝
|
|
264
292
|
""")
|
|
265
293
|
|
|
266
|
-
logging.basicConfig(level=logging.INFO)
|
|
267
294
|
extra_packages_list = list(extra_packages)
|
|
268
|
-
staging_bucket_uri = f"gs://{project}-agent-engine"
|
|
269
|
-
{%- if "adk" in cookiecutter.tags %}
|
|
270
|
-
artifacts_bucket_name = f"{project}-{{cookiecutter.project_name}}-logs"
|
|
271
|
-
create_bucket_if_not_exists(
|
|
272
|
-
bucket_name=artifacts_bucket_name, project=project, location=location
|
|
273
|
-
)
|
|
274
|
-
{%- endif %}
|
|
275
|
-
create_bucket_if_not_exists(
|
|
276
|
-
bucket_name=staging_bucket_uri, project=project, location=location
|
|
277
|
-
)
|
|
278
295
|
|
|
279
296
|
# Initialize vertexai client
|
|
280
297
|
client = vertexai.Client(
|
|
@@ -318,6 +335,7 @@ def deploy_agent_engine_app(
|
|
|
318
335
|
requirements=requirements,
|
|
319
336
|
staging_bucket=staging_bucket_uri,
|
|
320
337
|
labels=labels,
|
|
338
|
+
gcs_dir_name=agent_name,
|
|
321
339
|
{%- if cookiecutter.is_adk_live %}
|
|
322
340
|
agent_server_mode=AgentServerMode.EXPERIMENTAL, # Enable bidi streaming
|
|
323
341
|
resource_limits={"cpu": "4", "memory": "8Gi"},
|
|
@@ -76,14 +76,19 @@ def print_deployment_success(
|
|
|
76
76
|
console_url = f"https://console.cloud.google.com/vertex-ai/agents/locations/{location}/agent-engines/{agent_engine_id}?project={project}"
|
|
77
77
|
|
|
78
78
|
{%- if cookiecutter.is_adk %}
|
|
79
|
-
print(
|
|
80
79
|
{%- if cookiecutter.is_adk_live %}
|
|
81
|
-
|
|
80
|
+
print("\n✅ Deployment successful! Run your agent with: `make playground-remote`")
|
|
82
81
|
{%- else %}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
f"\n📊 View in console: {console_url}\n"
|
|
82
|
+
print(
|
|
83
|
+
"\n✅ Deployment successful! Test your agent: notebooks/adk_app_testing.ipynb"
|
|
86
84
|
)
|
|
85
|
+
{%- endif %}
|
|
86
|
+
service_account = remote_agent.api_resource.spec.service_account
|
|
87
|
+
print(f"Service Account: {service_account}")
|
|
88
|
+
print(f"\n📊 View in console: {console_url}\n")
|
|
87
89
|
{%- else %}
|
|
88
|
-
print(
|
|
90
|
+
print("\n✅ Deployment successful!")
|
|
91
|
+
service_account = remote_agent.api_resource.spec.service_account
|
|
92
|
+
print(f"Service Account: {service_account}")
|
|
93
|
+
print(f"\n📊 View in console: {console_url}\n")
|
|
89
94
|
{%- endif %}
|
|
@@ -17,7 +17,7 @@ import json
|
|
|
17
17
|
import logging
|
|
18
18
|
from collections.abc import Callable
|
|
19
19
|
from pathlib import Path
|
|
20
|
-
from typing import Literal
|
|
20
|
+
from typing import Any, Literal
|
|
21
21
|
|
|
22
22
|
import backoff
|
|
23
23
|
import google.auth
|
|
@@ -30,9 +30,6 @@ from google.cloud import logging as google_cloud_logging
|
|
|
30
30
|
from pydantic import BaseModel
|
|
31
31
|
from websockets.exceptions import ConnectionClosedError
|
|
32
32
|
|
|
33
|
-
from ..agent import root_agent
|
|
34
|
-
from ..agent_engine_app import AgentEngineApp
|
|
35
|
-
|
|
36
33
|
app = FastAPI()
|
|
37
34
|
app.add_middleware(
|
|
38
35
|
CORSMiddleware,
|
|
@@ -56,28 +53,36 @@ logging_client = google_cloud_logging.Client()
|
|
|
56
53
|
logger = logging_client.logger(__name__)
|
|
57
54
|
logging.basicConfig(level=logging.INFO)
|
|
58
55
|
|
|
59
|
-
#
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
56
|
+
# Initialize default configuration
|
|
57
|
+
app.state.config = {
|
|
58
|
+
"use_remote_agent": False,
|
|
59
|
+
"remote_agent_engine_id": None,
|
|
60
|
+
"project_id": None,
|
|
61
|
+
"location": "us-central1",
|
|
62
|
+
"local_agent_path": "..agent.root_agent",
|
|
63
|
+
"agent_engine_class_path": "..agent_engine_app.AgentEngineApp",
|
|
64
|
+
}
|
|
65
65
|
|
|
66
66
|
|
|
67
67
|
class WebSocketToQueueAdapter:
|
|
68
68
|
"""Adapter to convert WebSocket messages to an asyncio Queue for the agent engine."""
|
|
69
69
|
|
|
70
70
|
def __init__(
|
|
71
|
-
self,
|
|
71
|
+
self,
|
|
72
|
+
websocket: WebSocket,
|
|
73
|
+
agent_engine: Any = None,
|
|
74
|
+
remote_config: dict[str, Any] | None = None,
|
|
72
75
|
):
|
|
73
76
|
"""Initialize the adapter.
|
|
74
77
|
|
|
75
78
|
Args:
|
|
76
79
|
websocket: The client websocket connection
|
|
77
|
-
agent_engine: The agent engine instance (None if using remote)
|
|
80
|
+
agent_engine: The agent engine instance with bidi_stream_query method (None if using remote)
|
|
81
|
+
remote_config: Remote agent engine configuration (project_id, location, remote_agent_engine_id)
|
|
78
82
|
"""
|
|
79
83
|
self.websocket = websocket
|
|
80
84
|
self.agent_engine = agent_engine
|
|
85
|
+
self.remote_config = remote_config
|
|
81
86
|
self.input_queue: asyncio.Queue[dict] = asyncio.Queue()
|
|
82
87
|
self.first_message = True
|
|
83
88
|
|
|
@@ -170,20 +175,29 @@ class WebSocketToQueueAdapter:
|
|
|
170
175
|
else:
|
|
171
176
|
# Remote agent engine mode
|
|
172
177
|
# Don't send setupComplete until remote connection is established
|
|
173
|
-
|
|
178
|
+
assert self.remote_config is not None, (
|
|
179
|
+
"remote_config must be set for remote mode"
|
|
180
|
+
)
|
|
181
|
+
await self.run_remote_agent_engine(
|
|
182
|
+
project_id=self.remote_config["project_id"],
|
|
183
|
+
location=self.remote_config["location"],
|
|
184
|
+
remote_agent_engine_id=self.remote_config["remote_agent_engine_id"],
|
|
185
|
+
)
|
|
174
186
|
except Exception as e:
|
|
175
187
|
logging.error(f"Error in agent engine: {e}")
|
|
176
188
|
await self.websocket.send_json({"error": str(e)})
|
|
177
189
|
|
|
178
|
-
async def run_remote_agent_engine(
|
|
190
|
+
async def run_remote_agent_engine(
|
|
191
|
+
self, project_id: str, location: str, remote_agent_engine_id: str
|
|
192
|
+
) -> None:
|
|
179
193
|
"""Run the remote agent engine connection."""
|
|
180
194
|
client = vertexai.Client(
|
|
181
|
-
project=
|
|
182
|
-
location=
|
|
195
|
+
project=project_id,
|
|
196
|
+
location=location,
|
|
183
197
|
)
|
|
184
198
|
|
|
185
199
|
async with client.aio.live.agent_engines.connect(
|
|
186
|
-
agent_engine=
|
|
200
|
+
agent_engine=remote_agent_engine_id,
|
|
187
201
|
config={"class_method": "bidi_stream_query"},
|
|
188
202
|
) as session:
|
|
189
203
|
# Send setupComplete only after remote connection is established
|
|
@@ -230,11 +244,30 @@ class WebSocketToQueueAdapter:
|
|
|
230
244
|
)
|
|
231
245
|
|
|
232
246
|
|
|
233
|
-
def
|
|
247
|
+
def _dynamic_import(path: str) -> Any:
|
|
248
|
+
"""Dynamically import an object from a given path.
|
|
249
|
+
|
|
250
|
+
Args:
|
|
251
|
+
path: Python import path (e.g., '..agent.root_agent')
|
|
252
|
+
|
|
253
|
+
Returns:
|
|
254
|
+
The imported object
|
|
255
|
+
"""
|
|
256
|
+
import importlib
|
|
257
|
+
|
|
258
|
+
module_path, object_name = path.rsplit(".", 1)
|
|
259
|
+
module = importlib.import_module(module_path, package=__package__)
|
|
260
|
+
return getattr(module, object_name)
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
def get_connect_and_run_callable(
|
|
264
|
+
websocket: WebSocket, config: dict[str, Any]
|
|
265
|
+
) -> Callable:
|
|
234
266
|
"""Create a callable that handles agent engine connection with retry logic.
|
|
235
267
|
|
|
236
268
|
Args:
|
|
237
269
|
websocket: The client websocket connection
|
|
270
|
+
config: Configuration dict with agent engine settings
|
|
238
271
|
|
|
239
272
|
Returns:
|
|
240
273
|
Callable: An async function that establishes and manages the agent engine connection
|
|
@@ -251,18 +284,28 @@ def get_connect_and_run_callable(websocket: WebSocket) -> Callable:
|
|
|
251
284
|
backoff.expo, ConnectionClosedError, max_tries=10, on_backoff=on_backoff
|
|
252
285
|
)
|
|
253
286
|
async def connect_and_run() -> None:
|
|
254
|
-
if
|
|
287
|
+
if config["use_remote_agent"]:
|
|
255
288
|
# Remote agent engine mode
|
|
256
|
-
logging.info(
|
|
257
|
-
|
|
289
|
+
logging.info(
|
|
290
|
+
f"Connecting to remote agent engine: {config['remote_agent_engine_id']}"
|
|
291
|
+
)
|
|
292
|
+
remote_config = {
|
|
293
|
+
"project_id": config["project_id"],
|
|
294
|
+
"location": config["location"],
|
|
295
|
+
"remote_agent_engine_id": config["remote_agent_engine_id"],
|
|
296
|
+
}
|
|
297
|
+
adapter = WebSocketToQueueAdapter(
|
|
298
|
+
websocket, agent_engine=None, remote_config=remote_config
|
|
299
|
+
)
|
|
258
300
|
else:
|
|
259
301
|
# Local agent engine mode
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
)
|
|
302
|
+
# Dynamically import agent and engine class
|
|
303
|
+
agent_callable = _dynamic_import(config["local_agent_path"])
|
|
263
304
|
logging.info(
|
|
264
305
|
f"Starting local agent engine with callable: {agent_callable.__name__ if hasattr(agent_callable, '__name__') else agent_callable}"
|
|
265
306
|
)
|
|
307
|
+
|
|
308
|
+
AgentEngineApp = _dynamic_import(config["agent_engine_class_path"])
|
|
266
309
|
agent_engine = AgentEngineApp(agent=agent_callable)
|
|
267
310
|
adapter = WebSocketToQueueAdapter(websocket, agent_engine)
|
|
268
311
|
|
|
@@ -279,7 +322,7 @@ def get_connect_and_run_callable(websocket: WebSocket) -> Callable:
|
|
|
279
322
|
async def websocket_endpoint(websocket: WebSocket) -> None:
|
|
280
323
|
"""Handle new websocket connections."""
|
|
281
324
|
await websocket.accept()
|
|
282
|
-
connect_and_run = get_connect_and_run_callable(websocket)
|
|
325
|
+
connect_and_run = get_connect_and_run_callable(websocket, app.state.config)
|
|
283
326
|
await connect_and_run()
|
|
284
327
|
|
|
285
328
|
|
|
@@ -370,7 +413,14 @@ if __name__ == "__main__":
|
|
|
370
413
|
parser.add_argument(
|
|
371
414
|
"--local-agent",
|
|
372
415
|
type=str,
|
|
373
|
-
|
|
416
|
+
default="..agent.root_agent",
|
|
417
|
+
help="Python path to local agent callable (e.g., 'app.agent.root_agent')",
|
|
418
|
+
)
|
|
419
|
+
parser.add_argument(
|
|
420
|
+
"--agent-engine-class",
|
|
421
|
+
type=str,
|
|
422
|
+
default="..agent_engine_app.AgentEngineApp",
|
|
423
|
+
help="Python path to agent engine class",
|
|
374
424
|
)
|
|
375
425
|
parser.add_argument(
|
|
376
426
|
"--port",
|
|
@@ -387,8 +437,18 @@ if __name__ == "__main__":
|
|
|
387
437
|
|
|
388
438
|
args = parser.parse_args()
|
|
389
439
|
|
|
440
|
+
# Initialize configuration
|
|
441
|
+
config: dict[str, Any] = {
|
|
442
|
+
"use_remote_agent": False,
|
|
443
|
+
"remote_agent_engine_id": None,
|
|
444
|
+
"project_id": None,
|
|
445
|
+
"location": "us-central1",
|
|
446
|
+
"local_agent_path": args.local_agent,
|
|
447
|
+
"agent_engine_class_path": args.agent_engine_class,
|
|
448
|
+
}
|
|
449
|
+
|
|
390
450
|
if args.mode == "remote":
|
|
391
|
-
|
|
451
|
+
config["use_remote_agent"] = True
|
|
392
452
|
|
|
393
453
|
# Try to load from deployment_metadata.json if remote-id not provided
|
|
394
454
|
if not args.remote_id:
|
|
@@ -398,8 +458,10 @@ if __name__ == "__main__":
|
|
|
398
458
|
if deployment_metadata_path.exists():
|
|
399
459
|
with open(deployment_metadata_path) as f:
|
|
400
460
|
metadata = json.load(f)
|
|
401
|
-
|
|
402
|
-
|
|
461
|
+
config["remote_agent_engine_id"] = metadata.get(
|
|
462
|
+
"remote_agent_engine_id"
|
|
463
|
+
)
|
|
464
|
+
if not config["remote_agent_engine_id"]:
|
|
403
465
|
parser.error(
|
|
404
466
|
"No remote_agent_engine_id found in deployment_metadata.json"
|
|
405
467
|
)
|
|
@@ -409,7 +471,7 @@ if __name__ == "__main__":
|
|
|
409
471
|
"--remote-id is required when deployment_metadata.json is not found"
|
|
410
472
|
)
|
|
411
473
|
else:
|
|
412
|
-
|
|
474
|
+
config["remote_agent_engine_id"] = args.remote_id
|
|
413
475
|
|
|
414
476
|
# Extract project ID from remote agent engine ID if not provided
|
|
415
477
|
if not args.project_id:
|
|
@@ -418,12 +480,12 @@ if __name__ == "__main__":
|
|
|
418
480
|
|
|
419
481
|
match = re.match(
|
|
420
482
|
r"projects/([^/]+)/locations/([^/]+)/reasoningEngines/",
|
|
421
|
-
|
|
483
|
+
config["remote_agent_engine_id"],
|
|
422
484
|
)
|
|
423
485
|
if match:
|
|
424
|
-
|
|
486
|
+
config["project_id"] = match.group(1)
|
|
425
487
|
extracted_location = match.group(2)
|
|
426
|
-
|
|
488
|
+
config["location"] = (
|
|
427
489
|
args.location
|
|
428
490
|
if args.location != "us-central1"
|
|
429
491
|
else extracted_location
|
|
@@ -432,30 +494,27 @@ if __name__ == "__main__":
|
|
|
432
494
|
else:
|
|
433
495
|
# Fall back to google.auth.default()
|
|
434
496
|
try:
|
|
435
|
-
_,
|
|
436
|
-
|
|
437
|
-
print(
|
|
497
|
+
_, config["project_id"] = google.auth.default()
|
|
498
|
+
config["location"] = args.location
|
|
499
|
+
print(
|
|
500
|
+
f"Using default project ID from google.auth: {config['project_id']}"
|
|
501
|
+
)
|
|
438
502
|
except Exception as e:
|
|
439
503
|
parser.error(f"Could not determine project ID: {e}")
|
|
440
504
|
else:
|
|
441
|
-
|
|
442
|
-
|
|
505
|
+
config["project_id"] = args.project_id
|
|
506
|
+
config["location"] = args.location
|
|
443
507
|
|
|
444
508
|
print("Starting server in REMOTE mode:")
|
|
445
|
-
print(f" Remote Agent Engine ID: {
|
|
446
|
-
print(f" Project ID: {
|
|
447
|
-
print(f" Location: {
|
|
509
|
+
print(f" Remote Agent Engine ID: {config['remote_agent_engine_id']}")
|
|
510
|
+
print(f" Project ID: {config['project_id']}")
|
|
511
|
+
print(f" Location: {config['location']}")
|
|
448
512
|
else:
|
|
449
513
|
print("Starting server in LOCAL mode")
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
module = importlib.import_module(module_path)
|
|
456
|
-
LOCAL_AGENT_CALLABLE = getattr(module, callable_name)
|
|
457
|
-
print(f" Using custom agent: {args.local_agent}")
|
|
458
|
-
else:
|
|
459
|
-
print(" Using default agent: root_agent")
|
|
514
|
+
print(f" Using agent: {config['local_agent_path']}")
|
|
515
|
+
print(f" Using agent engine class: {config['agent_engine_class_path']}")
|
|
516
|
+
|
|
517
|
+
# Store configuration in app state
|
|
518
|
+
app.state.config = config
|
|
460
519
|
|
|
461
520
|
uvicorn.run(app, host=args.host, port=args.port)
|
{src → agent_starter_pack}/deployment_targets/cloud_run/{{cookiecutter.agent_directory}}/server.py
RENAMED
|
@@ -19,6 +19,7 @@ from collections.abc import Callable
|
|
|
19
19
|
from pathlib import Path
|
|
20
20
|
|
|
21
21
|
import backoff
|
|
22
|
+
import google.auth
|
|
22
23
|
from fastapi import FastAPI, HTTPException, WebSocket
|
|
23
24
|
from fastapi.middleware.cors import CORSMiddleware
|
|
24
25
|
from fastapi.responses import FileResponse
|
|
@@ -29,10 +30,13 @@ from google.adk.memory.in_memory_memory_service import InMemoryMemoryService
|
|
|
29
30
|
from google.adk.runners import Runner
|
|
30
31
|
from google.adk.sessions.in_memory_session_service import InMemorySessionService
|
|
31
32
|
from google.cloud import logging as google_cloud_logging
|
|
33
|
+
from opentelemetry import trace
|
|
34
|
+
from opentelemetry.sdk.trace import TracerProvider, export
|
|
32
35
|
from vertexai.agent_engines import _utils
|
|
33
36
|
from websockets.exceptions import ConnectionClosedError
|
|
34
37
|
|
|
35
38
|
from .agent import root_agent
|
|
39
|
+
from .utils.tracing import CloudTraceLoggingSpanExporter
|
|
36
40
|
from .utils.typing import Feedback
|
|
37
41
|
|
|
38
42
|
app = FastAPI()
|
|
@@ -58,6 +62,14 @@ logging_client = google_cloud_logging.Client()
|
|
|
58
62
|
logger = logging_client.logger(__name__)
|
|
59
63
|
logging.basicConfig(level=logging.INFO)
|
|
60
64
|
|
|
65
|
+
_, project_id = google.auth.default()
|
|
66
|
+
provider = TracerProvider()
|
|
67
|
+
processor = export.BatchSpanProcessor(
|
|
68
|
+
CloudTraceLoggingSpanExporter(project_id=project_id)
|
|
69
|
+
)
|
|
70
|
+
provider.add_span_processor(processor)
|
|
71
|
+
trace.set_tracer_provider(provider)
|
|
72
|
+
|
|
61
73
|
|
|
62
74
|
# Initialize ADK services
|
|
63
75
|
session_service = InMemorySessionService()
|
|
@@ -1464,8 +1464,8 @@ if __name__ == "__main__":
|
|
|
1464
1464
|
|
|
1465
1465
|
For detailed specifications of all classes, methods, and commands, refer to the official reference documentation.
|
|
1466
1466
|
|
|
1467
|
-
* [Python API Reference](
|
|
1468
|
-
* [Java API Reference](
|
|
1469
|
-
* [CLI Reference](
|
|
1470
|
-
* [REST API Reference](
|
|
1471
|
-
* [Agent Config YAML Reference](
|
|
1467
|
+
* [Python API Reference](https://github.com/google/adk-docs/tree/main/docs/api-reference/python)
|
|
1468
|
+
* [Java API Reference](https://github.com/google/adk-docs/tree/main/docs/api-reference/java)
|
|
1469
|
+
* [CLI Reference](https://github.com/google/adk-docs/tree/main/docs/api-reference/cli)
|
|
1470
|
+
* [REST API Reference](https://github.com/google/adk-docs/tree/main/docs/api-reference/rest)
|
|
1471
|
+
* [Agent Config YAML Reference](https://github.com/google/adk-docs/tree/main/docs/api-reference/agentconfig)
|