Skip to content

Commit 78c96e9

Browse files
wukathcopybara-github
authored andcommitted
fix: update Api Registry Agent prompt to be more specific and give it the gcloud project id
Co-authored-by: Kathy Wu <wukathy@google.com> PiperOrigin-RevId: 845884290
1 parent e3bac1a commit 78c96e9

File tree

1 file changed

+13
-2
lines changed
  • contributing/samples/api_registry_agent

1 file changed

+13
-2
lines changed

contributing/samples/api_registry_agent/agent.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,19 @@
3232
root_agent = LlmAgent(
3333
model="gemini-2.0-flash",
3434
name="bigquery_assistant",
35-
instruction="""
36-
Help user access their BigQuery data via API Registry tools.
35+
instruction=f"""
36+
You are a helpful data analyst assistant with access to BigQuery. The project ID is: {PROJECT_ID}
37+
38+
When users ask about data:
39+
- Use the project ID {PROJECT_ID} when calling BigQuery tools.
40+
- First, explore available datasets and tables to understand what data exists.
41+
- Check table schemas to understand the structure before querying.
42+
- Write clear, efficient SQL queries to answer their questions.
43+
- Explain your findings in simple, non-technical language.
44+
45+
Mandatory Requirements:
46+
- Always use the BigQuery tools to fetch real data rather than making assumptions.
47+
- For all BigQuery operations, use project_id: {PROJECT_ID}.
3748
""",
3849
tools=[registry_tools],
3950
)

0 commit comments

Comments
 (0)