agent-starter-pack 0.19.0__py3-none-any.whl → 0.19.2__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.

@@ -503,7 +503,7 @@
503
503
  "\n",
504
504
  "# Send the streaming request to the A2A endpoint\n",
505
505
  "response = requests.post(\n",
506
- " f\"{SERVICE_URL}/a2a/app/\",\n",
506
+ " f\"{SERVICE_URL}/a2a/app\",\n",
507
507
  " headers=headers,\n",
508
508
  " json=request.model_dump(mode=\"json\", exclude_none=True),\n",
509
509
  " stream=True,\n",
@@ -556,7 +556,7 @@
556
556
  "\n",
557
557
  "# Send the streaming request to the local A2A endpoint\n",
558
558
  "response = requests.post(\n",
559
- " \"http://127.0.0.1:8000/a2a/app/\",\n",
559
+ " \"http://127.0.0.1:8000/a2a/app\",\n",
560
560
  " headers=headers,\n",
561
561
  " json=request.model_dump(mode=\"json\", exclude_none=True),\n",
562
562
  " stream=True,\n",
@@ -17,6 +17,7 @@ import logging
17
17
  import os
18
18
  import pathlib
19
19
  import shutil
20
+ import sys
20
21
  import tempfile
21
22
  from dataclasses import dataclass
22
23
  from typing import Any
@@ -459,6 +460,72 @@ def copy_data_ingestion_files(
459
460
  )
460
461
 
461
462
 
463
+ def _extract_agent_garden_labels(
464
+ agent_garden: bool,
465
+ remote_spec: Any | None,
466
+ remote_template_path: pathlib.Path | None,
467
+ ) -> tuple[str | None, str | None]:
468
+ """Extract agent sample ID and publisher for Agent Garden labeling.
469
+
470
+ This function supports two mechanisms for extracting label information:
471
+ 1. From remote_spec metadata (for ADK samples)
472
+ 2. Fallback to pyproject.toml parsing (for version-locked templates)
473
+
474
+ Args:
475
+ agent_garden: Whether this deployment is from Agent Garden
476
+ remote_spec: Remote template spec with ADK samples metadata
477
+ remote_template_path: Path to remote template directory
478
+
479
+ Returns:
480
+ Tuple of (agent_sample_id, agent_sample_publisher) or (None, None) if no labels found
481
+ """
482
+ if not agent_garden:
483
+ return None, None
484
+
485
+ agent_sample_id = None
486
+ agent_sample_publisher = None
487
+
488
+ # Handle remote specs with ADK samples metadata
489
+ if (
490
+ remote_spec
491
+ and hasattr(remote_spec, "is_adk_samples")
492
+ and remote_spec.is_adk_samples
493
+ ):
494
+ # For ADK samples, template_path is like "python/agents/sample-name"
495
+ agent_sample_id = pathlib.Path(remote_spec.template_path).name
496
+ # For ADK samples, publisher is always "google"
497
+ agent_sample_publisher = "google"
498
+ logging.debug(f"Detected ADK sample from remote_spec: {agent_sample_id}")
499
+ return agent_sample_id, agent_sample_publisher
500
+
501
+ # Fallback: Detect ADK samples from pyproject.toml (for version-locked templates)
502
+ if remote_template_path:
503
+ pyproject_path = remote_template_path / "pyproject.toml"
504
+ if pyproject_path.exists():
505
+ try:
506
+ if sys.version_info >= (3, 11):
507
+ import tomllib
508
+ else:
509
+ import tomli as tomllib
510
+
511
+ with open(pyproject_path, "rb") as toml_file:
512
+ pyproject_data = tomllib.load(toml_file)
513
+
514
+ # Extract project name from pyproject.toml
515
+ project_name_from_toml = pyproject_data.get("project", {}).get("name")
516
+
517
+ if project_name_from_toml:
518
+ agent_sample_id = project_name_from_toml
519
+ agent_sample_publisher = "google" # ADK samples are from Google
520
+ logging.debug(
521
+ f"Detected ADK sample from pyproject.toml: {agent_sample_id}"
522
+ )
523
+ except Exception as e:
524
+ logging.debug(f"Failed to read pyproject.toml: {e}")
525
+
526
+ return agent_sample_id, agent_sample_publisher
527
+
528
+
462
529
  def process_template(
463
530
  agent_name: str,
464
531
  template_dir: pathlib.Path,
@@ -560,13 +627,9 @@ def process_template(
560
627
  os.chdir(temp_path) # Change to temp directory
561
628
 
562
629
  # Extract agent sample info for labeling when using agent garden with remote templates
563
- agent_sample_id = None
564
- agent_sample_publisher = None
565
- if agent_garden and remote_spec and remote_spec.is_adk_samples:
566
- # For ADK samples, template_path is like "python/agents/sample-name"
567
- agent_sample_id = pathlib.Path(remote_spec.template_path).name
568
- # For ADK samples, publisher is always "google"
569
- agent_sample_publisher = "google"
630
+ agent_sample_id, agent_sample_publisher = _extract_agent_garden_labels(
631
+ agent_garden, remote_spec, remote_template_path
632
+ )
570
633
 
571
634
  # Create the cookiecutter template structure
572
635
  cookiecutter_template = temp_path / "template"
@@ -718,14 +781,14 @@ def process_template(
718
781
  / "docs"
719
782
  / "adk-cheatsheet.md"
720
783
  )
721
- with open(adk_cheatsheet_path, encoding="utf-8") as f:
722
- adk_cheatsheet_content = f.read()
784
+ with open(adk_cheatsheet_path, encoding="utf-8") as md_file:
785
+ adk_cheatsheet_content = md_file.read()
723
786
 
724
787
  llm_txt_path = (
725
788
  pathlib.Path(__file__).parent.parent.parent.parent / "llm.txt"
726
789
  )
727
- with open(llm_txt_path, encoding="utf-8") as f:
728
- llm_txt_content = f.read()
790
+ with open(llm_txt_path, encoding="utf-8") as txt_file:
791
+ llm_txt_content = txt_file.read()
729
792
 
730
793
  cookiecutter_config = {
731
794
  "project_name": project_name,
@@ -779,8 +842,8 @@ def process_template(
779
842
 
780
843
  with open(
781
844
  cookiecutter_template / "cookiecutter.json", "w", encoding="utf-8"
782
- ) as f:
783
- json.dump(cookiecutter_config, f, indent=4)
845
+ ) as json_file:
846
+ json.dump(cookiecutter_config, json_file, indent=4)
784
847
 
785
848
  logging.debug(f"Template structure created at {cookiecutter_template}")
786
849
  logging.debug(
@@ -929,8 +992,12 @@ def process_template(
929
992
  file_template_dir / "cookiecutter.json",
930
993
  "w",
931
994
  encoding="utf-8",
932
- ) as f:
933
- json.dump(cookiecutter_config, f, indent=4)
995
+ ) as config_file:
996
+ json.dump(
997
+ cookiecutter_config,
998
+ config_file,
999
+ indent=4,
1000
+ )
934
1001
 
935
1002
  # Process the file template
936
1003
  cookiecutter(
@@ -1091,13 +1158,13 @@ def process_template(
1091
1158
 
1092
1159
  # Replace cookiecutter project name with actual project name in lock file
1093
1160
  lock_file_path = final_destination / "uv.lock"
1094
- with open(lock_file_path, "r+", encoding="utf-8") as f:
1095
- content = f.read()
1096
- f.seek(0)
1097
- f.write(
1161
+ with open(lock_file_path, "r+", encoding="utf-8") as lock_file:
1162
+ content = lock_file.read()
1163
+ lock_file.seek(0)
1164
+ lock_file.write(
1098
1165
  content.replace("{{cookiecutter.project_name}}", project_name)
1099
1166
  )
1100
- f.truncate()
1167
+ lock_file.truncate()
1101
1168
  logging.debug(f"Updated project name in lock file at {lock_file_path}")
1102
1169
 
1103
1170
  except Exception as e:
@@ -163,7 +163,7 @@ from locust import HttpUser, between, task
163
163
  {%- endif %}
164
164
  {%- if cookiecutter.is_adk_a2a %}
165
165
 
166
- ENDPOINT = "/a2a/{{cookiecutter.agent_directory}}/"
166
+ ENDPOINT = "/a2a/{{cookiecutter.agent_directory}}"
167
167
  {%- elif cookiecutter.is_adk %}
168
168
 
169
169
  ENDPOINT = "/run_sse"
@@ -302,6 +302,10 @@ from a2a.server.apps import A2AFastAPIApplication
302
302
  from a2a.server.request_handlers import DefaultRequestHandler
303
303
  from a2a.server.tasks import InMemoryTaskStore
304
304
  from a2a.types import AgentCapabilities, AgentCard
305
+ from a2a.utils.constants import (
306
+ AGENT_CARD_WELL_KNOWN_PATH,
307
+ EXTENDED_AGENT_CARD_PATH,
308
+ )
305
309
  {%- endif %}
306
310
  from fastapi import FastAPI
307
311
  {%- if cookiecutter.is_adk_a2a %}
@@ -358,13 +362,15 @@ request_handler = DefaultRequestHandler(
358
362
  agent_executor=A2aAgentExecutor(runner=runner), task_store=InMemoryTaskStore()
359
363
  )
360
364
 
365
+ A2A_RPC_PATH = f"/a2a/{adk_app.name}"
366
+
361
367
 
362
368
  async def build_dynamic_agent_card() -> AgentCard:
363
369
  """Builds the Agent Card dynamically from the root_agent."""
364
370
  agent_card_builder = AgentCardBuilder(
365
371
  agent=adk_app.root_agent,
366
372
  capabilities=AgentCapabilities(streaming=True),
367
- rpc_url=f"{os.getenv('APP_URL', 'http://0.0.0.0:8000')}/a2a/{adk_app.name}/",
373
+ rpc_url=f"{os.getenv('APP_URL', 'http://0.0.0.0:8000')}{A2A_RPC_PATH}",
368
374
  agent_version=os.getenv("AGENT_VERSION", "0.1.0"),
369
375
  )
370
376
  agent_card = await agent_card_builder.build()
@@ -374,10 +380,13 @@ async def build_dynamic_agent_card() -> AgentCard:
374
380
  @asynccontextmanager
375
381
  async def lifespan(app_instance: FastAPI) -> AsyncIterator[None]:
376
382
  agent_card = await build_dynamic_agent_card()
377
- a2a_app = A2AFastAPIApplication(
378
- agent_card=agent_card, http_handler=request_handler
379
- ).build()
380
- app_instance.mount(f"/a2a/{adk_app.name}", a2a_app)
383
+ a2a_app = A2AFastAPIApplication(agent_card=agent_card, http_handler=request_handler)
384
+ a2a_app.add_routes_to_app(
385
+ app_instance,
386
+ agent_card_url=f"{A2A_RPC_PATH}{AGENT_CARD_WELL_KNOWN_PATH}",
387
+ rpc_url=A2A_RPC_PATH,
388
+ extended_agent_card_url=f"{A2A_RPC_PATH}{EXTENDED_AGENT_CARD_PATH}",
389
+ )
381
390
  yield
382
391
 
383
392
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: agent-starter-pack
3
- Version: 0.19.0
3
+ Version: 0.19.2
4
4
  Summary: CLI to bootstrap production-ready Google Cloud GenAI agent projects from templates.
5
5
  Author-email: Google LLC <agent-starter-pack@google.com>
6
6
  License: Apache-2.0
@@ -3,7 +3,7 @@ agent_starter_pack/agents/adk_a2a_base/README.md,sha256=4uIeI_TCrbdK-EzONz83SuEI
3
3
  agent_starter_pack/agents/adk_a2a_base/.template/templateconfig.yaml,sha256=x7ec9o78qFCwYCpUf_5sHHTTvCIxL3SxWSX6hsazQuo,971
4
4
  agent_starter_pack/agents/adk_a2a_base/app/__init__.py,sha256=GVTYZcCQCi2t5dxcet777hEKD_MDzQ-8n_ht7xSbXYM,617
5
5
  agent_starter_pack/agents/adk_a2a_base/app/agent.py,sha256=GWR_rxZuLlxml-1eytF_8BXlp6xPUM6Emv0u5kClMpg,2349
6
- agent_starter_pack/agents/adk_a2a_base/notebooks/adk_a2a_app_testing.ipynb,sha256=36-l686vb8U6Gav6snzVo-eOO-KEJ2m_rfBA8mUL08E,17138
6
+ agent_starter_pack/agents/adk_a2a_base/notebooks/adk_a2a_app_testing.ipynb,sha256=oMl0COo8XT5OA5DNjVSPEJ1ZUtk_PmebZD5QhC9o_Nc,17136
7
7
  agent_starter_pack/agents/adk_a2a_base/notebooks/evaluating_adk_agent.ipynb,sha256=SdZC1htgXtXw3oyi8d70dNVpDgUmV9T5hqiwGxM9plk,57034
8
8
  agent_starter_pack/agents/adk_a2a_base/tests/integration/test_agent.py,sha256=_zb3GMWMtMRq2rOyYC-uL1eNhpg2XBkm8Noj0O_UOng,1998
9
9
  agent_starter_pack/agents/adk_base/README.md,sha256=_rnoIkHupZ4afDZEAtrDZzeYSS4WqtJWnvtX2H-RrCM,894
@@ -87,7 +87,7 @@ agent_starter_pack/cli/utils/gcp.py,sha256=N6pvNU9gT6DpS7Peipfs57ckvqcUWU7OK1zdq
87
87
  agent_starter_pack/cli/utils/logging.py,sha256=61ulUY1hUrpxHDFi0szqsjPlrpxdBvwzfYEEV0o97GA,3530
88
88
  agent_starter_pack/cli/utils/register_gemini_enterprise.py,sha256=g-oDKt6DtxRx1DvhRxVDLqhLlrwfjm56zv65qjNiuXA,14570
89
89
  agent_starter_pack/cli/utils/remote_template.py,sha256=lWfC1_Vx_m4SD-wVHb8tiGfobOH1-o_eWaM1264rwGs,24128
90
- agent_starter_pack/cli/utils/template.py,sha256=dIEYlyI8AjZPcDFfiTLJrgbMdPKLQM-f1kdmxWmONKY,52528
90
+ agent_starter_pack/cli/utils/template.py,sha256=xSeebJOXVuGklPqF_3p20r7kr1PHXQLhINvYlIuTH58,55152
91
91
  agent_starter_pack/cli/utils/version.py,sha256=F4udQmzniPStqWZFIgnv3Qg3l9non4mfy2An-Oveqmc,2916
92
92
  agent_starter_pack/data_ingestion/README.md,sha256=LNxSQoJW9JozK-TbyGQLj5L_MGWNwrfLk6V6RmQ2oBQ,4032
93
93
  agent_starter_pack/data_ingestion/pyproject.toml,sha256=w2yypeMM6uA7OWHrLU3SY9NlRgltRA57_NIDyJi8Dfg,467
@@ -112,9 +112,9 @@ agent_starter_pack/deployment_targets/cloud_run/deployment/terraform/service.tf,
112
112
  agent_starter_pack/deployment_targets/cloud_run/deployment/terraform/dev/service.tf,sha256=gK8Nl8nzkaHbw9ecdp9TgeVUfS1HT68Cf_zpd_F3kXg,7165
113
113
  agent_starter_pack/deployment_targets/cloud_run/tests/integration/test_server_e2e.py,sha256=4vGhX97gluPtF7Vv31rHiQRzbYW_N31eKETUsj4Ip-Y,22589
114
114
  agent_starter_pack/deployment_targets/cloud_run/tests/load_test/README.md,sha256=_1TzCOk-tkyCsLDNs9n7PmCmvjenPtvFFWssTluukmc,5584
115
- agent_starter_pack/deployment_targets/cloud_run/tests/load_test/load_test.py,sha256=xHvlV-sjx4a2g0_Nae78OGyLAE5jt4v4Go1-gq8y_NM,9980
115
+ agent_starter_pack/deployment_targets/cloud_run/tests/load_test/load_test.py,sha256=AaKh7rpsZuD2CrxtsD5YS76iLatnfrwx-RA-pL7smRY,9979
116
116
  agent_starter_pack/deployment_targets/cloud_run/tests/load_test/.results/.placeholder,sha256=ZbWpSgDo8bT33PstD_73aQSeN_0oo0F104NMUGuZ8lE,14903
117
- agent_starter_pack/deployment_targets/cloud_run/{{cookiecutter.agent_directory}}/server.py,sha256=bmZYuChpr1fR1tmybek8JbF76_ycYhfQtrqSexlBqUQ,18950
117
+ agent_starter_pack/deployment_targets/cloud_run/{{cookiecutter.agent_directory}}/server.py,sha256=9qRo04sIj-B8a2HaBWAsZLsthxteMr_AppI5Ws6oYbQ,19239
118
118
  agent_starter_pack/frontends/adk_live_react/frontend/package-lock.json,sha256=fenwkrOYhrFnJIUN6p9soaWYRg7uUPGLsMG27D45iuI,697250
119
119
  agent_starter_pack/frontends/adk_live_react/frontend/package.json,sha256=KL24gqAKmsNf7CGe39ZqIIp2nD7rYBt4kdupO0QdK80,1137
120
120
  agent_starter_pack/frontends/adk_live_react/frontend/tsconfig.json,sha256=cyqEhf7-Yydz-PX8_cuF8JpsyC363NDTNkrmCk0sKAo,595
@@ -178,8 +178,8 @@ agent_starter_pack/utils/generate_locks.py,sha256=LwR46w25CV0_ySF_MS9W2vp7S1Nf17
178
178
  agent_starter_pack/utils/lock_utils.py,sha256=vqFHTN7lju9to74MKOmLvz80BA47G0CVkxrd1MyLWYQ,2309
179
179
  agent_starter_pack/utils/watch_and_rebuild.py,sha256=1hMn29eLpVblfvixV9FEo46u8efmnLuRIn-bPrfdW3g,6694
180
180
  llm.txt,sha256=t04sKZwOwuhQegfeayZKJufyHD_SbA3Zv_KWJYJNO5Y,15378
181
- agent_starter_pack-0.19.0.dist-info/METADATA,sha256=4lHrYhPGmOW3x0Bs6R-yg3EMyxkOs0vijljlyp-Aw3w,11422
182
- agent_starter_pack-0.19.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
183
- agent_starter_pack-0.19.0.dist-info/entry_points.txt,sha256=LO_oGmY1IdlFJRF9s7oIL3qdewC8Q9UtmTV6jWVZq3U,180
184
- agent_starter_pack-0.19.0.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
185
- agent_starter_pack-0.19.0.dist-info/RECORD,,
181
+ agent_starter_pack-0.19.2.dist-info/METADATA,sha256=avi83ORun8LdQp_KnDVf0U3mV8lXX8phr724DHMi9VI,11422
182
+ agent_starter_pack-0.19.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
183
+ agent_starter_pack-0.19.2.dist-info/entry_points.txt,sha256=LO_oGmY1IdlFJRF9s7oIL3qdewC8Q9UtmTV6jWVZq3U,180
184
+ agent_starter_pack-0.19.2.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
185
+ agent_starter_pack-0.19.2.dist-info/RECORD,,