Skip to content

Commit a7ee91e

Browse files
authored
Merge branch 'main' into new-agent-card
2 parents 7e84520 + 1979dcf commit a7ee91e

66 files changed

Lines changed: 4015 additions & 961 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/discussion_answering.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,5 @@ jobs:
4141
OWNER: 'google'
4242
REPO: 'adk-python'
4343
INTERACTIVE: 0
44-
DISCUSSION_NUMBER: ${{ github.event.discussion.number }}
4544
PYTHONPATH: contributing/samples
46-
run: python -m adk_answering_agent.main
45+
run: python -m adk_answering_agent.main --discussion '${{ toJson(github.event.discussion) }}'

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ You can install the latest stable version of ADK using `pip`:
6464
pip install google-adk
6565
```
6666

67-
The release cadence is weekly.
67+
The release cadence is roughly bi-weekly.
6868

6969
This version is recommended for most users as it represents the most recent official release.
7070

contributing/samples/adk_agent_builder_assistant/instruction_embedded.template

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ Always reference this schema when creating configurations to ensure compliance.
2626
## Workflow Guidelines
2727

2828
### 1. Discovery Phase
29-
- **ASK FOR ROOT DIRECTORY** upfront to establish working context
29+
- **ROOT DIRECTORY ESTABLISHMENT**:
30+
* **FIRST**: Check SESSION CONTEXT section below for "Established Root Directory"
31+
* **IF ESTABLISHED**: Use the existing session root directory - DO NOT ask again
32+
* **IF NOT ESTABLISHED**: Ask user for root directory to establish working context
3033
- **MODEL PREFERENCE**: Always ask for explicit model confirmation when LlmAgent(s) will be needed
3134
* **When to ask**: After analyzing requirements and deciding that LlmAgent is needed for the solution
3235
* **MANDATORY CONFIRMATION**: Say "Please confirm what model you want to use" - do NOT assume or suggest defaults
@@ -159,8 +162,8 @@ Always reference this schema when creating configurations to ensure compliance.
159162
### ADK Knowledge and Research Tools
160163

161164
#### Web-based Research
162-
- **google_search_agent**: Search web for ADK examples, patterns, and documentation (built-in tool via sub-agent)
163-
- **url_context_agent**: Fetch and analyze content from URLs - GitHub, docs, examples (built-in tool via sub-agent)
165+
- **google_search_agent**: Search web for ADK examples, patterns, and documentation (returns full page content as results)
166+
- **url_context_agent**: Fetch content from specific URLs when mentioned in search results or user queries (use only when specific URLs need additional fetching)
164167

165168
#### Local ADK Source Search
166169
- **search_adk_source**: Search ADK source code using regex patterns for precise code lookups
@@ -200,15 +203,17 @@ Always reference this schema when creating configurations to ensure compliance.
200203
* Analyze class relationships and usage patterns
201204

202205
**For External Examples and Documentation:**
203-
- **google_search_agent**: Search to FIND relevant content and examples
206+
- **google_search_agent**: Search and analyze web content (returns full page content, not just URLs)
204207
* Search within key repositories: "site:github.com/google/adk-python ADK SequentialAgent examples"
205208
* Search documentation: "site:github.com/google/adk-docs agent configuration patterns"
206209
* Search sample repository: "site:github.com/google/adk-samples multi-agent workflow"
207210
* General searches: "ADK workflow patterns", "ADK tool integration patterns", "ADK project structure"
208-
- **url_context_agent**: Fetch and analyze FULL CONTENT of specific URLs identified through search
209-
* Use after google_search_agent finds relevant URLs
210-
* Fetch specific GitHub files, documentation pages, or examples
211-
* Analyze complete implementation details and extract patterns
211+
* Returns complete page content as search results - no need for additional URL fetching
212+
- **url_context_agent**: Fetch specific URLs only when:
213+
* Specific URLs are mentioned in search results that need additional content
214+
* User provides specific URLs in their query
215+
* You need to fetch content from URLs found within google_search results
216+
* NOT needed for general searches - google_search_agent already provides page content
212217

213218
**Research for Agent Building:**
214219
- When user requests complex multi-agent systems: Search for similar patterns in samples

contributing/samples/adk_agent_builder_assistant/instruction_query.template

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@ Always use the query_schema tool when you need specific ADK AgentConfig schema i
2929
## Workflow Guidelines
3030

3131
### 1. Discovery Phase
32-
- **ASK FOR ROOT DIRECTORY** upfront to establish working context
32+
- **ROOT DIRECTORY ESTABLISHMENT**:
33+
* **FIRST**: Check SESSION CONTEXT section below for "Established Root Directory"
34+
* **IF ESTABLISHED**: Use the existing session root directory - DO NOT ask again
35+
* **IF NOT ESTABLISHED**: Ask user for root directory to establish working context
3336
- **MODEL PREFERENCE**: Only ask for model preference when you determine that LlmAgent(s) will be needed
3437
* **When to ask**: After analyzing requirements and deciding that LlmAgent is needed for the solution
3538
* **DEFAULT**: Use "{default_model}" (your current model) if user doesn't specify
@@ -159,11 +162,16 @@ You have access to comprehensive tools for:
159162
3. **query_schema** - Query AgentConfig schema for field definitions
160163

161164
**For External Examples and Documentation:**
162-
- **google_search_agent**: Search to FIND relevant content and examples
165+
- **google_search_agent**: Search and analyze web content (returns full page content, not just URLs)
163166
* Search within key repositories: "site:github.com/google/adk-python ADK SequentialAgent examples"
164167
* Search documentation: "site:github.com/google/adk-docs agent configuration patterns"
165168
* General searches: "ADK workflow patterns", "ADK tool integration patterns"
166-
- **url_context_agent**: Fetch and analyze FULL CONTENT of specific URLs identified through search
169+
* Returns complete page content as search results - no need for additional URL fetching
170+
- **url_context_agent**: Fetch specific URLs only when:
171+
* Specific URLs are mentioned in search results that need additional content
172+
* User provides specific URLs in their query
173+
* You need to fetch content from URLs found within google_search results
174+
* NOT needed for general searches - google_search_agent already provides page content
167175

168176
**Research for Agent Building:**
169177
- When user requests complex multi-agent systems: Search for similar patterns in samples
@@ -175,7 +183,7 @@ You have access to comprehensive tools for:
175183

176184
### When Creating Python Tools or Callbacks:
177185
1. **Always search for current examples first**: Use google_search_agent to find "ADK tool_context examples" or "ADK callback_context examples"
178-
2. **Reference contributing/samples**: Use url_context_agent to fetch specific examples from https://github.com/google/adk-python/tree/main/contributing/samples
186+
2. **Reference contributing/samples**: Use google_search_agent to find examples, or url_context_agent only if specific URLs are identified that need additional content
179187
3. **Look for similar patterns**: Search for tools or callbacks that match your use case
180188
4. **Use snake_case**: Function names should be snake_case (e.g., `check_prime`, `roll_dice`)
181189
5. **Remove tool suffix**: Don't add "_tool" to function names
@@ -184,12 +192,14 @@ You have access to comprehensive tools for:
184192
8. **Follow current ADK patterns**: Always search for and reference the latest examples from contributing/samples
185193

186194
### Research and Examples:
187-
- Use google_search_agent to find "ADK [use-case] examples" or "ADK [pattern] configuration"
188-
- Use url_context_agent to fetch examples from:
189-
* GitHub repositories: https://github.com/google/adk-samples/
190-
* Contributing examples: https://github.com/google/adk-python/tree/main/contributing
191-
* Documentation: https://github.com/google/adk-docs
192-
* Community examples and patterns
195+
- Use google_search_agent to find "ADK [use-case] examples" or "ADK [pattern] configuration" (returns full content)
196+
- Use url_context_agent only when:
197+
* Specific URLs are found in search results that need additional content
198+
* User provides specific URLs to analyze
199+
* You need to fetch specific examples from identified URLs:
200+
* GitHub repositories: https://github.com/google/adk-samples/
201+
* Contributing examples: https://github.com/google/adk-python/tree/main/contributing
202+
* Documentation: https://github.com/google/adk-docs
193203
- Adapt existing patterns to user requirements while maintaining compliance
194204

195205
## Important ADK Requirements

contributing/samples/adk_answering_agent/README.md

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This agent can be operated in three distinct modes:
66

77
- An interactive mode for local use.
88
- A batch script mode for oncall use.
9-
- A fully automated GitHub Actions workflow (TBD).
9+
- A fully automated GitHub Actions workflow.
1010

1111
---
1212

@@ -31,26 +31,37 @@ This will start a local server and provide a URL to access the agent's web inter
3131

3232
## Batch Script Mode
3333

34-
The `answer_discussions.py` is created for ADK oncall team to batch process discussions.
34+
The `main.py` script supports batch processing for ADK oncall team to process discussions.
3535

3636
### Features
37-
* **Batch Process**: Taken either a number as the count of the recent discussions or a list of discussion numbers, the script will invoke the agent to answer all the specified discussions in one single run.
37+
* **Single Discussion**: Process a specific discussion by providing its number.
38+
* **Batch Process**: Process the N most recently updated discussions.
39+
* **Direct Discussion Data**: Process a discussion using JSON data directly (optimized for GitHub Actions).
3840

39-
### Running in Interactive Mode
40-
To run the agent in batch script mode, first set the required environment variables. Then, execute the following command in your terminal:
41+
### Running in Batch Script Mode
42+
To run the agent in batch script mode, first set the required environment variables. Then, execute one of the following commands:
4143

4244
```bash
4345
export PYTHONPATH=contributing/samples
44-
python -m adk_answering_agent.answer_discussions --numbers 27 36 # Answer specified discussions
45-
```
4646

47-
Or `python -m adk_answering_agent.answer_discussions --recent 10` to answer the 10 most recent updated discussions.
47+
# Answer a specific discussion
48+
python -m adk_answering_agent.main --discussion_number 27
49+
50+
# Answer the 10 most recent updated discussions
51+
python -m adk_answering_agent.main --recent 10
52+
53+
# Answer a discussion using direct JSON data (saves API calls)
54+
python -m adk_answering_agent.main --discussion '{"number": 27, "title": "How to...", "body": "I need help with...", "author": {"login": "username"}}'
55+
```
4856

4957
---
5058

5159
## GitHub Workflow Mode
5260

53-
The `main.py` is reserved for the Github Workflow. The detailed setup for the automatic workflow is TBD.
61+
The `main.py` script is automatically triggered by GitHub Actions when new discussions are created in the Q&A category. The workflow is configured in `.github/workflows/discussion_answering.yml` and automatically processes discussions using the `--discussion` flag with JSON data from the GitHub event payload.
62+
63+
### Optimization
64+
The GitHub Actions workflow passes discussion data directly from `github.event.discussion` using `toJson()`, eliminating the need for additional API calls to fetch discussion information that's already available in the event payload. This makes the workflow faster and more reliable.
5465

5566
---
5667

contributing/samples/adk_answering_agent/answer_discussions.py

Lines changed: 0 additions & 172 deletions
This file was deleted.

0 commit comments

Comments
 (0)