agent-starter-pack 0.1.4__py3-none-any.whl → 0.1.5__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.1.4
3
+ Version: 0.1.5
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
@@ -29,9 +29,9 @@ agents/multimodal_live_api/tests/integration/test_server_e2e.py,sha256=D2VETDIyT
29
29
  agents/multimodal_live_api/tests/load_test/load_test.py,sha256=HHZyfC4gqiQtZVF_CbbxENGgWQccMLpwMv0IdoQ6cbQ,1275
30
30
  agents/multimodal_live_api/tests/unit/test_server.py,sha256=_TjlgQgNkjerIaBGnu8P8_KB8ZlSolDcivALpUOn_Rw,4786
31
31
  src/base_template/.gitignore,sha256=mJKTZIcVdAFiIUQicRfPNGUg6WvwcfTEC2xbmAaU34g,2579
32
- src/base_template/Makefile,sha256=PNmyhdIRf0p6eRLYqWHfCskLmuDMG673YPEeu51XLVQ,1720
33
- src/base_template/README.md,sha256=A2AsGhPVfbMTjiPnuuEui7V8UVWa7hE5m0zut--QbbU,8196
34
- src/base_template/pyproject.toml,sha256=Pv4nC4uh_9_sGA90Tom0ITJUAbGolhseCA9-AOaEIpY,2799
32
+ src/base_template/Makefile,sha256=e2NsR1SLXZJjDcNFo1dRcoQCAoz7NHJap1OS82jIclY,2555
33
+ src/base_template/README.md,sha256=gXEXkrnU06x-x2PpeCyfPPly8xXTiCqwsrdmSqPPPx8,8602
34
+ src/base_template/pyproject.toml,sha256=JpwwlTf8PYgp68HlHDsu3arWoHdryUm7iex19H5fHyc,2797
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,7 +57,7 @@ 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=vNEV1Fdl1BhJAFbKHcN3MN1v7dPRUcAgXMnB3uCnlI0,1591
60
- src/cli/commands/create.py,sha256=38wc5DjUOelLtmCnkVLIq9aVc6c1EK10O0fd-refh6I,18963
60
+ src/cli/commands/create.py,sha256=e4366_oC4NQSDMLnB2sB-G1oHDuHz3_0m9sDW7z5y1Q,20338
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=nrb46lJ3bR_yVJRlUPsBN-To4v-xo5qO5WmnIi6qcYM,27076
@@ -127,32 +127,32 @@ src/frontends/live_api_react/frontend/src/utils/store-logger.ts,sha256=YxS0TjiGn
127
127
  src/frontends/live_api_react/frontend/src/utils/utils.ts,sha256=qQIhLzfyCBLecU0ksQCKIbD3cIflb0hxt0SPZGdYFEo,2457
128
128
  src/frontends/live_api_react/frontend/src/utils/worklets/audio-processing.ts,sha256=ULgnXphZUfbHkRhGoPT_670WHjzaXJwWgYU0ISQRSXI,1979
129
129
  src/frontends/live_api_react/frontend/src/utils/worklets/vol-meter.ts,sha256=DEXn9ywn7N_tqKBhQ9eUxvWCWqteyfT-Q0dwjbvjjpY,1780
130
- src/frontends/streamlit/frontend/side_bar.py,sha256=HWMu8TRz7GZUMIoppUdAGO57IvhzTbO-P8HJLFIhTtc,8827
130
+ src/frontends/streamlit/frontend/side_bar.py,sha256=kZOTtHhr-BvzqD_pRN3h2Xu4HfFH2dcAO6XOSMBPnsA,9013
131
131
  src/frontends/streamlit/frontend/streamlit_app.py,sha256=O-mF9-0nSL220mZSohKK6QrdSiaRsUJL1o_XeKdj8zo,9868
132
132
  src/frontends/streamlit/frontend/style/app_markdown.py,sha256=4H9GGlaOIbG_4T4QvHyTMfoeumJze7cZ2VuGIv39wFo,1050
133
133
  src/frontends/streamlit/frontend/utils/chat_utils.py,sha256=Z0OYQu-14_d9tDmH9Z4Vvi8xpSUEm9vuPZ8wmFgl4sQ,2262
134
134
  src/frontends/streamlit/frontend/utils/local_chat_history.py,sha256=9wc8L8j4tk10DBPQdV64kdZvqE1fHxC2esK8szid0l8,4741
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
- src/frontends/streamlit/frontend/utils/stream_handler.py,sha256=PZxffzmJqj_u_5DDx8TFuXFl9C756-oK_m6VAhlo4rg,11971
137
+ src/frontends/streamlit/frontend/utils/stream_handler.py,sha256=afw-CnLx1LAsZWrQIivA0l2JVamlo2Ez88QoL5mFsN4,12091
138
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/containers/e2e-tests/Dockerfile,sha256=Q_aTyX_iaFY8j06XZkpMuggJnNO5daiLmmrvqaZHMxw,1611
141
- src/resources/locks/uv-agentic_rag_vertexai_search-agent_engine.lock,sha256=6muWlgt4dduqGDiGUvTg-d2zzY5rgW9zP9DbDnt3krc,474353
142
- src/resources/locks/uv-agentic_rag_vertexai_search-cloud_run.lock,sha256=ViUzp35RGWZiiQvvVi6ntFTT-bEbHg4_HDDQznD4ML8,756574
143
- src/resources/locks/uv-crewai_coding_crew-agent_engine.lock,sha256=TOICJcW3ajjycUfK-bzY6hEZaMRiGf521z1e9n0BwQI,568962
144
- src/resources/locks/uv-crewai_coding_crew-cloud_run.lock,sha256=FUwOcG2_RzxKvKHSxA833EXkVC4P8geVYH-3GWI2QXI,878413
145
- src/resources/locks/uv-langgraph_base_react-agent_engine.lock,sha256=DihpnjNFvnfPP9k-YmQVpEHWbE0Zx-aYbiqjZNi0LU0,469496
146
- src/resources/locks/uv-langgraph_base_react-cloud_run.lock,sha256=nMsiSn0weaVWrMxrH8-SnNtuKAEe3byvMOjrQ-UcS4I,751717
147
- src/resources/locks/uv-multimodal_live_api-cloud_run.lock,sha256=gLLVXP01wVom5fnvpFoYmue6Ynx3qiFbb1FOfDDQy34,751312
141
+ src/resources/locks/uv-agentic_rag_vertexai_search-agent_engine.lock,sha256=G_RE_Qwt2eb9qoaWngVh1VMmeU85Sp3viF5DAaVDixQ,598272
142
+ src/resources/locks/uv-agentic_rag_vertexai_search-cloud_run.lock,sha256=7_J9EJLrNqYxq274H9cCMLN8ENTmSKgVUziyvesD5UE,751772
143
+ src/resources/locks/uv-crewai_coding_crew-agent_engine.lock,sha256=b1WmObO8ClSTUGoXMS8u3R4V22-TN4UBAu-573mECT8,713850
144
+ src/resources/locks/uv-crewai_coding_crew-cloud_run.lock,sha256=JrYcrsUngizvPGDCyjmkhVoo41E7QYV-jLyeLTLWgTU,880790
145
+ src/resources/locks/uv-langgraph_base_react-agent_engine.lock,sha256=xkO_5lKi7rH5IevTeXynxxOTTtWJslTBXFpPN7m2YwQ,593415
146
+ src/resources/locks/uv-langgraph_base_react-cloud_run.lock,sha256=7WFFXeWYvr2FhJGhd9S_ezjW91ZwPIC2Kh-oy5gbr_Q,746915
147
+ src/resources/locks/uv-multimodal_live_api-cloud_run.lock,sha256=_MRLUX5DQUlH6vDdaBQAj430i-OVUbtoDfmVMmHK48k,746510
148
148
  src/resources/setup_cicd/cicd_variables.tf,sha256=OHNKglkpN2TSTnfgpd-fM-eNUbWhs6grNwBIKHoLyfU,1097
149
149
  src/resources/setup_cicd/github.tf,sha256=g7gMQqPZI69XteCSruNfiT00GBGawuXANHj-F0fc-GE,2727
150
150
  src/resources/setup_cicd/providers.tf,sha256=Km4z6IJt7x7PLaa0kyZbBrO2m3lpuIJZFD5jB7QBfF0,1122
151
151
  src/utils/generate_locks.py,sha256=xu5IAhGGBPkVQGSJX4kk7_JNDwWJUEaXAHbmaQIohbg,4386
152
152
  src/utils/lock_utils.py,sha256=_QdzQtgIbCmJ87s046_i1g966slVNmvr3bJDeHbRQSM,2419
153
153
  src/utils/watch_and_rebuild.py,sha256=IdbTLReYknTXXu5KWPz3sc7Zg5HTEMS5UVlMSnuhs5E,6067
154
- agent_starter_pack-0.1.4.dist-info/METADATA,sha256=fp6UjfA1O-M8Mo_vN41tSmjPxTYseeun5WOi5OzYI74,7701
155
- agent_starter_pack-0.1.4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
156
- agent_starter_pack-0.1.4.dist-info/entry_points.txt,sha256=U7uCxR7YulIhZ0L8R8Hui0Bsy6J7oyESBeDYJYMrQjA,56
157
- agent_starter_pack-0.1.4.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
158
- agent_starter_pack-0.1.4.dist-info/RECORD,,
154
+ agent_starter_pack-0.1.5.dist-info/METADATA,sha256=lhkhYJnZ84HD-Xm2G2VJDJIOptv0otO2_qbsxTqf4K4,7701
155
+ agent_starter_pack-0.1.5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
156
+ agent_starter_pack-0.1.5.dist-info/entry_points.txt,sha256=U7uCxR7YulIhZ0L8R8Hui0Bsy6J7oyESBeDYJYMrQjA,56
157
+ agent_starter_pack-0.1.5.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
158
+ agent_starter_pack-0.1.5.dist-info/RECORD,,
@@ -31,6 +31,24 @@ ui:
31
31
  {%- endif %}
32
32
  {%- endif %}
33
33
 
34
+ setup-dev-env:
35
+ @if [ -z "$$PROJECT_ID" ]; then echo "Error: PROJECT_ID environment variable is not set"; exit 1; fi
36
+ (cd deployment/terraform/dev && terraform init && terraform apply --var-file vars/env.tfvars --var dev_project_id=$$PROJECT_ID --auto-approve)
37
+
38
+ {%- if cookiecutter.data_ingestion%}
39
+ data-ingestion:
40
+ @if [ -z "$$PROJECT_ID" ]; then echo "Error: PROJECT_ID environment variable is not set"; exit 1; fi
41
+ $(MAKE) install
42
+ (cd data_ingestion && uv run data_ingestion_pipeline/submit_pipeline.py \
43
+ --project-id=$$PROJECT_ID \
44
+ --data-store-id="sample-datastore" \
45
+ --region="us-central1" \
46
+ --data-store-region="us" \
47
+ --service-account="vertexai-pipelines-sa@$$PROJECT_ID.iam.gserviceaccount.com" \
48
+ --pipeline-root="gs://$$PROJECT_ID-pipeline-artifacts" \
49
+ --pipeline-name="data-ingestion-pipeline")
50
+ {%- endif %}
51
+
34
52
  lint:
35
53
  uv run codespell
36
54
  uv run ruff check . --diff
@@ -113,6 +113,15 @@ For full command options and usage, refer to the [Makefile](Makefile).
113
113
  3. **Interact with the Agent**
114
114
  Once both the backend and frontend are running, click the play button in the frontend UI to establish a connection with the backend. You can now interact with the Multimodal Live Agent! You can try asking questions such as "Using the tool you have, define Governance in the context MLOPs" to allow the agent to use the documentation it was provided to.
115
115
 
116
+ **Remote access**:
117
+ Use [Cloud Run proxy](https://cloud.google.com/sdk/gcloud/reference/run/services/proxy) for local access. The backend will be accessible at `http://localhost:8000`:
118
+
119
+ ```bash
120
+ gcloud run services proxy genai-app-sample --port 8000 --project $PROJECT_ID --region $REGION
121
+ ```
122
+
123
+ You can then use the same frontend setup described above to interact with your Cloud Run deployment.
124
+
116
125
  <details>
117
126
  <summary><b>Cloud Shell usage</b></summary>
118
127
 
@@ -22,9 +22,9 @@ dependencies = [
22
22
  {%- endif %}
23
23
  ]
24
24
  {% if cookiecutter.deployment_target == 'cloud_run' %}
25
- requires-python = ">=3.10,<=3.13"
25
+ requires-python = ">=3.10,<3.14"
26
26
  {% elif cookiecutter.deployment_target == 'agent_engine' %}
27
- requires-python = ">=3.10,<=3.11"
27
+ requires-python = ">=3.10,<3.13"
28
28
  {%- endif %}
29
29
 
30
30
  [dependency-groups]
@@ -163,11 +163,12 @@ def create(
163
163
  # GCP Setup
164
164
  logging.debug("Setting up GCP...")
165
165
 
166
+ creds_info = {}
166
167
  # Check for uv installation if not skipping checks
167
168
  if not skip_checks:
168
169
  # Set up GCP environment
169
170
  try:
170
- setup_gcp_environment(
171
+ creds_info = setup_gcp_environment(
171
172
  auto_approve=auto_approve,
172
173
  skip_checks=skip_checks,
173
174
  region=region,
@@ -211,17 +212,29 @@ def create(
211
212
  )
212
213
 
213
214
  project_path = destination_dir / project_name
214
- console.print("\n> 👍 Done. Execute the following command to get started:")
215
- if output_dir:
216
- # If output_dir was specified, use the absolute path
217
- console.print(
218
- f"[bold bright_green]cd {project_path} && make install && make playground[/]"
219
- )
220
- else:
221
- # If no output_dir specified, just use project name
215
+ # Determine the correct path to display to the user
216
+ display_path = str(project_path) if output_dir else project_name
217
+
218
+ if include_data_ingestion:
219
+ project_id = creds_info.get("project", "")
222
220
  console.print(
223
- f"[bold bright_green]cd {project_name} && make install && make playground[/]"
221
+ f"\n[bold white]===== DATA INGESTION SETUP =====[/bold white]\n"
222
+ f"This agent uses a datastore for grounded responses.\n"
223
+ f"The agent will work without data, but for optimal results:\n"
224
+ f"1. Set up dev environment:\n"
225
+ f" [white italic]`export PROJECT_ID={project_id} && cd {display_path} && make setup-dev-env`[/white italic]\n\n"
226
+ f" See deployment/README.md for more info\n"
227
+ f"2. Run the data ingestion pipeline:\n"
228
+ f" [white italic]`export PROJECT_ID={project_id} && cd {display_path} && make data-ingestion`[/white italic]\n\n"
229
+ f" See data_ingestion/README.md for more info\n"
230
+ f"[bold white]=================================[/bold white]\n"
224
231
  )
232
+ console.print("\n> 👍 Done. Execute the following command to get started:")
233
+
234
+ # Show the command to get started
235
+ console.print(
236
+ f"[bold bright_green]cd {display_path} && make install && make playground[/]"
237
+ )
225
238
 
226
239
  # Replace region in all files if a different region was specified
227
240
  if region != "us-central1":
@@ -473,7 +486,16 @@ def replace_region_in_files(
473
486
  )
474
487
 
475
488
  # Define allowed file extensions
476
- allowed_extensions = {".md", ".py", ".tfvars", ".yaml", ".tf", ".yml"}
489
+ allowed_extensions = {
490
+ ".md",
491
+ ".py",
492
+ ".tfvars",
493
+ ".yaml",
494
+ ".tf",
495
+ ".yml",
496
+ "Makefile",
497
+ "makefile",
498
+ }
477
499
 
478
500
  # Skip directories that shouldn't be modified
479
501
  skip_dirs = {".git", "__pycache__", "venv", ".venv", "node_modules"}
@@ -491,7 +513,10 @@ def replace_region_in_files(
491
513
  if (
492
514
  file_path.is_dir()
493
515
  or any(skip_dir in file_path.parts for skip_dir in skip_dirs)
494
- or file_path.suffix not in allowed_extensions
516
+ or (
517
+ file_path.suffix not in allowed_extensions
518
+ and file_path.name not in allowed_extensions
519
+ )
495
520
  ):
496
521
  continue
497
522
 
@@ -522,6 +547,13 @@ def replace_region_in_files(
522
547
  'data_store_region="us"', f'data_store_region="{data_store_region}"'
523
548
  )
524
549
  modified = True
550
+ elif 'data-store-region="us"' in content:
551
+ if debug:
552
+ logging.debug(f"Replacing data-store-region in {file_path}")
553
+ content = content.replace(
554
+ 'data-store-region="us"', f'data-store-region="{data_store_region}"'
555
+ )
556
+ modified = True
525
557
  elif "_DATA_STORE_REGION: us" in content:
526
558
  if debug:
527
559
  logging.debug(f"Replacing _DATA_STORE_REGION in {file_path}")
@@ -56,10 +56,11 @@ class SideBar:
56
56
  )
57
57
  use_agent_path = self.st.selectbox(
58
58
  "Select Agent Type",
59
- ["Local Agent", "Remote Engine ID", "Remote URL"],
59
+ ["Local Agent", "Remote Agent Engine ID", "Remote URL"],
60
60
  index=["Local Agent", "Remote Engine ID", "Remote URL"].index(
61
61
  default_agent_type
62
62
  ),
63
+ help="'Local Agent' uses a local implementation, 'Remote Agent Engine ID' connects to a deployed Vertex AI agent, and 'Remote URL' connects to a custom endpoint.",
63
64
  )
64
65
 
65
66
  if use_agent_path == "Local Agent":
@@ -32,6 +32,8 @@ from vertexai.preview import reasoning_engines
32
32
 
33
33
  from frontend.utils.multimodal_utils import format_content
34
34
 
35
+ st.cache_resource.clear()
36
+
35
37
 
36
38
  @st.cache_resource
37
39
  def get_remote_agent(remote_agent_engine_id: str) -> Any:
@@ -65,6 +67,16 @@ def get_remote_url_config(url: str, authenticate_request: bool) -> dict[str, Any
65
67
  }
66
68
 
67
69
 
70
+ @st.cache_resource()
71
+ def get_local_agent(agent_callable_path: str) -> Any:
72
+ """Get cached local agent instance."""
73
+ module_path, class_name = agent_callable_path.rsplit(".", 1)
74
+ module = importlib.import_module(module_path)
75
+ agent = getattr(module, class_name)()
76
+ agent.set_up()
77
+ return agent
78
+
79
+
68
80
  class Client:
69
81
  """A client for streaming events from a server."""
70
82
 
@@ -94,14 +106,10 @@ class Client:
94
106
  self.agent = get_remote_agent(remote_agent_engine_id)
95
107
  self.url = None
96
108
  else:
97
- # Force reload all submodules to get latest changes
98
109
  self.url = None
99
110
  if agent_callable_path is None:
100
111
  raise ValueError("agent_callable_path cannot be None")
101
- module_path, class_name = agent_callable_path.rsplit(".", 1)
102
- module = importlib.import_module(module_path)
103
- self.agent = getattr(module, class_name)()
104
- self.agent.set_up()
112
+ self.agent = get_local_agent(agent_callable_path)
105
113
 
106
114
  def log_feedback(self, feedback_dict: dict[str, Any], run_id: str) -> None:
107
115
  """Log user feedback for a specific run."""