chore: import upstream snapshot with attribution
Continuous Integration / Pre-commit Linter (push) Has been cancelled
Continuous Integration / Mypy Check (Python 3.10) (push) Has been cancelled
Continuous Integration / Mypy Check (Python 3.11) (push) Has been cancelled
Continuous Integration / Mypy Check (Python 3.12) (push) Has been cancelled
Continuous Integration / Mypy Check (Python 3.13) (push) Has been cancelled
Continuous Integration / Unit Tests (Python 3.10) (push) Has been cancelled
Continuous Integration / Unit Tests (Python 3.11) (push) Has been cancelled
Continuous Integration / Unit Tests (Python 3.12) (push) Has been cancelled
Continuous Integration / Unit Tests (Python 3.13) (push) Has been cancelled
Continuous Integration / Unit Tests (Python 3.14) (push) Has been cancelled
Continuous Integration / A2A v0.3 Tests (Python 3.10) (push) Has been cancelled
Continuous Integration / A2A v0.3 Tests (Python 3.11) (push) Has been cancelled
Continuous Integration / A2A v0.3 Tests (Python 3.12) (push) Has been cancelled
Copybara PR Handler / close-imported-pr (push) Has been cancelled
Continuous Integration / A2A v0.3 Tests (Python 3.13) (push) Has been cancelled
Continuous Integration / A2A v0.3 Tests (Python 3.14) (push) Has been cancelled
Continuous Integration / Pre-commit Linter (push) Has been cancelled
Continuous Integration / Mypy Check (Python 3.10) (push) Has been cancelled
Continuous Integration / Mypy Check (Python 3.11) (push) Has been cancelled
Continuous Integration / Mypy Check (Python 3.12) (push) Has been cancelled
Continuous Integration / Mypy Check (Python 3.13) (push) Has been cancelled
Continuous Integration / Unit Tests (Python 3.10) (push) Has been cancelled
Continuous Integration / Unit Tests (Python 3.11) (push) Has been cancelled
Continuous Integration / Unit Tests (Python 3.12) (push) Has been cancelled
Continuous Integration / Unit Tests (Python 3.13) (push) Has been cancelled
Continuous Integration / Unit Tests (Python 3.14) (push) Has been cancelled
Continuous Integration / A2A v0.3 Tests (Python 3.10) (push) Has been cancelled
Continuous Integration / A2A v0.3 Tests (Python 3.11) (push) Has been cancelled
Continuous Integration / A2A v0.3 Tests (Python 3.12) (push) Has been cancelled
Copybara PR Handler / close-imported-pr (push) Has been cancelled
Continuous Integration / A2A v0.3 Tests (Python 3.13) (push) Has been cancelled
Continuous Integration / A2A v0.3 Tests (Python 3.14) (push) Has been cancelled
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
# Config-based Agent Sample - Sequential Workflow
|
||||
|
||||
A multi-agent setup with a sequential workflow.
|
||||
|
||||
The whole process is:
|
||||
|
||||
1. An agent backed by a cheap and fast model to write initial version.
|
||||
1. An agent backed by a smarter and a little more expensive to review the code.
|
||||
1. A final agent backed by the smartest and slowest model to write the final revision.
|
||||
|
||||
Sample queries:
|
||||
|
||||
> Write a quicksort method in python
|
||||
@@ -0,0 +1,22 @@
|
||||
# Copyright 2026 Google LLC
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# yaml-language-server: $schema=https://raw.githubusercontent.com/google/adk-python/refs/heads/main/src/google/adk/agents/config_schemas/AgentConfig.json
|
||||
agent_class: SequentialAgent
|
||||
name: CodePipelineAgent
|
||||
description: Executes a sequence of code writing, reviewing, and refactoring.
|
||||
sub_agents:
|
||||
- config_path: sub_agents/code_writer_agent.yaml
|
||||
- config_path: sub_agents/code_reviewer_agent.yaml
|
||||
- config_path: sub_agents/code_refactorer_agent.yaml
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
# Copyright 2026 Google LLC
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# yaml-language-server: $schema=https://raw.githubusercontent.com/google/adk-python/refs/heads/main/src/google/adk/agents/config_schemas/AgentConfig.json
|
||||
agent_class: LlmAgent
|
||||
name: CodeRefactorerAgent
|
||||
model: gemini-2.5-pro
|
||||
description: Refactors code based on review comments.
|
||||
instruction: |
|
||||
You are a Python Code Refactoring AI.
|
||||
Your goal is to improve the given Python code based on the provided review comments.
|
||||
|
||||
**Original Code:**
|
||||
```python
|
||||
{generated_code}
|
||||
```
|
||||
|
||||
**Review Comments:**
|
||||
{review_comments}
|
||||
|
||||
**Task:**
|
||||
Carefully apply the suggestions from the review comments to refactor the original code.
|
||||
If the review comments state "No major issues found," return the original code unchanged.
|
||||
Ensure the final code is complete, functional, and includes necessary imports and docstrings.
|
||||
|
||||
**Output:**
|
||||
Output *only* the final, refactored Python code block, enclosed in triple backticks (```python ... ```).
|
||||
Do not add any other text before or after the code block.
|
||||
output_key: refactored_code
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
# Copyright 2026 Google LLC
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# yaml-language-server: $schema=https://raw.githubusercontent.com/google/adk-python/refs/heads/main/src/google/adk/agents/config_schemas/AgentConfig.json
|
||||
agent_class: LlmAgent
|
||||
name: CodeReviewerAgent
|
||||
model: gemini-2.5-flash
|
||||
description: Reviews code and provides feedback.
|
||||
instruction: |
|
||||
You are an expert Python Code Reviewer.
|
||||
Your task is to provide constructive feedback on the provided code.
|
||||
|
||||
**Code to Review:**
|
||||
```python
|
||||
{generated_code}
|
||||
```
|
||||
|
||||
**Review Criteria:**
|
||||
1. **Correctness:** Does the code work as intended? Are there logic errors?
|
||||
2. **Readability:** Is the code clear and easy to understand? Follows PEP 8 style guidelines?
|
||||
3. **Efficiency:** Is the code reasonably efficient? Any obvious performance bottlenecks?
|
||||
4. **Edge Cases:** Does the code handle potential edge cases or invalid inputs gracefully?
|
||||
5. **Best Practices:** Does the code follow common Python best practices?
|
||||
|
||||
**Output:**
|
||||
Provide your feedback as a concise, bulleted list. Focus on the most important points for improvement.
|
||||
If the code is excellent and requires no changes, simply state: "No major issues found."
|
||||
Output *only* the review comments or the "No major issues" statement.
|
||||
output_key: review_comments
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
# Copyright 2026 Google LLC
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# yaml-language-server: $schema=https://raw.githubusercontent.com/google/adk-python/refs/heads/main/src/google/adk/agents/config_schemas/AgentConfig.json
|
||||
agent_class: LlmAgent
|
||||
name: CodeWriterAgent
|
||||
model: gemini-2.5-flash
|
||||
description: Writes initial Python code based on a specification.
|
||||
instruction: |
|
||||
You are a Python Code Generator.
|
||||
Based *only* on the user's request, write Python code that fulfills the requirement.
|
||||
Output *only* the complete Python code block, enclosed in triple backticks (```python ... ```).
|
||||
Do not add any other text before or after the code block.
|
||||
output_key: generated_code
|
||||
Reference in New Issue
Block a user