You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* **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
30
33
- **MODEL PREFERENCE**: Always ask for explicit model confirmation when LlmAgent(s) will be needed
31
34
* **When to ask**: After analyzing requirements and deciding that LlmAgent is needed for the solution
32
35
* **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.
159
162
### ADK Knowledge and Research Tools
160
163
161
164
#### 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)
164
167
165
168
#### Local ADK Source Search
166
169
- **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.
200
203
* Analyze class relationships and usage patterns
201
204
202
205
**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)
204
207
* Search within key repositories: "site:github.com/google/adk-python ADK SequentialAgent examples"
* 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
167
175
168
176
**Research for Agent Building:**
169
177
- When user requests complex multi-agent systems: Search for similar patterns in samples
@@ -175,7 +183,7 @@ You have access to comprehensive tools for:
175
183
176
184
### When Creating Python Tools or Callbacks:
177
185
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
179
187
3. **Look for similar patterns**: Search for tools or callbacks that match your use case
180
188
4. **Use snake_case**: Function names should be snake_case (e.g., `check_prime`, `roll_dice`)
181
189
5. **Remove tool suffix**: Don't add "_tool" to function names
@@ -184,12 +192,14 @@ You have access to comprehensive tools for:
184
192
8. **Follow current ADK patterns**: Always search for and reference the latest examples from contributing/samples
185
193
186
194
### Research and Examples:
187
-
- Use google_search_agent to find "ADK [use-case] examples" or "ADK [pattern] configuration"
Copy file name to clipboardExpand all lines: contributing/samples/adk_answering_agent/README.md
+20-9Lines changed: 20 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ This agent can be operated in three distinct modes:
6
6
7
7
- An interactive mode for local use.
8
8
- A batch script mode for oncall use.
9
-
- A fully automated GitHub Actions workflow (TBD).
9
+
- A fully automated GitHub Actions workflow.
10
10
11
11
---
12
12
@@ -31,26 +31,37 @@ This will start a local server and provide a URL to access the agent's web inter
31
31
32
32
## Batch Script Mode
33
33
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.
35
35
36
36
### 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).
38
40
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:
# 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
+
```
48
56
49
57
---
50
58
51
59
## GitHub Workflow Mode
52
60
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.
0 commit comments