agent-starter-pack 0.0.2b0__py3-none-any.whl → 0.0.4b0__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.
- {agent_starter_pack-0.0.2b0.dist-info → agent_starter_pack-0.0.4b0.dist-info}/METADATA +8 -8
- {agent_starter_pack-0.0.2b0.dist-info → agent_starter_pack-0.0.4b0.dist-info}/RECORD +12 -17
- agents/agentic_rag_vertexai_search/template/.templateconfig.yaml +14 -0
- agents/crewai_coding_crew/template/.templateconfig.yaml +14 -0
- agents/langgraph_base_react/template/.templateconfig.yaml +14 -0
- agents/multimodal_live_api/README.md +18 -2
- agents/multimodal_live_api/template/.templateconfig.yaml +14 -0
- src/cli/commands/create.py +116 -176
- src/cli/utils/gcp.py +7 -8
- src/deployment_targets/agent_engine/tests/load_test/.results/report.html +0 -264
- src/deployment_targets/agent_engine/tests/load_test/.results/results_exceptions.csv +0 -1
- src/deployment_targets/agent_engine/tests/load_test/.results/results_failures.csv +0 -1
- src/deployment_targets/agent_engine/tests/load_test/.results/results_stats.csv +0 -3
- src/deployment_targets/agent_engine/tests/load_test/.results/results_stats_history.csv +0 -22
- {agent_starter_pack-0.0.2b0.dist-info → agent_starter_pack-0.0.4b0.dist-info}/WHEEL +0 -0
- {agent_starter_pack-0.0.2b0.dist-info → agent_starter_pack-0.0.4b0.dist-info}/entry_points.txt +0 -0
- {agent_starter_pack-0.0.2b0.dist-info → agent_starter_pack-0.0.4b0.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: agent-starter-pack
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.4b0
|
|
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
|
|
7
7
|
License-File: LICENSE
|
|
8
8
|
Requires-Python: >=3.10
|
|
9
|
-
Requires-Dist: click
|
|
10
|
-
Requires-Dist: cookiecutter
|
|
11
|
-
Requires-Dist: google-cloud-aiplatform
|
|
12
|
-
Requires-Dist: inquirer
|
|
13
|
-
Requires-Dist: pyyaml
|
|
14
|
-
Requires-Dist: rich
|
|
15
|
-
Requires-Dist: uv
|
|
9
|
+
Requires-Dist: click~=8.1.7
|
|
10
|
+
Requires-Dist: cookiecutter~=2.5.0
|
|
11
|
+
Requires-Dist: google-cloud-aiplatform~=1.81.0
|
|
12
|
+
Requires-Dist: inquirer~=3.1.3
|
|
13
|
+
Requires-Dist: pyyaml~=6.0.1
|
|
14
|
+
Requires-Dist: rich~=13.7.0
|
|
15
|
+
Requires-Dist: uv~=0.6.3
|
|
16
16
|
Provides-Extra: jupyter
|
|
17
17
|
Requires-Dist: ipykernel>=6.29.5; extra == 'jupyter'
|
|
18
18
|
Requires-Dist: jupyter; extra == 'jupyter'
|
|
@@ -3,7 +3,7 @@ agents/agentic_rag_vertexai_search/app/agent.py,sha256=ly4OZiOj_jKKSLvo2ZhtQgrxW
|
|
|
3
3
|
agents/agentic_rag_vertexai_search/app/retrievers.py,sha256=h5mIa2wphDLefBxNQLH50_zFfbKnEwpz7p1S2rTqt28,2769
|
|
4
4
|
agents/agentic_rag_vertexai_search/app/templates.py,sha256=h3dtaVScPNMLqEudh63ZURzZh59p4tclKusFP5rWPgA,1632
|
|
5
5
|
agents/agentic_rag_vertexai_search/notebooks/evaluating_langgraph_agent.ipynb,sha256=INlcKJQ_2KB9XAXloG6wKB7cHBKDhW56w1bAQm2IeLA,58048
|
|
6
|
-
agents/agentic_rag_vertexai_search/template/.templateconfig.yaml,sha256=
|
|
6
|
+
agents/agentic_rag_vertexai_search/template/.templateconfig.yaml,sha256=Y1QvZ8Q0kilS_EN6N9YxKW7LOXABq2i2DgeYPwZJHEw,1070
|
|
7
7
|
agents/agentic_rag_vertexai_search/tests/integration/test_agent.py,sha256=8Y4BUvfxPaiEcT8WvdMTl5hVYTWS_W_4aQtYmgrdgx8,1935
|
|
8
8
|
agents/crewai_coding_crew/README.md,sha256=4No7sfHQVHELARGiT3fWANJzDR0NP48ow4ct3FoPwlA,1672
|
|
9
9
|
agents/crewai_coding_crew/app/agent.py,sha256=GcmNrOyRPhnI7LICIV6GvBvcDfA_PKqPsQcOEzAORmY,3269
|
|
@@ -12,19 +12,19 @@ agents/crewai_coding_crew/app/crew/config/agents.yaml,sha256=Cn9zTcP3C-8MvlV19cY
|
|
|
12
12
|
agents/crewai_coding_crew/app/crew/config/tasks.yaml,sha256=SSFuiSQPhi4dM0V5HdNuMqtN7JJr5RUCMhhBzUkPBpc,1511
|
|
13
13
|
agents/crewai_coding_crew/notebooks/evaluating_crewai_agent.ipynb,sha256=OxUud-wX9CLhKEldFwU_jYgA8KALkQ8_MwLN8gvOai8,58007
|
|
14
14
|
agents/crewai_coding_crew/notebooks/evaluating_langgraph_agent.ipynb,sha256=INlcKJQ_2KB9XAXloG6wKB7cHBKDhW56w1bAQm2IeLA,58048
|
|
15
|
-
agents/crewai_coding_crew/template/.templateconfig.yaml,sha256=
|
|
15
|
+
agents/crewai_coding_crew/template/.templateconfig.yaml,sha256=cl2idKg9NZKrkIkDhxCVSiDIJaoDjy5yMVmVc93Nlm8,974
|
|
16
16
|
agents/crewai_coding_crew/tests/integration/test_agent.py,sha256=0uvfmM3FSdESIU7ICb2oqABsQqylQU2PE3UBwbpif-A,1629
|
|
17
17
|
agents/langgraph_base_react/README.md,sha256=erfhoSbEqbqn1XM_sSjxXyWleBWIyAMuaN5xMIG6f3M,485
|
|
18
18
|
agents/langgraph_base_react/app/agent.py,sha256=2HsbZaSLpMhJQ21geauKPfavcavPW50lx4WV5dXlvnQ,2514
|
|
19
19
|
agents/langgraph_base_react/notebooks/evaluating_langgraph_agent.ipynb,sha256=INlcKJQ_2KB9XAXloG6wKB7cHBKDhW56w1bAQm2IeLA,58048
|
|
20
|
-
agents/langgraph_base_react/template/.templateconfig.yaml,sha256=
|
|
20
|
+
agents/langgraph_base_react/template/.templateconfig.yaml,sha256=NpQRZbXtCOeX0XiYtqyI73V6zH4tWWr1TpcTDsSTcjw,991
|
|
21
21
|
agents/langgraph_base_react/tests/integration/test_agent.py,sha256=wg2Y8V4l7dh7rhWy7Z8zioDW5ILRsz7RZJ-mz0AhK3U,1619
|
|
22
|
-
agents/multimodal_live_api/README.md,sha256=
|
|
22
|
+
agents/multimodal_live_api/README.md,sha256=v_RsHdcmw1ed5jQ65ZgdoDldCsoQuupPTLd9YvG_U8w,3435
|
|
23
23
|
agents/multimodal_live_api/app/agent.py,sha256=WFB7lvDiImvNyWFlds_f5TtzyrbwcquJe6JyJo8HGSs,2690
|
|
24
24
|
agents/multimodal_live_api/app/server.py,sha256=2l7WgNVQAHbnhWUyXBsIt4DI2_kuBoKiEEhcmg1Hom4,6991
|
|
25
25
|
agents/multimodal_live_api/app/templates.py,sha256=HgA4QGIle4Q-Nr6xAAXk1pTX7eNbZqlQUD9_fbCvDWA,3301
|
|
26
26
|
agents/multimodal_live_api/app/vector_store.py,sha256=AYRSNpfevbVTt-nnWna_dp2pn4T7o1nz9-9wOoWaxsA,2045
|
|
27
|
-
agents/multimodal_live_api/template/.templateconfig.yaml,sha256=
|
|
27
|
+
agents/multimodal_live_api/template/.templateconfig.yaml,sha256=gkXZxV15yY6OpJ64VWRhWlCtPhJxyacrv_e2kY3-Wo0,1082
|
|
28
28
|
agents/multimodal_live_api/tests/integration/test_server_e2e.py,sha256=D2VETDIyTD2fQyQ6DXwLr-POSYyVzzzcpIFLt5Ppyx4,8398
|
|
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
|
|
@@ -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=
|
|
60
|
+
src/cli/commands/create.py,sha256=KkGte-FAvuSwkivuTLJ8s_HqpAJ35senyWA04VUKllA,16898
|
|
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=
|
|
64
|
+
src/cli/utils/gcp.py,sha256=nZP9wBfzJXuATbX-e8gVY9FyF23b3q-bXFosgkW3eBU,4128
|
|
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
|
|
@@ -79,11 +79,6 @@ src/deployment_targets/agent_engine/tests/integration/test_agent_engine_app.py,s
|
|
|
79
79
|
src/deployment_targets/agent_engine/tests/load_test/README.md,sha256=ckP2eu5_HpOjM390KXNwUk4YWAzWqir3YOTceyoeL64,1441
|
|
80
80
|
src/deployment_targets/agent_engine/tests/load_test/load_test.py,sha256=msUkkqsNinCJ8loQHsEeGkQQqQ-Zvv7oAp5ni9vOsWs,3541
|
|
81
81
|
src/deployment_targets/agent_engine/tests/load_test/.results/.placeholder,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
82
|
-
src/deployment_targets/agent_engine/tests/load_test/.results/report.html,sha256=QVJtVS8wsFhWltwaH1v2JSkdS6q4rdSs_DuaXEfYu9I,1475308
|
|
83
|
-
src/deployment_targets/agent_engine/tests/load_test/.results/results_exceptions.csv,sha256=PnPo9mVzHuTkWmqRICoxsGmZ8sUyQPFK7iUy4OC0Kwk,31
|
|
84
|
-
src/deployment_targets/agent_engine/tests/load_test/.results/results_failures.csv,sha256=7K2uMJ7c4_mPrMYsMQE9JyDAUClzKhuz2PKIY5_8NzY,31
|
|
85
|
-
src/deployment_targets/agent_engine/tests/load_test/.results/results_stats.csv,sha256=IOlGa4JOaOOKjMjICLFvd5k80pUHzY6eYe38dF2-ljY,588
|
|
86
|
-
src/deployment_targets/agent_engine/tests/load_test/.results/results_stats_history.csv,sha256=2WjXHaQb17ieFrcVZo-P94qpjSELzt1tAJdiPa6MBeI,3794
|
|
87
82
|
src/deployment_targets/agent_engine/tests/unit/test_dummy.py,sha256=hL-JCmoQUJ4IgluliEo3KkYd47nmiCy3obiPuz_b0sU,712
|
|
88
83
|
src/deployment_targets/cloud_run/Dockerfile,sha256=JTh6P_RXE3bkdsHS0zIgguDVVf0XyLViMcb-UNT3Da4,835
|
|
89
84
|
src/deployment_targets/cloud_run/uv.lock,sha256=2RYrR89xDS1FHVb-g2JGZq8zZ-rzbm_jRvehVCYuXRQ,887957
|
|
@@ -155,8 +150,8 @@ src/resources/setup_cicd/providers.tf,sha256=Km4z6IJt7x7PLaa0kyZbBrO2m3lpuIJZFD5
|
|
|
155
150
|
src/utils/generate_locks.py,sha256=xu5IAhGGBPkVQGSJX4kk7_JNDwWJUEaXAHbmaQIohbg,4386
|
|
156
151
|
src/utils/lock_utils.py,sha256=plw3vWkRViCMxBK3IrLRHtF_I0kbbP043T9KIYxcb20,2423
|
|
157
152
|
src/utils/watch_and_rebuild.py,sha256=IdbTLReYknTXXu5KWPz3sc7Zg5HTEMS5UVlMSnuhs5E,6067
|
|
158
|
-
agent_starter_pack-0.0.
|
|
159
|
-
agent_starter_pack-0.0.
|
|
160
|
-
agent_starter_pack-0.0.
|
|
161
|
-
agent_starter_pack-0.0.
|
|
162
|
-
agent_starter_pack-0.0.
|
|
153
|
+
agent_starter_pack-0.0.4b0.dist-info/METADATA,sha256=_m-NtcmnQH_6wZWro1uVIG6dBJTQia3GEuh1AlSblVE,6805
|
|
154
|
+
agent_starter_pack-0.0.4b0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
155
|
+
agent_starter_pack-0.0.4b0.dist-info/entry_points.txt,sha256=U7uCxR7YulIhZ0L8R8Hui0Bsy6J7oyESBeDYJYMrQjA,56
|
|
156
|
+
agent_starter_pack-0.0.4b0.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
157
|
+
agent_starter_pack-0.0.4b0.dist-info/RECORD,,
|
|
@@ -1,3 +1,17 @@
|
|
|
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
|
+
|
|
1
15
|
description: "A RAG agent using Vertex AI Search and LangGraph for document retrieval and Q&A"
|
|
2
16
|
settings:
|
|
3
17
|
requires_data_ingestion: true
|
|
@@ -1,3 +1,17 @@
|
|
|
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
|
+
|
|
1
15
|
description: "A multi-agent system implemented with CrewAI created to support coding activities"
|
|
2
16
|
settings:
|
|
3
17
|
requires_data_ingestion: false
|
|
@@ -1,3 +1,17 @@
|
|
|
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
|
+
|
|
1
15
|
description: "A agent implementing a base ReAct agent using LangGraph"
|
|
2
16
|
settings:
|
|
3
17
|
requires_data_ingestion: false
|
|
@@ -28,16 +28,32 @@ This pattern showcases a real-time conversational RAG agent powered by Google Ge
|
|
|
28
28
|
|
|
29
29
|
2. **Start the Backend and Frontend:**
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
**Backend:**
|
|
32
32
|
```bash
|
|
33
33
|
make backend
|
|
34
34
|
```
|
|
35
|
+
|
|
36
|
+
The backend will be ready when you see `INFO: Application startup complete.` in the console.
|
|
37
|
+
|
|
38
|
+
<details>
|
|
39
|
+
<summary><b>Click here if you want to use AI Studio and API Key instead of Vertex AI:</b></summary>
|
|
35
40
|
|
|
36
|
-
In a different shell, start the frontend:
|
|
37
41
|
```bash
|
|
42
|
+
export VERTEXAI=false
|
|
43
|
+
export GOOGLE_API_KEY=your-google-api-key
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
</details>
|
|
47
|
+
<br>
|
|
48
|
+
|
|
49
|
+
**Frontend:**
|
|
50
|
+
```bash
|
|
51
|
+
# In a different shell
|
|
38
52
|
make ui
|
|
39
53
|
```
|
|
40
54
|
|
|
55
|
+
This is the suggested mode for development as it allows you to see changes in real-time.
|
|
56
|
+
|
|
41
57
|
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](https://cloud.google.com/architecture/deploy-operate-generative-ai-applications) it was provided to.
|
|
42
58
|
|
|
43
59
|
## Additional Resources for Multimodal Live API
|
|
@@ -1,3 +1,17 @@
|
|
|
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
|
+
|
|
1
15
|
description: "A real-time multimodal RAG agent powered by Gemini, supporting audio/video/text chat with vector DB-backed responses"
|
|
2
16
|
settings:
|
|
3
17
|
requires_data_ingestion: false
|
src/cli/commands/create.py
CHANGED
|
@@ -47,8 +47,6 @@ console = Console()
|
|
|
47
47
|
@click.option(
|
|
48
48
|
"--include-data-ingestion", "-i", is_flag=True, help="Include data pipeline"
|
|
49
49
|
)
|
|
50
|
-
@click.option("--gcp-account", help="GCP service account email")
|
|
51
|
-
@click.option("--gcp-project", help="GCP project ID")
|
|
52
50
|
@click.option("--debug", is_flag=True, help="Enable debug logging")
|
|
53
51
|
@click.option(
|
|
54
52
|
"--output-dir",
|
|
@@ -77,8 +75,6 @@ def create(
|
|
|
77
75
|
agent: str | None,
|
|
78
76
|
deployment_target: str | None,
|
|
79
77
|
include_data_ingestion: bool,
|
|
80
|
-
gcp_account: str | None,
|
|
81
|
-
gcp_project: str | None,
|
|
82
78
|
debug: bool,
|
|
83
79
|
output_dir: str | None,
|
|
84
80
|
auto_approve: bool,
|
|
@@ -164,85 +160,18 @@ def create(
|
|
|
164
160
|
logging.debug(f"Selected region: {region}")
|
|
165
161
|
|
|
166
162
|
# GCP Setup
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
# Handle GCP credentials
|
|
172
|
-
if gcp_account and gcp_project:
|
|
173
|
-
try:
|
|
174
|
-
subprocess.run(
|
|
175
|
-
["gcloud", "config", "set", "account", gcp_account], check=True
|
|
176
|
-
)
|
|
177
|
-
subprocess.run(
|
|
178
|
-
["gcloud", "config", "set", "project", gcp_project], check=True
|
|
179
|
-
)
|
|
180
|
-
subprocess.run(
|
|
181
|
-
[
|
|
182
|
-
"gcloud",
|
|
183
|
-
"auth",
|
|
184
|
-
"application-default",
|
|
185
|
-
"set-quota-project",
|
|
186
|
-
gcp_project,
|
|
187
|
-
],
|
|
188
|
-
check=True,
|
|
189
|
-
)
|
|
190
|
-
except subprocess.CalledProcessError as e:
|
|
191
|
-
console.print(f"Error setting GCP credentials: {e!s}", style="bold red")
|
|
192
|
-
raise
|
|
193
|
-
|
|
163
|
+
logging.debug("Setting up GCP...")
|
|
164
|
+
|
|
165
|
+
# Check for uv installation if not skipping checks
|
|
194
166
|
if not skip_checks:
|
|
195
|
-
# Verify GCP credentials
|
|
196
|
-
if debug:
|
|
197
|
-
logging.debug("Verifying GCP credentials...")
|
|
198
|
-
creds_info = verify_credentials()
|
|
199
|
-
|
|
200
|
-
if not auto_approve:
|
|
201
|
-
change_creds = (
|
|
202
|
-
Prompt.ask(
|
|
203
|
-
f"\n> You are logged in with account '{creds_info['account']}' "
|
|
204
|
-
f"and using project '{creds_info['project']}'. "
|
|
205
|
-
"Is this correct?",
|
|
206
|
-
choices=["Y", "n"],
|
|
207
|
-
default="Y",
|
|
208
|
-
).lower()
|
|
209
|
-
== "n"
|
|
210
|
-
)
|
|
211
|
-
|
|
212
|
-
if change_creds:
|
|
213
|
-
handle_credential_change()
|
|
214
|
-
else:
|
|
215
|
-
console.print(
|
|
216
|
-
f"\n> Using account '{creds_info['account']}' "
|
|
217
|
-
f"with project '{creds_info['project']}'"
|
|
218
|
-
)
|
|
219
|
-
|
|
220
|
-
# Check for uv installation
|
|
221
|
-
console.print("> Checking for uv installation...")
|
|
222
167
|
check_and_install_uv()
|
|
223
|
-
|
|
224
|
-
#
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
)
|
|
231
|
-
console.print(
|
|
232
|
-
f"> ✓ Successfully verified connection to Vertex AI in project {creds_info['project']}"
|
|
233
|
-
)
|
|
234
|
-
except Exception as e:
|
|
235
|
-
console.print(
|
|
236
|
-
f"> ✗ Failed to connect to Vertex AI: {e!s}", style="bold red"
|
|
237
|
-
)
|
|
238
|
-
raise
|
|
239
|
-
else:
|
|
240
|
-
if debug:
|
|
241
|
-
logging.debug("Skipping verification checks due to --skip-checks flag")
|
|
242
|
-
console.print("> Skipping verification checks", style="yellow")
|
|
243
|
-
# Set a default creds_info when skipping checks
|
|
244
|
-
creds_info = (
|
|
245
|
-
{"project": gcp_project} if gcp_project else {"project": "unknown"}
|
|
168
|
+
|
|
169
|
+
# Set up GCP environment
|
|
170
|
+
setup_gcp_environment(
|
|
171
|
+
auto_approve=auto_approve,
|
|
172
|
+
skip_checks=skip_checks,
|
|
173
|
+
region=region,
|
|
174
|
+
debug=debug
|
|
246
175
|
)
|
|
247
176
|
|
|
248
177
|
# Process template
|
|
@@ -330,74 +259,122 @@ def display_agent_selection(deployment_target: str | None = None) -> str:
|
|
|
330
259
|
return agents[choice]["name"]
|
|
331
260
|
|
|
332
261
|
|
|
333
|
-
def
|
|
334
|
-
"""
|
|
262
|
+
def set_project_quota(project_id: str) -> None:
|
|
263
|
+
"""Set the GCP project and application default quota project.
|
|
264
|
+
|
|
265
|
+
Args:
|
|
266
|
+
project_id: The GCP project ID to set
|
|
267
|
+
"""
|
|
335
268
|
try:
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
console.print("> Login successful. Verifying new credentials...")
|
|
339
|
-
|
|
340
|
-
# Re-verify credentials after login
|
|
341
|
-
new_creds_info = verify_credentials()
|
|
342
|
-
|
|
343
|
-
# Prompt for project change
|
|
344
|
-
change_project = (
|
|
345
|
-
Prompt.ask(
|
|
346
|
-
f"\n> You are now logged in with account '{new_creds_info['account']}'. "
|
|
347
|
-
f"Current project is '{new_creds_info['project']}'. "
|
|
348
|
-
"Do you wish to change the project?",
|
|
349
|
-
choices=["y", "n"],
|
|
350
|
-
default="n",
|
|
351
|
-
).lower()
|
|
352
|
-
== "y"
|
|
269
|
+
subprocess.run(
|
|
270
|
+
["gcloud", "config", "set", "project", project_id], check=True, capture_output=True, text=True
|
|
353
271
|
)
|
|
354
|
-
|
|
355
|
-
if change_project:
|
|
356
|
-
handle_project_change()
|
|
357
|
-
|
|
358
272
|
except subprocess.CalledProcessError as e:
|
|
359
|
-
console.print(
|
|
360
|
-
|
|
361
|
-
)
|
|
362
|
-
logging.debug(f"Login error: {e!s}")
|
|
273
|
+
console.print(f"\n> Error setting project to {project_id}:")
|
|
274
|
+
console.print(e.stderr)
|
|
363
275
|
raise
|
|
364
|
-
except Exception as e:
|
|
365
|
-
console.print(f"\n> Unexpected error: {e!s}", style="bold red")
|
|
366
|
-
logging.debug(f"Unexpected error during login: {e!s}")
|
|
367
|
-
raise
|
|
368
|
-
|
|
369
276
|
|
|
370
|
-
def handle_project_change() -> None:
|
|
371
|
-
"""Handle the process of changing GCP project."""
|
|
372
277
|
try:
|
|
373
|
-
# Prompt for new project ID
|
|
374
|
-
new_project = Prompt.ask("\n> Enter the new project ID")
|
|
375
|
-
|
|
376
|
-
console.print(f"\n> Setting project to {new_project}...")
|
|
377
|
-
subprocess.run(["gcloud", "config", "set", "project", new_project], check=True)
|
|
378
|
-
|
|
379
|
-
console.print("> Setting application default quota project...")
|
|
380
278
|
subprocess.run(
|
|
381
|
-
["gcloud", "auth", "application-default", "set-quota-project",
|
|
382
|
-
check=True,
|
|
279
|
+
["gcloud", "auth", "application-default", "set-quota-project", project_id],
|
|
280
|
+
check=True, capture_output=True, text=True
|
|
383
281
|
)
|
|
282
|
+
except subprocess.CalledProcessError as e:
|
|
283
|
+
console.print(f"> Error setting application default quota project:")
|
|
284
|
+
console.print(e.stderr)
|
|
285
|
+
raise
|
|
286
|
+
|
|
287
|
+
console.print(f"> Successfully configured project: {project_id}")
|
|
384
288
|
|
|
385
|
-
console.print(f"> Successfully switched to project: {new_project}")
|
|
386
289
|
|
|
387
|
-
|
|
388
|
-
|
|
290
|
+
def setup_gcp_environment(
|
|
291
|
+
auto_approve: bool,
|
|
292
|
+
skip_checks: bool,
|
|
293
|
+
region: str,
|
|
294
|
+
debug: bool
|
|
295
|
+
) -> dict:
|
|
296
|
+
"""Set up the GCP environment with proper credentials and project.
|
|
297
|
+
|
|
298
|
+
Args:
|
|
299
|
+
auto_approve: Whether to skip confirmation prompts
|
|
300
|
+
skip_checks: Whether to skip verification checks
|
|
301
|
+
region: GCP region for deployment
|
|
302
|
+
debug: Whether debug logging is enabled
|
|
303
|
+
|
|
304
|
+
Returns:
|
|
305
|
+
Dictionary with credential information
|
|
306
|
+
"""
|
|
307
|
+
if skip_checks:
|
|
308
|
+
if debug:
|
|
309
|
+
logging.debug("Skipping verification checks due to --skip-checks flag")
|
|
310
|
+
console.print("> Skipping verification checks", style="yellow")
|
|
311
|
+
# Set a default creds_info when skipping checks
|
|
312
|
+
return {"project": "unknown"}
|
|
313
|
+
|
|
314
|
+
# Verify current GCP credentials
|
|
315
|
+
if debug:
|
|
316
|
+
logging.debug("Verifying GCP credentials...")
|
|
317
|
+
creds_info = verify_credentials()
|
|
318
|
+
|
|
319
|
+
if not auto_approve:
|
|
320
|
+
# Ask user if current credentials are correct
|
|
321
|
+
change_creds = (
|
|
322
|
+
Prompt.ask(
|
|
323
|
+
f"\n> You are logged in with account '{creds_info['account']}' "
|
|
324
|
+
f"and using project '{creds_info['project']}'. "
|
|
325
|
+
"Is this correct?",
|
|
326
|
+
choices=["Y", "n"],
|
|
327
|
+
default="Y",
|
|
328
|
+
).lower() == "n"
|
|
329
|
+
)
|
|
330
|
+
|
|
331
|
+
if change_creds:
|
|
332
|
+
# Handle credential change
|
|
333
|
+
console.print("\n> Initiating new login...")
|
|
334
|
+
subprocess.run(["gcloud", "auth", "login", "--update-adc"], check=True)
|
|
335
|
+
console.print("> Login successful. Verifying new credentials...")
|
|
336
|
+
|
|
337
|
+
# Re-verify credentials after login
|
|
338
|
+
creds_info = verify_credentials()
|
|
339
|
+
|
|
340
|
+
# Prompt for project change
|
|
341
|
+
change_project = (
|
|
342
|
+
Prompt.ask(
|
|
343
|
+
f"\n> You are now logged in with account '{creds_info['account']}'. "
|
|
344
|
+
f"Current project is '{creds_info['project']}'. "
|
|
345
|
+
"Do you wish to change the project?",
|
|
346
|
+
choices=["y", "n"],
|
|
347
|
+
default="n",
|
|
348
|
+
).lower() == "y"
|
|
349
|
+
)
|
|
350
|
+
|
|
351
|
+
if change_project:
|
|
352
|
+
# Prompt for new project ID
|
|
353
|
+
new_project = Prompt.ask("\n> Enter the new project ID")
|
|
354
|
+
creds_info["project"] = new_project
|
|
355
|
+
|
|
356
|
+
# Always set project and quota, regardless of whether credentials were changed
|
|
357
|
+
set_project_quota(creds_info["project"])
|
|
358
|
+
|
|
359
|
+
# Test Vertex AI connection
|
|
360
|
+
console.print("> Testing GCP and Vertex AI Connection...")
|
|
361
|
+
try:
|
|
362
|
+
verify_vertex_connection(
|
|
363
|
+
project_id=creds_info["project"],
|
|
364
|
+
location=region,
|
|
365
|
+
)
|
|
389
366
|
console.print(
|
|
390
|
-
f"
|
|
391
|
-
f"with project '{final_creds_info['project']}'"
|
|
367
|
+
f"> ✓ Successfully verified connection to Vertex AI in project {creds_info['project']}"
|
|
392
368
|
)
|
|
393
|
-
|
|
394
|
-
except subprocess.CalledProcessError as e:
|
|
369
|
+
except Exception as e:
|
|
395
370
|
console.print(
|
|
396
|
-
"
|
|
397
|
-
|
|
371
|
+
f"> ✗ Failed to connect to Vertex AI: {e!s}\n"
|
|
372
|
+
f"> Please check your authentication settings and permissions. "
|
|
373
|
+
f"Visit https://cloud.google.com/vertex-ai/docs/authentication for help.",
|
|
374
|
+
style="bold red"
|
|
398
375
|
)
|
|
399
|
-
|
|
400
|
-
|
|
376
|
+
|
|
377
|
+
return creds_info
|
|
401
378
|
|
|
402
379
|
|
|
403
380
|
def replace_region_in_files(
|
|
@@ -483,11 +460,11 @@ def replace_region_in_files(
|
|
|
483
460
|
|
|
484
461
|
|
|
485
462
|
def check_and_install_uv() -> None:
|
|
486
|
-
"""Check if uv is installed and
|
|
463
|
+
"""Check if uv is installed and inform the user if it's not."""
|
|
487
464
|
try:
|
|
488
465
|
# Use shell=True for Windows compatibility and add timeout
|
|
489
466
|
process = subprocess.run(
|
|
490
|
-
"uv --version", shell=True, capture_output=True, text=True, timeout=
|
|
467
|
+
"uv --version", shell=True, capture_output=True, text=True, timeout=5
|
|
491
468
|
)
|
|
492
469
|
if process.returncode == 0:
|
|
493
470
|
logging.debug("uv is already installed")
|
|
@@ -500,43 +477,6 @@ def check_and_install_uv() -> None:
|
|
|
500
477
|
console.print("> uv is not installed", style="yellow")
|
|
501
478
|
|
|
502
479
|
console.print(
|
|
503
|
-
"\n> uv is
|
|
504
|
-
"\n
|
|
505
|
-
"\n 2. Manual installation from: https://docs.astral.sh/uv/getting-started/installation"
|
|
506
|
-
"\n This includes other options e.g PyPI (pip/pipx), Homebrew, Docker.."
|
|
507
|
-
)
|
|
508
|
-
|
|
509
|
-
install_choice = Prompt.ask(
|
|
510
|
-
"\n> Would you like to install uv automatically now?",
|
|
511
|
-
choices=["y", "n"],
|
|
512
|
-
default="y",
|
|
480
|
+
"\n> uv is recommended for managing virtual environments and dependencies."
|
|
481
|
+
"\n> For installation instructions, visit: https://docs.astral.sh/uv/getting-started/installation"
|
|
513
482
|
)
|
|
514
|
-
if install_choice.lower() == "y":
|
|
515
|
-
console.print("> Installing uv...", style="yellow")
|
|
516
|
-
try:
|
|
517
|
-
install_command = "curl -LsSf https://astral.sh/uv/install.sh | sh"
|
|
518
|
-
# Add timeout to installation process as well
|
|
519
|
-
subprocess.run(
|
|
520
|
-
install_command,
|
|
521
|
-
shell=True,
|
|
522
|
-
check=True,
|
|
523
|
-
timeout=60, # Give installation more time
|
|
524
|
-
)
|
|
525
|
-
console.print("> uv installed successfully!", style="green")
|
|
526
|
-
except subprocess.TimeoutExpired:
|
|
527
|
-
console.print("> uv installation timed out", style="bold red")
|
|
528
|
-
raise
|
|
529
|
-
except subprocess.CalledProcessError as e:
|
|
530
|
-
console.print("> Failed to install uv", style="bold red")
|
|
531
|
-
logging.debug(f"uv installation error: {e!s}")
|
|
532
|
-
console.print(
|
|
533
|
-
"> Please install uv manually using one of the methods listed above",
|
|
534
|
-
style="yellow",
|
|
535
|
-
)
|
|
536
|
-
raise
|
|
537
|
-
else:
|
|
538
|
-
console.print(
|
|
539
|
-
"> Please install uv manually using one of the methods listed above and try again",
|
|
540
|
-
style="yellow",
|
|
541
|
-
)
|
|
542
|
-
raise click.Abort() from None
|
src/cli/utils/gcp.py
CHANGED
|
@@ -24,7 +24,7 @@ from google.cloud.aiplatform_v1beta1.services.prediction_service import (
|
|
|
24
24
|
PredictionServiceClient,
|
|
25
25
|
)
|
|
26
26
|
from google.cloud.aiplatform_v1beta1.types.prediction_service import (
|
|
27
|
-
|
|
27
|
+
CountTokensRequest,
|
|
28
28
|
)
|
|
29
29
|
|
|
30
30
|
|
|
@@ -43,12 +43,11 @@ def get_client_info() -> ClientInfo:
|
|
|
43
43
|
return ClientInfo(client_library_version=version, user_agent=agent)
|
|
44
44
|
|
|
45
45
|
|
|
46
|
-
def get_dummy_request(project_id: str, location: str) ->
|
|
46
|
+
def get_dummy_request(project_id: str, location: str) -> CountTokensRequest:
|
|
47
47
|
"""Creates a simple test request for Gemini."""
|
|
48
|
-
return
|
|
49
|
-
contents=[{"role": "user", "parts": [{"text": "Hi
|
|
50
|
-
|
|
51
|
-
model=f"projects/{project_id}/locations/{location}/publishers/google/models/gemini-2.0-flash-001",
|
|
48
|
+
return CountTokensRequest(
|
|
49
|
+
contents=[{"role": "user", "parts": [{"text": "Hi"}]}],
|
|
50
|
+
endpoint=f"projects/{project_id}/locations/{location}/publishers/google/models/gemini-1.5-flash-002",
|
|
52
51
|
)
|
|
53
52
|
|
|
54
53
|
|
|
@@ -64,10 +63,10 @@ def verify_vertex_connection(
|
|
|
64
63
|
api_endpoint=f"{location}-aiplatform.googleapis.com"
|
|
65
64
|
),
|
|
66
65
|
client_info=get_client_info(),
|
|
67
|
-
transport=
|
|
66
|
+
transport=initializer.global_config._api_transport,
|
|
68
67
|
)
|
|
69
68
|
request = get_dummy_request(project_id=project_id, location=location)
|
|
70
|
-
client.
|
|
69
|
+
client.count_tokens(request=request)
|
|
71
70
|
|
|
72
71
|
|
|
73
72
|
def verify_credentials() -> dict[str, str]:
|