agent-starter-pack 0.0.6b0__py3-none-any.whl → 0.0.8b0__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.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: agent-starter-pack
3
- Version: 0.0.6b0
3
+ Version: 0.0.8b0
4
4
  Summary: CLI tool to create GCP-based AI agent projects from templates
5
5
  Author-email: Google LLC <agent-starter-pack@google.com>
6
6
  License: Apache-2.0
@@ -143,3 +143,7 @@ Thank you for your contributions!
143
143
  ## Disclaimer
144
144
 
145
145
  This repository is for demonstrative purposes only and is not an officially supported Google product.
146
+
147
+ ## Terms of Service
148
+
149
+ The agent-starter-pack templating CLI and the templates in this starter pack leverage Google Cloud APIs. When you use this starter pack, you'll be deploying resources in your own Google Cloud project and will be responsible for those resources. Please review the [Google Cloud Service Terms](https://cloud.google.com/terms/service-terms) for details on the terms of service associated with these APIs.
@@ -31,7 +31,7 @@ agents/multimodal_live_api/tests/unit/test_server.py,sha256=_TjlgQgNkjerIaBGnu8P
31
31
  src/base_template/.gitignore,sha256=mJKTZIcVdAFiIUQicRfPNGUg6WvwcfTEC2xbmAaU34g,2579
32
32
  src/base_template/Makefile,sha256=YQXymaikoFP3r7MN1EiNbQv8VZKjrVzeRoksIPHNX0E,1568
33
33
  src/base_template/README.md,sha256=LS07ZhCLj2SXew3j3xEWaaXwsf3aIjyvQpkp0S0l8nA,4194
34
- src/base_template/pyproject.toml,sha256=Yyk30u_QBtwHmFaEC40PyJe3Smt6snzSZxd5usoO9tA,2777
34
+ src/base_template/pyproject.toml,sha256=Pv4nC4uh_9_sGA90Tom0ITJUAbGolhseCA9-AOaEIpY,2799
35
35
  src/base_template/app/utils/tracing.py,sha256=ovp6tgwgo_tqibpbhhHl8cWIqqUWVYfV0AL7XPDEPpM,5661
36
36
  src/base_template/app/utils/typing.py,sha256=UUFm74qiKGtT8pLuE_3yRpcmntRCt91wH_Q-LKdjQuQ,3194
37
37
  src/base_template/deployment/README.md,sha256=8AorSeF2Aj0kvPmuQLFrmAAUWVbdTzg0S-rVBbfdirQ,4835
@@ -57,11 +57,11 @@ src/base_template/deployment/terraform/dev/vars/env.tfvars,sha256=xz5cYG29ZIgqM1
57
57
  src/base_template/deployment/terraform/vars/env.tfvars,sha256=2dxWRDzeolN2f7eKSHXcBiBt9fRcIMO6VH-2MAZevLQ,1633
58
58
  src/base_template/tests/unit/test_utils/test_tracing_exporter.py,sha256=JAb0vIB7wNFPm_kaDaHcxtPKNReypDHjdsMQyzpuePQ,4687
59
59
  src/cli/main.py,sha256=134KpcOQlexr_vR-KT3D3B1jKh1Y6S3qHGJ-9uD9Kkg,950
60
- src/cli/commands/create.py,sha256=oupbVv8zfMho4JowBCvgr0YpS2I7mYWCDR3We8VxqjI,18497
60
+ src/cli/commands/create.py,sha256=8ELvElRExVa1KqDNhGINvui_xRyKKFJaSLtylbmX9pc,19421
61
61
  src/cli/commands/setup_cicd.py,sha256=EgVkDdA94npDHHPTuYDmWNIiRscnsXtN7CbTuelrTVU,28347
62
62
  src/cli/utils/__init__.py,sha256=x-k6jfcv68_zYS88LrA1mr0yB5y5SekJ0nc5Tvt6iDA,1064
63
63
  src/cli/utils/cicd.py,sha256=x-8PKp4aevkUwAmtbEZVwu0UlrA6ifXGbouxICu1D0o,25664
64
- src/cli/utils/gcp.py,sha256=nZP9wBfzJXuATbX-e8gVY9FyF23b3q-bXFosgkW3eBU,4128
64
+ src/cli/utils/gcp.py,sha256=f-XTq9AN2_KrCR8pf_gSPOng8KrvtFlNP2Ok9VtTk_Q,4118
65
65
  src/cli/utils/logging.py,sha256=0lHe4EPi1A8sOx9xkA7gS4UNl0GsIyp2ahydkkuCzLY,1570
66
66
  src/cli/utils/template.py,sha256=p7uKv5yHkXIOWo8EJJ0IjUh57lOSDL7kYHA9OZ7j-z4,25447
67
67
  src/data_ingestion/README.md,sha256=QlomTIZINvZxf2ftCkm2_QVozlivJqAfFKyfiGMZDpY,4217
@@ -135,7 +135,7 @@ src/frontends/streamlit/frontend/utils/local_chat_history.py,sha256=9wc8L8j4tk10
135
135
  src/frontends/streamlit/frontend/utils/message_editing.py,sha256=YWoPe2KeWMuL3YVTm0am6MK3kzjEIYVmdkdwTQpmGdQ,2263
136
136
  src/frontends/streamlit/frontend/utils/multimodal_utils.py,sha256=v6YbCkz_YcnEo-9YvRjwBNt0SzU4M39bYxJGmKk69vE,7313
137
137
  src/frontends/streamlit/frontend/utils/stream_handler.py,sha256=J7MMsOR2GvDEsyJbsv8VQeZbMs7mNySrclZNfuzsZD4,11578
138
- src/frontends/streamlit/frontend/utils/title_summary.py,sha256=8yaatgn86wwzc9wXY83tubUxxC-Cu-8LY9O5xo3IaJA,2526
138
+ src/frontends/streamlit/frontend/utils/title_summary.py,sha256=B0cadS_KPW-tsbABauI4J681aqjEtuKFDa25e9R1WKc,3030
139
139
  src/resources/containers/data_processing/Dockerfile,sha256=uXjqDiSrr7YpoX-vtzaIJIVXZ2qeUpu1Nzju9qWZ9oI,859
140
140
  src/resources/locks/uv-agentic_rag_vertexai_search-agent_engine.lock,sha256=6muWlgt4dduqGDiGUvTg-d2zzY5rgW9zP9DbDnt3krc,474353
141
141
  src/resources/locks/uv-agentic_rag_vertexai_search-cloud_run.lock,sha256=ViUzp35RGWZiiQvvVi6ntFTT-bEbHg4_HDDQznD4ML8,756574
@@ -150,8 +150,8 @@ src/resources/setup_cicd/providers.tf,sha256=Km4z6IJt7x7PLaa0kyZbBrO2m3lpuIJZFD5
150
150
  src/utils/generate_locks.py,sha256=xu5IAhGGBPkVQGSJX4kk7_JNDwWJUEaXAHbmaQIohbg,4386
151
151
  src/utils/lock_utils.py,sha256=plw3vWkRViCMxBK3IrLRHtF_I0kbbP043T9KIYxcb20,2423
152
152
  src/utils/watch_and_rebuild.py,sha256=IdbTLReYknTXXu5KWPz3sc7Zg5HTEMS5UVlMSnuhs5E,6067
153
- agent_starter_pack-0.0.6b0.dist-info/METADATA,sha256=yYnMdi49WWJ3JG27GPtJmM1oU08-QScuGDxF_R5u4iY,6805
154
- agent_starter_pack-0.0.6b0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
155
- agent_starter_pack-0.0.6b0.dist-info/entry_points.txt,sha256=U7uCxR7YulIhZ0L8R8Hui0Bsy6J7oyESBeDYJYMrQjA,56
156
- agent_starter_pack-0.0.6b0.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
157
- agent_starter_pack-0.0.6b0.dist-info/RECORD,,
153
+ agent_starter_pack-0.0.8b0.dist-info/METADATA,sha256=aA8BBrtZBbPQuI9aeP6GEb7XSJT6Go8gR2FS5aIp0ns,7229
154
+ agent_starter_pack-0.0.8b0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
155
+ agent_starter_pack-0.0.8b0.dist-info/entry_points.txt,sha256=U7uCxR7YulIhZ0L8R8Hui0Bsy6J7oyESBeDYJYMrQjA,56
156
+ agent_starter_pack-0.0.8b0.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
157
+ agent_starter_pack-0.0.8b0.dist-info/RECORD,,
@@ -96,9 +96,9 @@ exclude = [".venv"]
96
96
  [tool.codespell]
97
97
  ignore-words-list = "rouge"
98
98
  {% if cookiecutter.agent_name == 'multimodal_live_api' %}
99
- skip = "./locust_env/*,uv.lock,.venv,./frontend"
99
+ skip = "./locust_env/*,uv.lock,.venv,./frontend,**/*.ipynb"
100
100
  {% else %}
101
- skip = "./locust_env/*,uv.lock,.venv"
101
+ skip = "./locust_env/*,uv.lock,.venv,**/*.ipynb"
102
102
  {%- endif %}
103
103
 
104
104
  [build-system]
@@ -330,16 +330,20 @@ def setup_gcp_environment(
330
330
  if debug:
331
331
  logging.debug("Verifying GCP credentials...")
332
332
  creds_info = verify_credentials()
333
-
334
333
  # Handle credential verification and project selection
335
334
  if not auto_approve:
336
335
  creds_info = _handle_credential_verification(creds_info)
336
+ # If user chose to skip verification, don't test Vertex AI connection
337
+ if creds_info.get("skip_vertex_test", False):
338
+ console.print("> Skipping Vertex AI connection test", style="yellow")
339
+ else:
340
+ # Test Vertex AI connection
341
+ _test_vertex_ai_connection(creds_info["project"], region)
337
342
  else:
338
343
  # Even with auto_approve, we should still set the GCP project
339
344
  set_gcp_project(creds_info["project"], set_quota_project=True)
340
-
341
- # Test Vertex AI connection
342
- _test_vertex_ai_connection(creds_info["project"], region)
345
+ # Test Vertex AI connection
346
+ _test_vertex_ai_connection(creds_info["project"], region)
343
347
 
344
348
  return creds_info
345
349
 
@@ -365,17 +369,23 @@ def _handle_credential_verification(creds_info: dict) -> dict:
365
369
  set_gcp_project(creds_info["project"], set_quota_project=False)
366
370
  return creds_info
367
371
 
368
- # Ask user if current credentials are correct
369
- change_creds = (
370
- Prompt.ask(
371
- f"\n> You are logged in with account '{creds_info['account']}' "
372
- f"and using project '{creds_info['project']}'. "
373
- "Is this correct?",
374
- choices=["Y", "n"],
375
- default="Y",
376
- ).lower()
377
- == "n"
378
- )
372
+ # Ask user if current credentials are correct or if they want to skip
373
+ console.print(f"\n> You are logged in with account: '{creds_info['account']}'")
374
+ console.print(f"> You are using project: '{creds_info['project']}'")
375
+
376
+ choices = ["Y", "skip", "edit"]
377
+ response = Prompt.ask(
378
+ "> Do you want to continue? (The CLI will check if Vertex AI is enabled in this project)",
379
+ choices=choices,
380
+ default="Y",
381
+ ).lower()
382
+
383
+ if response == "skip":
384
+ console.print("> Skipping credential verification", style="yellow")
385
+ creds_info["skip_vertex_test"] = True
386
+ return creds_info
387
+
388
+ change_creds = response == "edit"
379
389
 
380
390
  if change_creds:
381
391
  # Handle credential change
@@ -387,18 +397,23 @@ def _handle_credential_verification(creds_info: dict) -> dict:
387
397
  creds_info = verify_credentials()
388
398
 
389
399
  # Prompt for project change
390
- change_project = (
391
- Prompt.ask(
392
- f"\n> You are now logged in with account '{creds_info['account']}'. "
393
- f"Current project is '{creds_info['project']}'. "
394
- "Is this correct?",
395
- choices=["y", "n"],
396
- default="y",
397
- ).lower()
398
- == "n"
400
+ console.print(
401
+ f"\n> You are now logged in with account: '{creds_info['account']}'."
399
402
  )
403
+ console.print(f"> Current project is: '{creds_info['project']}'.")
404
+ choices = ["y", "skip", "edit"]
405
+ response = Prompt.ask(
406
+ "> Do you want to continue? (The CLI will verify Vertex AI access in this project)",
407
+ choices=choices,
408
+ default="y",
409
+ ).lower()
410
+
411
+ if response == "skip":
412
+ console.print("> Skipping project verification", style="yellow")
413
+ creds_info["skip_vertex_test"] = True
414
+ return creds_info
400
415
 
401
- if change_project:
416
+ if response == "edit":
402
417
  # Prompt for new project ID
403
418
  new_project = Prompt.ask("\n> Enter the new project ID")
404
419
  creds_info["project"] = new_project
src/cli/utils/gcp.py CHANGED
@@ -69,7 +69,7 @@ def verify_vertex_connection(
69
69
  client.count_tokens(request=request)
70
70
 
71
71
 
72
- def verify_credentials() -> dict[str, str]:
72
+ def verify_credentials() -> dict:
73
73
  """Verify GCP credentials and return current project and account."""
74
74
  try:
75
75
  # Get credentials and project
@@ -12,22 +12,15 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
- import google.auth
15
+ # mypy: disable-error-code="assignment"
16
16
  import os
17
+ from typing import Any
17
18
 
19
+ import google.auth
20
+ from langchain_core.messages import AIMessage
18
21
  from langchain_core.prompts import ChatPromptTemplate, MessagesPlaceholder
19
22
  from langchain_google_vertexai import ChatVertexAI
20
23
 
21
- # Get default project from credentials
22
- _, project_id = google.auth.default()
23
-
24
- llm = ChatVertexAI(
25
- model_name="gemini-2.0-flash-001",
26
- temperature=0,
27
- project=project_id,
28
- location=os.getenv("LOCATION", "us-central1"),
29
- )
30
-
31
24
  title_template = ChatPromptTemplate.from_messages(
32
25
  [
33
26
  (
@@ -78,5 +71,24 @@ If there's not enough context in the conversation to create a meaningful title,
78
71
  MessagesPlaceholder(variable_name="messages"),
79
72
  ]
80
73
  )
81
-
82
- chain_title = title_template | llm
74
+ try:
75
+ # Initialize Vertex AI with default project credentials
76
+ _, project_id = google.auth.default()
77
+
78
+ llm = ChatVertexAI(
79
+ model_name="gemini-2.0-flash-001",
80
+ temperature=0,
81
+ project=project_id,
82
+ location=os.getenv("LOCATION", "us-central1"),
83
+ )
84
+ chain_title = title_template | llm
85
+
86
+ except Exception:
87
+ # Fallback to a simple title generator when Vertex AI is unavailable
88
+ print("WARNING: Failed to initialize Vertex AI. Using dummy LLM instead.")
89
+
90
+ class DummyChain:
91
+ def invoke(*args: Any, **kwargs: Any) -> AIMessage:
92
+ return AIMessage(content="conversation")
93
+
94
+ chain_title = DummyChain()