agent-starter-pack 0.4.1__py3-none-any.whl → 0.4.3__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.
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: agent-starter-pack
3
- Version: 0.4.1
4
- Summary: CLI tool to create GCP-based AI agent projects from templates
3
+ Version: 0.4.3
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
7
7
  License-File: LICENSE
@@ -38,7 +38,7 @@ Description-Content-Type: text/markdown
38
38
  alt="Try in Firebase Studio"
39
39
  src="https://cdn.firebasestudio.dev/btn/try_blue_20.svg">
40
40
  </picture>
41
- </a> ![Stars](https://img.shields.io/github/stars/GoogleCloudPlatform/agent-starter-pack?color=yellow)
41
+ </a> [![Launch in Cloud Shell](https://img.shields.io/badge/Launch-in_Cloud_Shell-white)](https://shell.cloud.google.com/cloudshell/editor?cloudshell_git_repo=https%3A%2F%2Fgithub.com%2Feliasecchig%2Fasp-open-in-cloud-shell&cloudshell_print=open-in-cs) ![Stars](https://img.shields.io/github/stars/GoogleCloudPlatform/agent-starter-pack?color=yellow)
42
42
 
43
43
 
44
44
  The `agent-starter-pack` is a collection of production-ready Generative AI Agent templates built for Google Cloud. <br>
@@ -66,7 +66,7 @@ agent-starter-pack create my-awesome-agent
66
66
  ```
67
67
 
68
68
  **That's it!** You now have a fully functional agent project—complete with backend, frontend, and deployment infrastructure—ready for you to explore and customize.
69
- For more installation options, see the [Installation Guide](https://googlecloudplatform.github.io/agent-starter-pack/guide/installation). You can also [try it in Firebase Studio](https://studio.firebase.google.com/new?template=https%3A%2F%2Fgithub.com%2FGoogleCloudPlatform%2Fagent-starter-pack%2Ftree%2Fmain%2Fsrc%2Fresources%2Fidx) with zero setup.
69
+ See [Installation Guide](https://googlecloudplatform.github.io/agent-starter-pack/guide/installation) for more options, or try with zero setup in [Firebase Studio](https://studio.firebase.google.com/new?template=https%3A%2F%2Fgithub.com%2FGoogleCloudPlatform%2Fagent-starter-pack%2Ftree%2Fmain%2Fsrc%2Fresources%2Fidx) or [Cloud Shell](https://shell.cloud.google.com/cloudshell/editor?cloudshell_git_repo=https%3A%2F%2Fgithub.com%2Feliasecchig%2Fasp-open-in-cloud-shell&cloudshell_print=open-in-cs).
70
70
 
71
71
  ---
72
72
 
@@ -129,13 +129,12 @@ Visit our [documentation site](https://googlecloudplatform.github.io/agent-start
129
129
 
130
130
  ### Video Walkthrough:
131
131
 
132
- ## Video Tutorials
132
+ - **[Exploring the Agent Starter Pack](https://www.youtube.com/watch?v=9zqwym-N3lg)**: A comprehensive tutorial demonstrating how to rapidly deploy AI Agents using the Agent Starter Pack, covering architecture, templates, and step-by-step deployment.
133
133
 
134
- - **April 2024**: A [6-minute introduction video](https://www.youtube.com/live/eZ-8UQ_t4YM?feature=shared&t=2791) Explaining the Agent Starter Pack and demonstrating its key features. Part of the Kaggle GenAI intensive course.
135
- - **March 6, 2025**: A [120 Minute livestream video demo](https://www.youtube.com/watch?v=yIRIT_EtALs&t=235s) of the new `agent-starter-pack` were we build 3 Agents under 30 minutes!
136
- - **Oct 29, 2024**: A [20-Minute Video Walkthrough](https://youtu.be/kwRG7cnqSu0) is available, showcasing the previous `agent-starter-pack`.
134
+ - **[6-minute introduction](https://www.youtube.com/live/eZ-8UQ_t4YM?feature=shared&t=2791)** (April 2024): Explaining the Agent Starter Pack and demonstrating its key features. Part of the Kaggle GenAI intensive course.
135
+
136
+ - **[120-minute livestream demo](https://www.youtube.com/watch?v=yIRIT_EtALs&t=235s)** (March 6, 2025): Watch us build 3 Agents in under 30 minutes using the `agent-starter-pack`!
137
137
 
138
- ## Explore More Generative AI Resources
139
138
 
140
139
  Looking for more examples and resources for Generative AI on Google Cloud? Check out the [GoogleCloudPlatform/generative-ai](https://github.com/GoogleCloudPlatform/generative-ai) repository for notebooks, code samples, and more!
141
140
 
@@ -26,9 +26,9 @@ agents/langgraph_base_react/app/agent.py,sha256=srxiOT-NIM87WnUvP0PXuZGryEG9S33Z
26
26
  agents/langgraph_base_react/notebooks/evaluating_langgraph_agent.ipynb,sha256=PlW41fL-ji9NKkimW6u25YRLGWN2pgoX2G8w5nzIEPE,58737
27
27
  agents/langgraph_base_react/template/.templateconfig.yaml,sha256=NE_EJzZPtdbJRFdp5k9fovc6zUA6Wvm1MBUBvaZ6gV0,1050
28
28
  agents/langgraph_base_react/tests/integration/test_agent.py,sha256=wg2Y8V4l7dh7rhWy7Z8zioDW5ILRsz7RZJ-mz0AhK3U,1619
29
- agents/live_api/README.md,sha256=RbWUT9W9yAsrmjcGUbefZVIRfJvi9N5J16K6zWRy3TU,2904
30
- agents/live_api/app/agent.py,sha256=6ts3RGqVVfz-gOt3QUTvKz1lFL2imgPn2iJ5ZgtOMzc,2322
31
- agents/live_api/app/server.py,sha256=MtUeSP9U3-aWK2D82WOS95vvh5i-_7qvUpWtW7DZR7o,7552
29
+ agents/live_api/README.md,sha256=c3lu5WguOUBc5hO_UtNZfVhfYxvSzMXuGFICn9M38mU,2897
30
+ agents/live_api/app/agent.py,sha256=FBsmCYI_dmBIbFD1uojcPxJfozGNc-0rg1fW2PhEyFw,2298
31
+ agents/live_api/app/server.py,sha256=A2frpeM-mHoRiUAlvJKZAdU_Q8-GOwcCh3iODdRmbr4,7652
32
32
  agents/live_api/template/.templateconfig.yaml,sha256=xN4ZNa_-qoBWNh4oMh8WBu-KmxUAYtJdF7qlYbHg-FM,964
33
33
  agents/live_api/tests/integration/test_server_e2e.py,sha256=D2VETDIyTD2fQyQ6DXwLr-POSYyVzzzcpIFLt5Ppyx4,8398
34
34
  agents/live_api/tests/load_test/load_test.py,sha256=HHZyfC4gqiQtZVF_CbbxENGgWQccMLpwMv0IdoQ6cbQ,1275
@@ -64,9 +64,9 @@ src/base_template/deployment/terraform/vars/env.tfvars,sha256=Nze8q1x2Aj6ZUeWC2h
64
64
  src/base_template/tests/unit/test_dummy.py,sha256=2exfCH8qhkZrLWvK04ZxNTO9MV3fdTbZkJN3uK6zvok,850
65
65
  src/cli/main.py,sha256=pMsSlNwkrFqHUHHA5U-WMZ4QRquaI_F7OXQt6yxuugE,1688
66
66
  src/cli/commands/create.py,sha256=2dvvkvwLAJDi1gG7SA3LXfriTY7T6fyWKeuBHHwxLIU,24117
67
- src/cli/commands/setup_cicd.py,sha256=usWoOPWxNbSDql6HJYKYvRue0xZd2fUZSINzMjlBBK0,32784
67
+ src/cli/commands/setup_cicd.py,sha256=Lr0wLeKlRxROsRVFLAI3ygfIh_sTavvgQckDkzFEKMQ,31705
68
68
  src/cli/utils/__init__.py,sha256=_cTmsXGPqOtK0q8UW5164QTltbJRJFR_Efxq_BRL1-o,1311
69
- src/cli/utils/cicd.py,sha256=tlz50wI0unRosRZsDpZ5Oh5haMJmNjc9dV0-TPWawKE,27443
69
+ src/cli/utils/cicd.py,sha256=m2BxwV39323rVzJCjJjB37IPdSNQdxVgXGrgnhdbb84,26040
70
70
  src/cli/utils/datastores.py,sha256=gv1V6eDcOEKx4MRNG5C3Y-VfixYq1AzQuaYMLp8QRNo,1058
71
71
  src/cli/utils/gcp.py,sha256=cnuCyN144eiyYc9aJNEK9JnyWN66rdevugoMdDYC1UU,4032
72
72
  src/cli/utils/logging.py,sha256=0lHe4EPi1A8sOx9xkA7gS4UNl0GsIyp2ahydkkuCzLY,1570
@@ -169,8 +169,8 @@ src/resources/setup_cicd/providers.tf,sha256=Km4z6IJt7x7PLaa0kyZbBrO2m3lpuIJZFD5
169
169
  src/utils/generate_locks.py,sha256=6V1B8V2BEuevWnXUsxZVTrLjXwFRII8UfsIGrQqZxVs,4320
170
170
  src/utils/lock_utils.py,sha256=RSE6n3hBkH64xNm3Q5wrR0Pqbeo-oc7xaTOhA9yzHjk,2275
171
171
  src/utils/watch_and_rebuild.py,sha256=vP4yIiA7E_lj5sfQdJUl8TXas6V7msDg8XWUutAC05Q,6679
172
- agent_starter_pack-0.4.1.dist-info/METADATA,sha256=PNCwLDsh82UgVEY2jQqKdW2K_p-hhIxo4IOu3Ra-nM8,9991
173
- agent_starter_pack-0.4.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
174
- agent_starter_pack-0.4.1.dist-info/entry_points.txt,sha256=U7uCxR7YulIhZ0L8R8Hui0Bsy6J7oyESBeDYJYMrQjA,56
175
- agent_starter_pack-0.4.1.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
176
- agent_starter_pack-0.4.1.dist-info/RECORD,,
172
+ agent_starter_pack-0.4.3.dist-info/METADATA,sha256=hRLsQG8-8zRQBkhkmzFxUU7FdmF4pyNmczu8YSUTrRk,10452
173
+ agent_starter_pack-0.4.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
174
+ agent_starter_pack-0.4.3.dist-info/entry_points.txt,sha256=U7uCxR7YulIhZ0L8R8Hui0Bsy6J7oyESBeDYJYMrQjA,56
175
+ agent_starter_pack-0.4.3.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
176
+ agent_starter_pack-0.4.3.dist-info/RECORD,,
agents/live_api/README.md CHANGED
@@ -6,7 +6,7 @@ This pattern showcases a real-time conversational agent powered by Google Gemini
6
6
 
7
7
  **Key components:**
8
8
 
9
- - **Python Backend** (in `app/` folder): A production-ready server built with [FastAPI](https://fastapi.tiangolo.com/) and [google-genai](https://googleapis.github.io/python-python-genai/) that features:
9
+ - **Python Backend** (in `app/` folder): A production-ready server built with [FastAPI](https://fastapi.tiangolo.com/) and [google-genai](https://googleapis.github.io/python-genai/) that features:
10
10
 
11
11
  - **Real-time bidirectional communication** via WebSockets between the frontend and Gemini model
12
12
  - **Integrated tool calling** with a weather information tool for demonstrating external data retrieval
@@ -22,8 +22,7 @@ from google.genai import types
22
22
  # Constants
23
23
  VERTEXAI = os.getenv("VERTEXAI", "true").lower() == "true"
24
24
  LOCATION = "us-central1"
25
- EMBEDDING_MODEL = "text-embedding-004"
26
- MODEL_ID = "gemini-2.0-flash-exp"
25
+ MODEL_ID = "gemini-2.0-flash-live-preview-04-09"
27
26
 
28
27
  # Initialize Google Cloud clients
29
28
  credentials, project_id = google.auth.default()
@@ -70,6 +70,7 @@ class GeminiSession:
70
70
  while True:
71
71
  try:
72
72
  data = await self.websocket.receive_json()
73
+
73
74
  if isinstance(data, dict) and (
74
75
  "realtimeInput" in data or "clientContent" in data
75
76
  ):
@@ -98,13 +99,7 @@ class GeminiSession:
98
99
  async def _handle_tool_call(
99
100
  self, session: Any, tool_call: LiveServerToolCall
100
101
  ) -> None:
101
- """Process tool calls from Gemini and send back responses.
102
-
103
- Args:
104
- session: The Gemini session
105
- tool_call: Tool call request from Gemini
106
- """
107
- # Handle case where function_calls might be None
102
+ """Process tool calls from Gemini and send back responses."""
108
103
  if tool_call.function_calls is None:
109
104
  logging.debug("No function calls in tool_call")
110
105
  return
@@ -116,7 +111,14 @@ class GeminiSession:
116
111
  logging.error(f"Function {fc.name} not found")
117
112
  continue
118
113
  args = fc.args if fc.args is not None else {}
119
- response = func(**args)
114
+
115
+ # Handle both async and sync functions appropriately
116
+ if asyncio.iscoroutinefunction(func):
117
+ # Function is already async
118
+ response = await func(**args)
119
+ else:
120
+ # Run sync function in a thread pool to avoid blocking
121
+ response = await asyncio.to_thread(func, **args)
120
122
 
121
123
  tool_response = types.LiveClientToolResponse(
122
124
  function_responses=[
@@ -127,18 +129,15 @@ class GeminiSession:
127
129
  await session.send(input=tool_response)
128
130
 
129
131
  async def receive_from_gemini(self) -> None:
130
- """Listen for and process messages from Gemini.
131
-
132
- Continuously receives messages from Gemini, forwards them to the client,
133
- and handles any tool calls. Handles connection errors gracefully.
134
- """
132
+ """Listen for and process messages from Gemini without blocking."""
135
133
  while result := await self.session._ws.recv(decode=False):
136
134
  await self.websocket.send_bytes(result)
137
135
  raw_message = json.loads(result)
138
136
  if "toolCall" in raw_message:
139
137
  message = types.LiveServerMessage.model_validate(raw_message)
140
138
  tool_call = LiveServerToolCall.model_validate(message.tool_call)
141
- await self._handle_tool_call(self.session, tool_call)
139
+ # Create a separate task to handle the tool call without blocking
140
+ asyncio.create_task(self._handle_tool_call(self.session, tool_call))
142
141
 
143
142
 
144
143
  def get_connect_and_run_callable(websocket: WebSocket) -> Callable:
@@ -12,7 +12,6 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
- import json
16
15
  import logging
17
16
  import re
18
17
  import shutil
@@ -228,40 +227,18 @@ def prompt_for_repository_details(
228
227
  repo_url = click.prompt(
229
228
  "Enter existing repository URL (e.g., https://github.com/owner/repo)"
230
229
  )
231
- # Extract owner and name from URL
232
- match = re.match(r"https://github\.com/([^/]+)/([^/]+)", repo_url)
230
+ # Extract owner and repo name from URL
231
+ match = re.search(r"github\.com/([^/]+)/([^/]+)", repo_url)
233
232
  if match:
234
233
  repository_owner = match.group(1)
235
- repository_name = match.group(2)
236
-
237
- # Verify repository exists and is empty
238
- try:
239
- result = run_command(
240
- [
241
- "gh",
242
- "repo",
243
- "view",
244
- f"{repository_owner}/{repository_name}",
245
- "--json",
246
- "isEmpty",
247
- ],
248
- capture_output=True,
249
- )
250
- if not json.loads(result.stdout).get("isEmpty", False):
251
- if not click.confirm(
252
- "Repository is not empty. Are you sure you want to use it?",
253
- default=False,
254
- ):
255
- continue
256
- break
257
- except subprocess.CalledProcessError:
258
- console.print(
259
- "❌ Repository not found or not accessible",
260
- style="bold red",
261
- )
262
- continue
234
+ # Remove .git suffix if present
235
+ repository_name = match.group(2).rstrip(".git")
236
+ break
263
237
  else:
264
- console.print("❌ Invalid repository URL format", style="bold red")
238
+ console.print(
239
+ "❌ Invalid repository URL format. Please use https://github.com/owner/repo",
240
+ style="bold red",
241
+ )
265
242
 
266
243
  if repository_name is None or repository_owner is None:
267
244
  raise ValueError("Repository name and owner must be provided")
@@ -570,15 +547,12 @@ def setup_cicd(
570
547
 
571
548
  if git_provider == "github" and detected_mode == "interactive":
572
549
  # First create the repository since we're in interactive mode
573
- create_github_repository(repository_owner, repository_name)
550
+ if not repository_exists:
551
+ create_github_repository(repository_owner, repository_name)
574
552
 
575
553
  # Then create the connection
576
554
  oauth_token_secret_id, github_app_installation_id = create_github_connection(
577
- project_id=cicd_project,
578
- region=region,
579
- connection_name=host_connection_name,
580
- repository_name=repository_name,
581
- repository_owner=repository_owner,
555
+ project_id=cicd_project, region=region, connection_name=host_connection_name
582
556
  )
583
557
  repository_exists = True
584
558
  elif git_provider == "github" and detected_mode == "programmatic":
src/cli/utils/cicd.py CHANGED
@@ -89,11 +89,7 @@ def setup_repository_name(
89
89
 
90
90
 
91
91
  def create_github_connection(
92
- project_id: str,
93
- region: str,
94
- connection_name: str,
95
- repository_name: str,
96
- repository_owner: str,
92
+ project_id: str, region: str, connection_name: str
97
93
  ) -> tuple[str, str]:
98
94
  """Create and verify GitHub connection using gcloud command.
99
95
 
@@ -101,53 +97,12 @@ def create_github_connection(
101
97
  project_id: GCP project ID
102
98
  region: GCP region
103
99
  connection_name: Name for the GitHub connection
104
- repository_name: Name of repository to create
105
- repository_owner: Owner of repository
106
100
 
107
101
  Returns:
108
102
  tuple[str, str]: The OAuth token secret ID and the app installation ID
109
103
  """
110
104
  console.print("\n🔗 Creating GitHub connection...")
111
105
 
112
- # Create repository if details provided
113
- try:
114
- # Check if repo exists
115
- result = run_command(
116
- [
117
- "gh",
118
- "repo",
119
- "view",
120
- f"{repository_owner}/{repository_name}",
121
- "--json",
122
- "name",
123
- ],
124
- capture_output=True,
125
- check=False,
126
- )
127
-
128
- if result.returncode != 0:
129
- # Repository doesn't exist, create it
130
- console.print(
131
- f"\n📦 Creating GitHub repository: {repository_owner}/{repository_name}"
132
- )
133
- run_command(
134
- [
135
- "gh",
136
- "repo",
137
- "create",
138
- f"{repository_owner}/{repository_name}",
139
- "--private",
140
- "--description",
141
- "Repository created by Terraform",
142
- ]
143
- )
144
- console.print("✅ GitHub repository created")
145
- else:
146
- console.print("✅ Using existing GitHub repository")
147
- except subprocess.CalledProcessError as e:
148
- console.print(f"❌ Failed to create/check repository: {e!s}", style="bold red")
149
- raise
150
-
151
106
  def try_create_connection() -> subprocess.CompletedProcess[str]:
152
107
  cmd = [
153
108
  "gcloud",