agent-starter-pack 0.6.3__py3-none-any.whl → 0.7.0__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.
- {agent_starter_pack-0.6.3.dist-info → agent_starter_pack-0.7.0.dist-info}/METADATA +16 -12
- {agent_starter_pack-0.6.3.dist-info → agent_starter_pack-0.7.0.dist-info}/RECORD +41 -39
- agents/adk_base/app/agent.py +1 -1
- agents/adk_base/template/.templateconfig.yaml +1 -1
- agents/adk_gemini_fullstack/README.md +1 -4
- agents/adk_gemini_fullstack/app/agent.py +62 -8
- agents/adk_gemini_fullstack/template/.templateconfig.yaml +1 -1
- agents/agentic_rag/app/agent.py +1 -1
- agents/agentic_rag/template/.templateconfig.yaml +1 -1
- agents/crewai_coding_crew/app/agent.py +1 -1
- agents/langgraph_base_react/app/agent.py +1 -1
- agents/live_api/app/agent.py +8 -4
- llm.txt +290 -0
- src/base_template/.gitignore +2 -1
- src/base_template/GEMINI.md +5 -0
- src/base_template/Makefile +21 -6
- src/base_template/deployment/cd/deploy-to-prod.yaml +3 -3
- src/base_template/deployment/cd/staging.yaml +4 -4
- src/base_template/deployment/ci/pr_checks.yaml +1 -1
- src/base_template/pyproject.toml +2 -2
- src/cli/utils/template.py +22 -9
- src/data_ingestion/uv.lock +97 -0
- src/frontends/adk_gemini_fullstack/frontend/package-lock.json +276 -0
- src/frontends/adk_gemini_fullstack/frontend/package.json +1 -0
- src/frontends/adk_gemini_fullstack/frontend/src/components/ChatMessagesView.tsx +5 -4
- src/frontends/adk_gemini_fullstack/frontend/vite.config.ts +4 -0
- src/resources/docs/adk-cheatsheet.md +1224 -0
- src/resources/locks/uv-adk_base-agent_engine.lock +96 -60
- src/resources/locks/uv-adk_base-cloud_run.lock +137 -82
- src/resources/locks/uv-adk_gemini_fullstack-agent_engine.lock +96 -60
- src/resources/locks/uv-adk_gemini_fullstack-cloud_run.lock +137 -82
- src/resources/locks/uv-agentic_rag-agent_engine.lock +173 -142
- src/resources/locks/uv-agentic_rag-cloud_run.lock +246 -200
- src/resources/locks/uv-crewai_coding_crew-agent_engine.lock +493 -248
- src/resources/locks/uv-crewai_coding_crew-cloud_run.lock +585 -306
- src/resources/locks/uv-langgraph_base_react-agent_engine.lock +185 -154
- src/resources/locks/uv-langgraph_base_react-cloud_run.lock +258 -212
- src/resources/locks/uv-live_api-cloud_run.lock +228 -182
- src/frontends/adk_gemini_fullstack/frontend/public/vite.svg +0 -1
- {agent_starter_pack-0.6.3.dist-info → agent_starter_pack-0.7.0.dist-info}/WHEEL +0 -0
- {agent_starter_pack-0.6.3.dist-info → agent_starter_pack-0.7.0.dist-info}/entry_points.txt +0 -0
- {agent_starter_pack-0.6.3.dist-info → agent_starter_pack-0.7.0.dist-info}/licenses/LICENSE +0 -0
llm.txt
ADDED
@@ -0,0 +1,290 @@
|
|
1
|
+
---
|
2
|
+
**llm.txt** documents the "Agent Starter Pack" repository, providing a source of truth on its purpose, features, and usage.
|
3
|
+
---
|
4
|
+
|
5
|
+
### Section 1: Project Overview
|
6
|
+
|
7
|
+
* **Project Name:** Agent Starter Pack
|
8
|
+
* **Purpose:** Accelerate development of production-ready GenAI Agents on Google Cloud.
|
9
|
+
* **Tagline:** Production-Ready Agents on Google Cloud, faster.
|
10
|
+
|
11
|
+
**The "Production Gap":**
|
12
|
+
While prototyping GenAI agents is quick, production deployment often takes 3-9 months.
|
13
|
+
|
14
|
+
**Key Challenges Addressed:**
|
15
|
+
* **Customization:** Business logic, data grounding, security/compliance.
|
16
|
+
* **Evaluation:** Metrics, quality assessment, test datasets.
|
17
|
+
* **Deployment:** Cloud infrastructure, CI/CD, UI integration.
|
18
|
+
* **Observability:** Performance tracking, user feedback.
|
19
|
+
|
20
|
+
**Solution: Agent Starter Pack**
|
21
|
+
Provides MLOps and infrastructure templates so developers focus on agent logic.
|
22
|
+
|
23
|
+
* **You Build:** Prompts, LLM interactions, business logic, agent orchestration.
|
24
|
+
* **We Provide:**
|
25
|
+
* Deployment infrastructure, CI/CD, testing
|
26
|
+
* Logging, monitoring
|
27
|
+
* Evaluation tools
|
28
|
+
* Data connections, UI playground
|
29
|
+
* Security best practices
|
30
|
+
|
31
|
+
Establishes production patterns from day one, saving setup time.
|
32
|
+
|
33
|
+
---
|
34
|
+
### Section 2: Creating a New Agent Project
|
35
|
+
|
36
|
+
Start by creating a new agent project from a predefined template. This process supports both interactive and fully automated setup.
|
37
|
+
|
38
|
+
**Prerequisites:**
|
39
|
+
Before you begin, ensure you have `uv`/`uvx`, `gcloud` CLI, `terraform`, `git`, and `gh` CLI (for automated CI/CD setup) installed and authenticated.
|
40
|
+
|
41
|
+
**Installing the `agent-starter-pack` CLI:**
|
42
|
+
Choose one method to get the `agent-starter-pack` command:
|
43
|
+
|
44
|
+
1. **`uvx` (Recommended for Zero-Install/Automation):** Run directly without prior installation.
|
45
|
+
```bash
|
46
|
+
uvx agent-starter-pack create ...
|
47
|
+
```
|
48
|
+
2. **Virtual Environment (`pip` or `uv`):**
|
49
|
+
```bash
|
50
|
+
pip install agent-starter-pack
|
51
|
+
```
|
52
|
+
3. **Persistent CLI Install (`pipx` or `uv tool`):** Installs globally in an isolated environment.
|
53
|
+
|
54
|
+
---
|
55
|
+
### `agent-starter-pack create` Command
|
56
|
+
|
57
|
+
Generates a new agent project directory based on a chosen template and configuration.
|
58
|
+
|
59
|
+
**Usage:**
|
60
|
+
```bash
|
61
|
+
agent-starter-pack create PROJECT_NAME [OPTIONS]
|
62
|
+
```
|
63
|
+
|
64
|
+
**Arguments:**
|
65
|
+
* `PROJECT_NAME`: Name for your new project directory and base for GCP resource naming.
|
66
|
+
|
67
|
+
**Key Options:**
|
68
|
+
* `-a, --agent`: Agent template (e.g., `adk_base`, `agentic_rag`).
|
69
|
+
* `-d, --deployment-target`: Target deployment environment (`cloud_run` or `agent_engine`).
|
70
|
+
* `-ds, --datastore`: For RAG agents, the datastore (`vertex_ai_search` or `vertex_ai_vector_search`).
|
71
|
+
* `-i, --include-data-ingestion`: Include data ingestion pipeline scaffolding.
|
72
|
+
* `--region`: GCP region (e.g., `us-central1`).
|
73
|
+
* `--auto-approve`: **Skips all interactive prompts (crucial for automation).**
|
74
|
+
* `--debug`: Enables debug logging during creation.
|
75
|
+
|
76
|
+
**Automated Creation Example:**
|
77
|
+
```bash
|
78
|
+
uvx agent-starter-pack create my-automated-agent \
|
79
|
+
-a adk_base \
|
80
|
+
-d cloud_run \
|
81
|
+
--region us-central1 \
|
82
|
+
--auto-approve
|
83
|
+
```
|
84
|
+
|
85
|
+
---
|
86
|
+
|
87
|
+
### Available Agent Templates
|
88
|
+
|
89
|
+
Templates for the `create` command (via `-a` or `--agent`):
|
90
|
+
|
91
|
+
| Agent Name | Description |
|
92
|
+
| :--------------------- | :------------------------------------------- |
|
93
|
+
| `adk_base` | Base ReAct agent (ADK) |
|
94
|
+
| `adk_gemini_fullstack` | Production-ready fullstack research agent |
|
95
|
+
| `agentic_rag` | RAG agent for document retrieval & Q&A |
|
96
|
+
| `langgraph_base_react` | Base ReAct agent (LangGraph) |
|
97
|
+
| `crewai_coding_crew` | Multi-agent collaborative coding assistance |
|
98
|
+
| `live_api` | Real-time multimodal RAG agent |
|
99
|
+
|
100
|
+
---
|
101
|
+
|
102
|
+
### Including a Data Ingestion Pipeline (for RAG agents)
|
103
|
+
|
104
|
+
For RAG agents needing custom document search, enabling this option automates loading, chunking, embedding documents with Vertex AI, and storing them in a vector database.
|
105
|
+
|
106
|
+
**How to enable:**
|
107
|
+
```bash
|
108
|
+
uvx agent-starter-pack create my-rag-agent \
|
109
|
+
-a agentic_rag \
|
110
|
+
-d cloud_run \
|
111
|
+
-i \
|
112
|
+
-ds vertex_ai_search \
|
113
|
+
--auto-approve
|
114
|
+
```
|
115
|
+
**Post-creation:** Follow your new project's `data_ingestion/README.md` to deploy the necessary infrastructure.
|
116
|
+
|
117
|
+
---
|
118
|
+
### Section 3: Development & Automated Deployment Workflow
|
119
|
+
---
|
120
|
+
|
121
|
+
This section describes the end-to-end lifecycle of an agent, with emphasis on automation.
|
122
|
+
|
123
|
+
|
124
|
+
### 1. Local Development & Iteration
|
125
|
+
|
126
|
+
Once your project is created, navigate into its directory to begin development.
|
127
|
+
|
128
|
+
**First, install dependencies (run once):**
|
129
|
+
```bash
|
130
|
+
make install
|
131
|
+
```
|
132
|
+
|
133
|
+
**Next, test your agent. The recommended method is to use a programmatic script.**
|
134
|
+
|
135
|
+
#### Programmatic Testing (Recommended Workflow)
|
136
|
+
|
137
|
+
This method allows for quick, automated validation of your agent's logic.
|
138
|
+
|
139
|
+
1. **Create a script:** In the project's root directory, create a Python script named `run_agent.py`.
|
140
|
+
2. **Invoke the agent:** In the script, write code to programmatically call your agent with sample input and `print()` the output for inspection.
|
141
|
+
* **Guidance:** If you're unsure or no guidance exists, you can look at files in the `tests/` directory for examples of how to import and call the agent's main function.
|
142
|
+
* **Important:** This script is for simple validation. **Assertions are not required**, and you should not create a formal `pytest` file.
|
143
|
+
3. **Run the test:** Execute your script from the terminal using `uv`.
|
144
|
+
```bash
|
145
|
+
uv run python run_agent.py
|
146
|
+
```
|
147
|
+
You can keep the test file for future testing.
|
148
|
+
|
149
|
+
#### Manual Testing with the UI Playground (Optional)
|
150
|
+
|
151
|
+
If the user needs to interact with your agent manually in a chat interface for debugging:
|
152
|
+
|
153
|
+
1. Run the following command to start the local web UI:
|
154
|
+
```bash
|
155
|
+
make playground
|
156
|
+
```
|
157
|
+
This is useful for human-in-the-loop testing and features hot-reloading.
|
158
|
+
|
159
|
+
### 2. Deploying to a Cloud Development Environment
|
160
|
+
Before setting up full CI/CD, you can deploy to a personal cloud dev environment.
|
161
|
+
|
162
|
+
1. **Set Project:** `gcloud config set project YOUR_DEV_PROJECT_ID`
|
163
|
+
2. **Provision Resources:** `make setup-dev-env` (uses Terraform).
|
164
|
+
3. **Deploy Backend:** `make backend` (builds and deploys the agent).
|
165
|
+
|
166
|
+
### 3. Automated Production-Ready Deployment with CI/CD
|
167
|
+
For reliable deployments, the `setup-cicd` command streamlines the entire process. It creates a GitHub repo, connects it to Cloud Build, provisions staging/prod infrastructure, and configures deployment triggers.
|
168
|
+
|
169
|
+
**Automated CI/CD Setup Example (Recommended):**
|
170
|
+
```bash
|
171
|
+
# Run from the project root. This command will guide you or can be automated with flags.
|
172
|
+
uvx agent-starter-pack setup-cicd
|
173
|
+
```
|
174
|
+
|
175
|
+
**CI/CD Workflow Logic:**
|
176
|
+
* **On Pull Request:** CI pipeline runs tests.
|
177
|
+
* **On Merge to `main`:** CD pipeline deploys to staging.
|
178
|
+
* **Manual Approval:** A manual approval step triggers the production deployment.
|
179
|
+
|
180
|
+
---
|
181
|
+
### Section 4: Key Features & Customization
|
182
|
+
---
|
183
|
+
|
184
|
+
### Deploying with a User Interface (UI)
|
185
|
+
* **Unified Deployment (for Dev/Test):** The backend and frontend can be packaged and served from a single Cloud Run service, secured with Identity-Aware Proxy (IAP).
|
186
|
+
* **Deploying with UI:** `make backend IAP=true`
|
187
|
+
* **Access Control:** After deploying with IAP, grant users the `IAP-secured Web App User` role in IAM to give them access.
|
188
|
+
|
189
|
+
### Monitoring & Observability
|
190
|
+
* **Technology:** Uses OpenTelemetry to emit events to Google Cloud Trace and Logging.
|
191
|
+
* **Custom Tracer:** A custom tracer in `app/utils/tracing.py` handles large payloads by linking to GCS, overcoming default service limits.
|
192
|
+
* **Infrastructure:** A Log Router to sink data to BigQuery is provisioned by Terraform.
|
193
|
+
|
194
|
+
---
|
195
|
+
### Section 5: CLI Reference for CI/CD Setup
|
196
|
+
---
|
197
|
+
|
198
|
+
### `agent-starter-pack setup-cicd`
|
199
|
+
Automates the entire CI/CD setup for a project on GitHub.
|
200
|
+
|
201
|
+
**Usage:**
|
202
|
+
```bash
|
203
|
+
uvx agent-starter-pack setup-cicd [OPTIONS]
|
204
|
+
```
|
205
|
+
**Prerequisites:** Run from the project root. `uv`, `gh` CLI, `gcloud` CLI, and `terraform` must be installed and authenticated. Requires `Owner` role on the GCP projects.
|
206
|
+
|
207
|
+
**Key Automation Options:**
|
208
|
+
* `--staging-project`, `--prod-project`, `--cicd-project`, `--dev-project`
|
209
|
+
* `--region`, `--repository-name`, `--repository-owner`
|
210
|
+
* `--auto-approve`: **Crucial for automation.** Skips all interactive prompts.
|
211
|
+
|
212
|
+
**Automated Example:**
|
213
|
+
```bash
|
214
|
+
uvx agent-starter-pack setup-cicd \
|
215
|
+
--staging-project t-starter-staging \
|
216
|
+
--prod-project t-starter-prod \
|
217
|
+
--repository-name my-adk-project-repo \
|
218
|
+
--repository-owner eliasecchig \
|
219
|
+
--auto-approve
|
220
|
+
```
|
221
|
+
|
222
|
+
---
|
223
|
+
### Section 6: Operational Guidelines for Coding Agents
|
224
|
+
|
225
|
+
These guidelines are essential for interacting with the Agent Starter Pack project effectively.
|
226
|
+
|
227
|
+
---
|
228
|
+
|
229
|
+
### Principle 1: Code Preservation & Isolation
|
230
|
+
|
231
|
+
When executing code modifications using tools like `replace` or `write_file`, your paramount objective is surgical precision. You **must alter only the code segments directly targeted** by the user's request, while **strictly preserving all surrounding and unrelated code.**
|
232
|
+
|
233
|
+
**Mandatory Pre-Execution Verification:**
|
234
|
+
|
235
|
+
Before finalizing any `new_string` for a `replace` operation, meticulously verify the following:
|
236
|
+
|
237
|
+
1. **Target Identification:** Clearly define the exact lines or expressions to be changed, based *solely* on the user's explicit instructions.
|
238
|
+
2. **Preservation Check:** Compare your proposed `new_string` against the `old_string`. Ensure all code, configuration values (e.g., `model`, `version`, `api_key`), comments, and formatting *outside* the identified target remain identical and verbatim.
|
239
|
+
|
240
|
+
**Example: Adhering to Preservation**
|
241
|
+
|
242
|
+
* **User Request:** "Change the agent's instruction to be a recipe suggester."
|
243
|
+
* **Original Code Snippet:**
|
244
|
+
```python
|
245
|
+
root_agent = Agent(
|
246
|
+
name="root_agent",
|
247
|
+
model="gemini-2.5-flash",
|
248
|
+
instruction="You are a helpful AI assistant."
|
249
|
+
)
|
250
|
+
```
|
251
|
+
* **Incorrect Modification (VIOLATION):**
|
252
|
+
```python
|
253
|
+
root_agent = Agent(
|
254
|
+
name="recipe_suggester",
|
255
|
+
model="gemini-1.5-flash", # UNINTENDED MUTATION - model was not requested to change
|
256
|
+
instruction="You are a recipe suggester."
|
257
|
+
)
|
258
|
+
```
|
259
|
+
* **Correct Modification (COMPLIANT):**
|
260
|
+
```python
|
261
|
+
root_agent = Agent(
|
262
|
+
name="recipe_suggester", # OK, related to new purpose
|
263
|
+
model="gemini-2.5-flash", # MUST be preserved
|
264
|
+
instruction="You are a recipe suggester." # OK, the direct target
|
265
|
+
)
|
266
|
+
```
|
267
|
+
|
268
|
+
**Critical Error:** Failure to adhere to this preservation principle is a critical error. Always prioritize the integrity of existing, unchanged code over the convenience of rewriting entire blocks.
|
269
|
+
|
270
|
+
---
|
271
|
+
|
272
|
+
### Principle 2: Workflow & Execution Best Practices
|
273
|
+
|
274
|
+
* **Standard Workflow:**
|
275
|
+
The validated end-to-end process is: `create` → `test` → `setup-cicd` → push to deploy. Trust this high-level workflow as the default for developing and shipping agents.
|
276
|
+
|
277
|
+
* **Agent Testing:**
|
278
|
+
* **Avoid `make playground`** unless specifically instructed; it is designed for human interaction. Focus on programmatic testing.
|
279
|
+
|
280
|
+
* **Model Selection:**
|
281
|
+
* **When using Gemini, prefer the 2.5 model family** for optimal performance and capabilities: "gemini-2.5-pro" and "gemini-2.5-flash"
|
282
|
+
|
283
|
+
* **Running Python Commands:**
|
284
|
+
* Always use `uv` to execute Python commands within this repository (e.g., `uv run run_agent.py`).
|
285
|
+
* Ensure project dependencies are installed by running `make install` before executing scripts.
|
286
|
+
* Consult the project's `Makefile` and `README.md` for other useful development commands.
|
287
|
+
|
288
|
+
* **Further Reading & Troubleshooting:**
|
289
|
+
* For questions about specific frameworks (e.g., LangGraph) or Google Cloud products (e.g., Cloud Run), their official documentation and online resources are the best source of truth.
|
290
|
+
* **When encountering persistent errors or if you're unsure how to proceed after initial troubleshooting, a targeted Google Search is strongly recommended.** It is often the fastest way to find relevant documentation, community discussions, or direct solutions to your problem.
|
src/base_template/.gitignore
CHANGED
src/base_template/Makefile
CHANGED
@@ -1,10 +1,12 @@
|
|
1
|
+
# Install dependencies using uv package manager
|
1
2
|
install:
|
2
|
-
@command -v uv >/dev/null 2>&1 || { echo "uv is not installed. Installing uv..."; curl -LsSf https://astral.sh/uv/0.6.12/install.sh | sh; source
|
3
|
-
uv sync --dev{% if cookiecutter.agent_name != 'live_api' and "adk" not in cookiecutter.tags %} --extra streamlit{%- endif %} --extra jupyter
|
3
|
+
@command -v uv >/dev/null 2>&1 || { echo "uv is not installed. Installing uv..."; curl -LsSf https://astral.sh/uv/0.6.12/install.sh | sh; source $HOME/.local/bin/env; }
|
4
|
+
uv sync --dev{% if cookiecutter.agent_name != 'live_api' and "adk" not in cookiecutter.tags %} --extra streamlit{%- endif %} --extra jupyter{% if cookiecutter.agent_name == 'live_api' %} && npm --prefix frontend install{%- endif %}
|
4
5
|
{%- if cookiecutter.settings.get("commands", {}).get("override", {}).get("install") %} && {{cookiecutter.settings.get("commands", {}).get("override", {}).get("install")}}{%- endif %}
|
5
6
|
{%- if cookiecutter.settings.get("commands", {}).get("extra", {}) %}
|
6
7
|
{%- for cmd_name, cmd_value in cookiecutter.settings.get("commands", {}).get("extra", {}).items() %}
|
7
8
|
|
9
|
+
# {{ cmd_value.get("description") }}
|
8
10
|
{{ cmd_name }}:
|
9
11
|
{%- if cmd_value is mapping %}
|
10
12
|
{%- if cmd_value.command is mapping and cookiecutter.deployment_target in cmd_value.command %}
|
@@ -17,6 +19,7 @@ install:
|
|
17
19
|
{%- endif %}
|
18
20
|
{%- endfor %}{%- endif %}
|
19
21
|
|
22
|
+
# Launch local dev playground
|
20
23
|
playground:
|
21
24
|
{%- if cookiecutter.settings.get("commands", {}).get("override", {}).get("playground") %}
|
22
25
|
{{cookiecutter.settings.get("commands", {}).get("override", {}).get("playground")}}
|
@@ -44,10 +47,14 @@ playground:
|
|
44
47
|
{%- endif %}
|
45
48
|
{%- endif %}
|
46
49
|
|
50
|
+
# Deploy the agent remotely
|
51
|
+
{%- if cookiecutter.deployment_target == 'cloud_run' %}
|
52
|
+
# Usage: make backend [IAP=true] [PORT=8080] - Set IAP=true to enable Identity-Aware Proxy, PORT to specify container port
|
53
|
+
{%- endif %}
|
47
54
|
backend:
|
48
55
|
{%- if cookiecutter.deployment_target == 'cloud_run' %}
|
49
56
|
PROJECT_ID=$$(gcloud config get-value project) && \
|
50
|
-
gcloud run deploy {{cookiecutter.project_name}} \
|
57
|
+
gcloud beta run deploy {{cookiecutter.project_name}} \
|
51
58
|
--source . \
|
52
59
|
--memory "4Gi" \
|
53
60
|
--project $$PROJECT_ID \
|
@@ -55,31 +62,37 @@ backend:
|
|
55
62
|
--no-allow-unauthenticated \
|
56
63
|
--labels "created-by=adk" \
|
57
64
|
--set-env-vars \
|
58
|
-
"COMMIT_SHA=$(shell git rev-parse HEAD){%- if cookiecutter.data_ingestion %}{%- if cookiecutter.datastore_type == "vertex_ai_search" %},DATA_STORE_ID={{cookiecutter.project_name}}-datastore,DATA_STORE_REGION=us{%- elif cookiecutter.datastore_type == "vertex_ai_vector_search" %},VECTOR_SEARCH_INDEX={{cookiecutter.project_name}}-vector-search,VECTOR_SEARCH_INDEX_ENDPOINT={{cookiecutter.project_name}}-vector-search-endpoint,VECTOR_SEARCH_BUCKET=$$PROJECT_ID-{{cookiecutter.project_name}}-vs{%- endif %}{%- endif %}"
|
65
|
+
"COMMIT_SHA=$(shell git rev-parse HEAD){%- if cookiecutter.data_ingestion %}{%- if cookiecutter.datastore_type == "vertex_ai_search" %},DATA_STORE_ID={{cookiecutter.project_name}}-datastore,DATA_STORE_REGION=us{%- elif cookiecutter.datastore_type == "vertex_ai_vector_search" %},VECTOR_SEARCH_INDEX={{cookiecutter.project_name}}-vector-search,VECTOR_SEARCH_INDEX_ENDPOINT={{cookiecutter.project_name}}-vector-search-endpoint,VECTOR_SEARCH_BUCKET=$$PROJECT_ID-{{cookiecutter.project_name}}-vs{%- endif %}{%- endif %}" \
|
66
|
+
$(if $(IAP),--iap) \
|
67
|
+
$(if $(PORT),--port=$(PORT))
|
59
68
|
{%- elif cookiecutter.deployment_target == 'agent_engine' %}
|
60
69
|
# Export dependencies to requirements file using uv export.
|
61
|
-
uv export --no-hashes --no-header --no-dev --no-emit-project --no-annotate
|
62
|
-
uv export --no-hashes --no-header --no-dev --no-emit-project
|
70
|
+
uv export --no-hashes --no-header --no-dev --no-emit-project --no-annotate > .requirements.txt 2>/dev/null || \
|
71
|
+
uv export --no-hashes --no-header --no-dev --no-emit-project > .requirements.txt && uv run app/agent_engine_app.py
|
63
72
|
{%- endif %}
|
64
73
|
{%- if cookiecutter.deployment_target == 'cloud_run' %}
|
65
74
|
|
75
|
+
# Launch local development server with hot-reload
|
66
76
|
local-backend:
|
67
77
|
uv run uvicorn app.server:app --host 0.0.0.0 --port 8000 --reload
|
68
78
|
{%- endif %}
|
69
79
|
{%- if cookiecutter.deployment_target == 'cloud_run' %}
|
70
80
|
{%- if cookiecutter.agent_name == 'live_api' %}
|
71
81
|
|
82
|
+
# Start the frontend UI for development
|
72
83
|
ui:
|
73
84
|
PORT=8501 npm --prefix frontend start
|
74
85
|
{%- endif %}
|
75
86
|
{%- endif %}
|
76
87
|
|
88
|
+
# Set up development environment resources using Terraform
|
77
89
|
setup-dev-env:
|
78
90
|
PROJECT_ID=$$(gcloud config get-value project) && \
|
79
91
|
(cd deployment/terraform/dev && terraform init && terraform apply --var-file vars/env.tfvars --var dev_project_id=$$PROJECT_ID --auto-approve)
|
80
92
|
|
81
93
|
{%- if cookiecutter.data_ingestion %}
|
82
94
|
|
95
|
+
# Run the data ingestion pipeline for RAG capabilities
|
83
96
|
data-ingestion:
|
84
97
|
PROJECT_ID=$$(gcloud config get-value project) && \
|
85
98
|
(cd data_ingestion && uv run data_ingestion_pipeline/submit_pipeline.py \
|
@@ -98,9 +111,11 @@ data-ingestion:
|
|
98
111
|
--pipeline-name="data-ingestion-pipeline")
|
99
112
|
{%- endif %}
|
100
113
|
|
114
|
+
# Run unit and integration tests
|
101
115
|
test:
|
102
116
|
uv run pytest tests/unit && uv run pytest tests/integration
|
103
117
|
|
118
|
+
# Run code quality checks (codespell, ruff, mypy)
|
104
119
|
lint:
|
105
120
|
uv run codespell
|
106
121
|
uv run ruff check . --diff
|
@@ -21,7 +21,7 @@ steps:
|
|
21
21
|
- -c
|
22
22
|
- |
|
23
23
|
cd data_ingestion && pip install uv==0.6.12 --user && cd data_ingestion_pipeline && \
|
24
|
-
uv sync --
|
24
|
+
uv sync --locked && uv run python submit_pipeline.py
|
25
25
|
env:
|
26
26
|
- "PIPELINE_ROOT=${_PIPELINE_GCS_ROOT}"
|
27
27
|
- "REGION=${_REGION}"
|
@@ -78,7 +78,7 @@ steps:
|
|
78
78
|
args:
|
79
79
|
- "-c"
|
80
80
|
- |
|
81
|
-
pip install uv==0.6.12 --user && uv sync --
|
81
|
+
pip install uv==0.6.12 --user && uv sync --locked
|
82
82
|
env:
|
83
83
|
- 'PATH=/usr/local/bin:/usr/bin:~/.local/bin'
|
84
84
|
|
@@ -88,7 +88,7 @@ steps:
|
|
88
88
|
args:
|
89
89
|
- "-c"
|
90
90
|
- |
|
91
|
-
uv export --no-hashes --no-sources --no-header --no-dev --no-emit-project --no-annotate --
|
91
|
+
uv export --no-hashes --no-sources --no-header --no-dev --no-emit-project --no-annotate --locked > .requirements.txt
|
92
92
|
uv run app/agent_engine_app.py \
|
93
93
|
--project ${_PROD_PROJECT_ID} \
|
94
94
|
--location ${_REGION} \
|
@@ -21,7 +21,7 @@ steps:
|
|
21
21
|
- -c
|
22
22
|
- |
|
23
23
|
cd data_ingestion && pip install uv==0.6.12 --user && cd data_ingestion_pipeline && \
|
24
|
-
uv sync --
|
24
|
+
uv sync --locked && uv run python submit_pipeline.py
|
25
25
|
env:
|
26
26
|
- "PIPELINE_ROOT=${_PIPELINE_GCS_ROOT}"
|
27
27
|
- "REGION=${_REGION}"
|
@@ -111,7 +111,7 @@ steps:
|
|
111
111
|
args:
|
112
112
|
- "-c"
|
113
113
|
- |
|
114
|
-
pip install uv==0.6.12 --user && uv sync --
|
114
|
+
pip install uv==0.6.12 --user && uv sync --locked
|
115
115
|
env:
|
116
116
|
- 'PATH=/usr/local/bin:/usr/bin:~/.local/bin'
|
117
117
|
|
@@ -121,7 +121,7 @@ steps:
|
|
121
121
|
args:
|
122
122
|
- "-c"
|
123
123
|
- |
|
124
|
-
uv export --no-hashes --no-sources --no-header --no-dev --no-emit-project --no-annotate --
|
124
|
+
uv export --no-hashes --no-sources --no-header --no-dev --no-emit-project --no-annotate --locked > .requirements.txt
|
125
125
|
uv run app/agent_engine_app.py \
|
126
126
|
--project ${_STAGING_PROJECT_ID} \
|
127
127
|
--location ${_REGION} \
|
@@ -149,7 +149,7 @@ steps:
|
|
149
149
|
{%- if cookiecutter.deployment_target == 'cloud_run' %}
|
150
150
|
export _ID_TOKEN=$(cat id_token.txt)
|
151
151
|
export _STAGING_URL=$(cat staging_url.txt)
|
152
|
-
pip install uv==0.6.12 --user && uv sync --
|
152
|
+
pip install uv==0.6.12 --user && uv sync --locked
|
153
153
|
{%- elif cookiecutter.deployment_target == 'agent_engine' %}
|
154
154
|
export _AUTH_TOKEN=$(cat auth_token.txt)
|
155
155
|
{%- endif %}
|
src/base_template/pyproject.toml
CHANGED
@@ -16,11 +16,11 @@ dependencies = [
|
|
16
16
|
{%- endif %}
|
17
17
|
"google-cloud-logging~=3.11.4",
|
18
18
|
{%- if cookiecutter.deployment_target == 'cloud_run' %}
|
19
|
-
"google-cloud-aiplatform[evaluation]~=1.
|
19
|
+
"google-cloud-aiplatform[evaluation]~=1.99.0",
|
20
20
|
"fastapi~=0.115.8",
|
21
21
|
"uvicorn~=0.34.0"
|
22
22
|
{%- elif cookiecutter.deployment_target == 'agent_engine' %}
|
23
|
-
"google-cloud-aiplatform[evaluation,agent-engines]~=1.
|
23
|
+
"google-cloud-aiplatform[evaluation,agent-engines]~=1.99.0"
|
24
24
|
{%- endif %}
|
25
25
|
]
|
26
26
|
{% if cookiecutter.deployment_target == 'cloud_run' %}
|
src/cli/utils/template.py
CHANGED
@@ -12,6 +12,7 @@
|
|
12
12
|
# See the License for the specific language governing permissions and
|
13
13
|
# limitations under the License.
|
14
14
|
|
15
|
+
import json
|
15
16
|
import logging
|
16
17
|
import os
|
17
18
|
import pathlib
|
@@ -23,7 +24,7 @@ from typing import Any
|
|
23
24
|
import yaml
|
24
25
|
from cookiecutter.main import cookiecutter
|
25
26
|
from rich.console import Console
|
26
|
-
from rich.prompt import Prompt
|
27
|
+
from rich.prompt import IntPrompt, Prompt
|
27
28
|
|
28
29
|
from src.cli.utils.version import get_current_version
|
29
30
|
|
@@ -197,8 +198,6 @@ def prompt_deployment_target(agent_name: str) -> str:
|
|
197
198
|
description = info.get("description", "")
|
198
199
|
console.print(f"{idx}. [bold]{display_name}[/] - [dim]{description}[/]")
|
199
200
|
|
200
|
-
from rich.prompt import IntPrompt
|
201
|
-
|
202
201
|
choice = IntPrompt.ask(
|
203
202
|
"\nEnter the number of your deployment target choice",
|
204
203
|
default=1,
|
@@ -510,6 +509,22 @@ def process_template(
|
|
510
509
|
frontend_type = settings.get("frontend_type", DEFAULT_FRONTEND)
|
511
510
|
tags = settings.get("tags", ["None"])
|
512
511
|
|
512
|
+
# Load adk-cheatsheet.md and llm.txt for injection
|
513
|
+
adk_cheatsheet_path = (
|
514
|
+
pathlib.Path(__file__).parent.parent.parent
|
515
|
+
/ "resources"
|
516
|
+
/ "docs"
|
517
|
+
/ "adk-cheatsheet.md"
|
518
|
+
)
|
519
|
+
with open(adk_cheatsheet_path) as f:
|
520
|
+
adk_cheatsheet_content = f.read()
|
521
|
+
|
522
|
+
llm_txt_path = (
|
523
|
+
pathlib.Path(__file__).parent.parent.parent.parent / "llm.txt"
|
524
|
+
)
|
525
|
+
with open(llm_txt_path) as f:
|
526
|
+
llm_txt_content = f.read()
|
527
|
+
|
513
528
|
cookiecutter_config = {
|
514
529
|
"project_name": "my-project",
|
515
530
|
"agent_name": agent_name,
|
@@ -525,11 +540,12 @@ def process_template(
|
|
525
540
|
"extra_dependencies": [extra_deps],
|
526
541
|
"data_ingestion": include_data_ingestion,
|
527
542
|
"datastore_type": datastore if datastore else "",
|
543
|
+
"adk_cheatsheet": adk_cheatsheet_content,
|
544
|
+
"llm_txt": llm_txt_content,
|
528
545
|
"_copy_without_render": [
|
529
546
|
"*.ipynb", # Don't render notebooks
|
530
547
|
"*.json", # Don't render JSON files
|
531
548
|
"frontend/*", # Don't render frontend directory
|
532
|
-
# "tests/*", # Don't render tests directory
|
533
549
|
"notebooks/*", # Don't render notebooks directory
|
534
550
|
".git/*", # Don't render git directory
|
535
551
|
"__pycache__/*", # Don't render cache
|
@@ -537,15 +553,12 @@ def process_template(
|
|
537
553
|
".pytest_cache/*",
|
538
554
|
".venv/*",
|
539
555
|
"*templates.py", # Don't render templates files
|
540
|
-
|
541
|
-
"
|
542
|
-
"!README.md", # DO render README.md
|
556
|
+
# Don't render agent.py unless it's agentic_rag
|
557
|
+
"app/agent.py" if agent_name != "agentic_rag" else "",
|
543
558
|
],
|
544
559
|
}
|
545
560
|
|
546
561
|
with open(cookiecutter_template / "cookiecutter.json", "w") as f:
|
547
|
-
import json
|
548
|
-
|
549
562
|
json.dump(cookiecutter_config, f, indent=4)
|
550
563
|
|
551
564
|
logging.debug(f"Template structure created at {cookiecutter_template}")
|