You've already forked adk-python
mirror of
https://github.com/encounter/adk-python.git
synced 2026-07-09 18:19:28 -07:00
Compare commits
82 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a5bf6e3608 | |||
| f872577f68 | |||
| e6109b1dd6 | |||
| ca993277de | |||
| a49d339251 | |||
| 04e4c85b4e | |||
| 3ad939d34c | |||
| 2062aa38a7 | |||
| db5ea6bc56 | |||
| 5c069cca8f | |||
| 22cab9e9a4 | |||
| a9da7a8fc3 | |||
| 956fb912e8 | |||
| 49d8c0fbb2 | |||
| 645402903a | |||
| c531bb6ef1 | |||
| 7cc3167e54 | |||
| 353ff50611 | |||
| bbeb6525ea | |||
| 0e9096d865 | |||
| 923d806637 | |||
| 463797be25 | |||
| dc53678606 | |||
| 21d2047ddc | |||
| a5f191650b | |||
| 1e752b1378 | |||
| 5ab43e804a | |||
| 220b327a73 | |||
| 1664b45562 | |||
| 23f0383284 | |||
| f7b436a985 | |||
| 2af777af6d | |||
| 32dc145ace | |||
| 6742ab9236 | |||
| daed456125 | |||
| 30b1722cca | |||
| 5eca8214a8 | |||
| e0a360a1a2 | |||
| 1cd61242ef | |||
| e31cd0b5f8 | |||
| dfb283e6e0 | |||
| 6e317d69de | |||
| 732059cf59 | |||
| 6b86bcc549 | |||
| 45a465e9b0 | |||
| e50c463ed4 | |||
| 995dc8276b | |||
| 2ee1c65e05 | |||
| b8514f26fe | |||
| 443bc08d2b | |||
| 61d4be2d76 | |||
| d057f2d825 | |||
| 290058eb05 | |||
| 3e85df2641 | |||
| 9a44831a08 | |||
| 4e8b944e09 | |||
| 26bab52ca8 | |||
| 577222509c | |||
| cfbcc17644 | |||
| 089c1e6428 | |||
| d810ff7b28 | |||
| e0d223d117 | |||
| 9cd802fcea | |||
| eecb9e65be | |||
| ee2a75368a | |||
| b68f3aa11f | |||
| a39977876b | |||
| 05142a07cc | |||
| 59117b9b96 | |||
| e80d0e4993 | |||
| 278b513493 | |||
| e637b4df25 | |||
| 9cbaaf378f | |||
| 924549e346 | |||
| 972620d464 | |||
| 7a34c3f5b9 | |||
| 3f30e0825d | |||
| 20a8a11e49 | |||
| 9002ace7e5 | |||
| 28837231dd | |||
| f63ec37153 | |||
| 553bede77e |
@@ -0,0 +1,35 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
** Please make sure you read the contribution guide and file the issues in the rigth place. **
|
||||
[Contribution guide.](https://google.github.io/adk-docs/contributing-guide/)
|
||||
|
||||
**Describe the bug**
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
**To Reproduce**
|
||||
Steps to reproduce the behavior:
|
||||
1. Install '...'
|
||||
2. Run '....'
|
||||
3. Open '....'
|
||||
4. See error
|
||||
|
||||
**Expected behavior**
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
**Screenshots**
|
||||
If applicable, add screenshots to help explain your problem.
|
||||
|
||||
**Desktop (please complete the following information):**
|
||||
- OS: [e.g. iOS]
|
||||
- Python version(python -V):
|
||||
- ADK version(pip show google-adk):
|
||||
|
||||
**Additional context**
|
||||
Add any other context about the problem here.
|
||||
@@ -0,0 +1,23 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea for this project
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
** Please make sure you read the contribution guide and file the issues in the rigth place. **
|
||||
[Contribution guide.](https://google.github.io/adk-docs/contributing-guide/)
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||
|
||||
**Describe the solution you'd like**
|
||||
A clear and concise description of what you want to happen.
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
A clear and concise description of any alternative solutions or features you've considered.
|
||||
|
||||
**Additional context**
|
||||
Add any other context or screenshots about the feature request here.
|
||||
@@ -0,0 +1,41 @@
|
||||
name: Python Unit Tests
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
pull_request:
|
||||
branches: [ main ]
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: ["3.9", "3.10", "3.11"]
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Install uv
|
||||
run: curl -LsSf https://astral.sh/uv/install.sh | sh
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
uv venv .venv
|
||||
source .venv/bin/activate
|
||||
uv sync --extra test --extra eval
|
||||
|
||||
- name: Run unit tests with pytest
|
||||
run: |
|
||||
source .venv/bin/activate
|
||||
pytest tests/unittests \
|
||||
--ignore=tests/unittests/artifacts/test_artifact_service.py \
|
||||
--ignore=tests/unittests/tools/application_integration_tool/clients/test_connections_client.py \
|
||||
--ignore=tests/unittests/tools/google_api_tool/test_googleapi_to_openapi_converter.py
|
||||
|
||||
+99
@@ -0,0 +1,99 @@
|
||||
# Python
|
||||
__pycache__/
|
||||
*.py[cod]
|
||||
*$py.class
|
||||
*.so
|
||||
.Python
|
||||
build/
|
||||
develop-eggs/
|
||||
dist/
|
||||
downloads/
|
||||
eggs/
|
||||
.eggs/
|
||||
lib/
|
||||
lib64/
|
||||
parts/
|
||||
sdist/
|
||||
var/
|
||||
wheels/
|
||||
*.egg-info/
|
||||
.installed.cfg
|
||||
*.egg
|
||||
|
||||
# Virtual Environment
|
||||
venv/
|
||||
ENV/
|
||||
env/
|
||||
.env
|
||||
.venv
|
||||
env.bak/
|
||||
venv.bak/
|
||||
|
||||
# IDE
|
||||
.idea/
|
||||
.vscode/
|
||||
*.swp
|
||||
*.swo
|
||||
.DS_Store
|
||||
|
||||
# Testing
|
||||
.coverage
|
||||
htmlcov/
|
||||
.tox/
|
||||
.nox/
|
||||
.pytest_cache/
|
||||
.coverage.*
|
||||
.cache
|
||||
nosetests.xml
|
||||
coverage.xml
|
||||
*.cover
|
||||
*.py,cover
|
||||
.hypothesis/
|
||||
.pytest_cache/
|
||||
|
||||
# Distribution / packaging
|
||||
.Python
|
||||
build/
|
||||
develop-eggs/
|
||||
dist/
|
||||
downloads/
|
||||
eggs/
|
||||
.eggs/
|
||||
lib/
|
||||
lib64/
|
||||
parts/
|
||||
sdist/
|
||||
var/
|
||||
wheels/
|
||||
*.egg-info/
|
||||
.installed.cfg
|
||||
*.egg
|
||||
|
||||
# Jupyter Notebook
|
||||
.ipynb_checkpoints
|
||||
|
||||
# Logs
|
||||
*.log
|
||||
logs/
|
||||
log/
|
||||
|
||||
# Local development settings
|
||||
.env.local
|
||||
.env.development.local
|
||||
.env.test.local
|
||||
.env.production.local
|
||||
|
||||
# Google Cloud specific
|
||||
.gcloudignore
|
||||
.gcloudignore.local
|
||||
|
||||
# Documentation
|
||||
docs/_build/
|
||||
site/
|
||||
|
||||
# Misc
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
*.bak
|
||||
*.tmp
|
||||
*.temp
|
||||
@@ -0,0 +1,89 @@
|
||||
# Changelog
|
||||
|
||||
## 0.3.0
|
||||
|
||||
### ⚠ BREAKING CHANGES
|
||||
|
||||
* Auth: expose `access_token` and `refresh_token` at top level of auth
|
||||
credentails, instead of a `dict`
|
||||
([commit](https://github.com/google/adk-python/commit/956fb912e8851b139668b1ccb8db10fd252a6990)).
|
||||
|
||||
### Features
|
||||
|
||||
* Added support for running agents with MCPToolset easily on `adk web`.
|
||||
* Added `custom_metadata` field to `LlmResponse`, which can be used to tag
|
||||
LlmResponse via `after_model_callback`.
|
||||
* Added `--session_db_url` to `adk deploy cloud_run` option.
|
||||
* Many Dev UI improvements:
|
||||
* Better google search result rendering.
|
||||
* Show websocket close reason in Dev UI.
|
||||
* Better error message showing for audio/video.
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Fixed MCP tool json schema parsing issue.
|
||||
* Fixed issues in DatabaseSessionService that leads to crash.
|
||||
* Fixed functions.py.
|
||||
* Fixed `skip_summarization` behavior in `AgentTool`.
|
||||
|
||||
### Miscellaneous Chores
|
||||
|
||||
* README.md impprovements.
|
||||
* Various code improvements.
|
||||
* Various typo fixes.
|
||||
* Bump min version of google-genai to 1.11.0.
|
||||
|
||||
## 0.2.0
|
||||
|
||||
### ⚠ BREAKING CHANGES
|
||||
|
||||
* Fix typo in method name in `Event`: has_trailing_code_exeuction_result --> has_trailing_code_execution_result.
|
||||
|
||||
### Features
|
||||
|
||||
* `adk` CLI:
|
||||
* Introduce `adk create` cli tool to help creating agents.
|
||||
* Adds `--verbosity` option to `adk deploy cloud_run` to show detailed cloud
|
||||
run deploy logging.
|
||||
* Improve the initialization error message for `DatabaseSessionService`.
|
||||
* Lazy loading for Google 1P tools to minimize the initial latency.
|
||||
* Support emitting state-change-only events from planners.
|
||||
* Lots of Dev UI updates, including:
|
||||
* Show planner thoughts and actions in the Dev UI.
|
||||
* Support MCP tools in Dev UI.
|
||||
(NOTE: `agent.py` interface is temp solution and is subject to change)
|
||||
* Auto-select the only app if only one app is available.
|
||||
* Show grounding links generated by Google Search Tool.
|
||||
* `.env` file is reloaded on every agent run.
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* `LiteLlm`: arg parsing error and python 3.9 compatibility.
|
||||
* `DatabaseSessionService`: adds the missing fields; fixes event with empty
|
||||
content not being persisted.
|
||||
* Google API Discovery response parsing issue.
|
||||
* `load_memory_tool` rendering issue in Dev UI.
|
||||
* Markdown text overflows in Dev UI.
|
||||
|
||||
### Miscellaneous Chores
|
||||
|
||||
* Adds unit tests in Github action.
|
||||
* Improves test coverage.
|
||||
* Various typo fixes.
|
||||
|
||||
## 0.1.0
|
||||
|
||||
### Features
|
||||
|
||||
* Initial release of the Agent Development Kit (ADK).
|
||||
* Multi-agent, agent-as-workflow, and custom agent support
|
||||
* Tool authentication support
|
||||
* Rich tool support, e.g. built-in tools, google-cloud tools, third-party tools, and MCP tools
|
||||
* Rich callback support
|
||||
* Built-in code execution capability
|
||||
* Asynchronous runtime and execution
|
||||
* Session, and memory support
|
||||
* Built-in evaluation support
|
||||
* Development UI that makes local development easy
|
||||
* Deploy to Google Cloud Run, Agent Engine
|
||||
* (Experimental) Live(Bidi) auido/video agent support and Compositional Function Calling(CFC) support
|
||||
+14
-1
@@ -25,9 +25,22 @@ This project follows
|
||||
|
||||
## Contribution process
|
||||
|
||||
### Requirement for PRs
|
||||
|
||||
- All PRs, other than small documentation or typo fixes, should have a Issue assoicated. If not, please create one.
|
||||
- Small, focused PRs. Keep changes minimal—one concern per PR.
|
||||
- For bug fixes or features, please provide logs or screenshot after the fix is applied to help reviewers better understand the fix.
|
||||
- Please add corresponding testing for your code change if it's not covered by existing tests.
|
||||
|
||||
### Large or Complex Changes
|
||||
For substantial features or architectural revisions:
|
||||
|
||||
- Open an Issue First: Outline your proposal, including design considerations and impact.
|
||||
- Gather Feedback: Discuss with maintainers and the community to ensure alignment and avoid duplicate work
|
||||
|
||||
### Code reviews
|
||||
|
||||
All submissions, including submissions by project members, require review. We
|
||||
use GitHub pull requests for this purpose. Consult
|
||||
[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more
|
||||
information on using pull requests.
|
||||
information on using pull requests.
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
# Agent Development Kit (ADK)
|
||||
|
||||
[](LICENSE)
|
||||
[](https://github.com/google/adk-python/actions/workflows/python-unit-tests.yml)
|
||||
[](https://www.reddit.com/r/agentdevelopmentkit/)
|
||||
|
||||
<html>
|
||||
<h1 align="center">
|
||||
<img src="assets/agent-development-kit.png" width="256"/>
|
||||
</h1>
|
||||
<h2 align="center">
|
||||
<img src="https://raw.githubusercontent.com/google/adk-python/main/assets/agent-development-kit.png" width="256"/>
|
||||
</h2>
|
||||
<h3 align="center">
|
||||
An open-source, code-first Python toolkit for building, evaluating, and deploying sophisticated AI agents with flexibility and control.
|
||||
</h3>
|
||||
@@ -16,88 +18,136 @@
|
||||
</h3>
|
||||
</html>
|
||||
|
||||
The Agent Development Kit (ADK) is designed for developers seeking fine-grained control and flexibility when building advanced AI agents that are tightly integrated with services in Google Cloud. It allows you to define agent behavior, orchestration, and tool use directly in code, enabling robust debugging, versioning, and deployment anywhere – from your laptop to the cloud.
|
||||
Agent Development Kit (ADK) is designed for developers seeking fine-grained
|
||||
control and flexibility when building advanced AI agents that are tightly
|
||||
integrated with services in Google Cloud. It allows you to define agent
|
||||
behavior, orchestration, and tool use directly in code, enabling robust
|
||||
debugging, versioning, and deployment anywhere – from your laptop to the cloud.
|
||||
|
||||
|
||||
---
|
||||
|
||||
## ✨ Key Features
|
||||
|
||||
* **Code-First Development:** Define agents, tools, and orchestration logic for maximum control, testability, and versioning.
|
||||
* **Multi-Agent Architecture:** Build modular and scalable applications by composing multiple specialized agents in flexible hierarchies.
|
||||
* **Rich Tool Ecosystem:** Equip agents with diverse capabilities using pre-built tools, custom Python functions, API specifications, or integrating existing tools.
|
||||
* **Flexible Orchestration:** Define workflows using built-in agents for predictable pipelines, or leverage LLM-driven dynamic routing for adaptive behavior.
|
||||
* **Integrated Developer Experience:** Develop, test, and debug locally with a CLI and visual web UI.
|
||||
* **Built-in Evaluation:** Measure agent performance by evaluating response quality and step-by-step execution trajectory.
|
||||
* **Deployment Ready:** Containerize and deploy your agents anywhere – scale with Vertex AI Agent Engine, Cloud Run, or Docker.
|
||||
* **Native Streaming Support:** Build real-time, interactive experiences with native support for bidirectional streaming (text and audio).
|
||||
* **State, Memory & Artifacts:** Manage short-term conversational context, configure long-term memory, and handle file uploads/downloads.
|
||||
* **Extensibility:** Customize agent behavior deeply with callbacks and easily integrate third-party tools and services.
|
||||
- **Rich Tool Ecosystem**: Utilize pre-built tools, custom functions,
|
||||
OpenAPI specs, or integrate existing tools to give agents diverse
|
||||
capabilities, all for tight integration with the Google ecosystem.
|
||||
|
||||
- **Code-First Development**: Define agent logic, tools, and orchestration
|
||||
directly in Python for ultimate flexibility, testability, and versioning.
|
||||
|
||||
- **Modular Multi-Agent Systems**: Design scalable applications by composing
|
||||
multiple specialized agents into flexible hierarchies.
|
||||
|
||||
- **Deploy Anywhere**: Easily containerize and deploy agents on Cloud Run or
|
||||
scale seamlessly with Vertex AI Agent Engine.
|
||||
|
||||
|
||||
## 🚀 Installation
|
||||
|
||||
You can install the ADK using `pip`:
|
||||
### Stable Release (Recommended)
|
||||
|
||||
You can install the latest stable version of ADK using `pip`:
|
||||
|
||||
```bash
|
||||
pip install google-adk
|
||||
```
|
||||
|
||||
## 🏁 Getting Started
|
||||
The release cadence is weekly.
|
||||
|
||||
Create your first agent (`my_agent/agent.py`):
|
||||
This version is recommended for most users as it represents the most recent official release.
|
||||
|
||||
### Development Version
|
||||
Bug fixes and new features are merged into the main branch on GitHub first. If you need access to changes that haven't been included in an official PyPI release yet, you can install directly from the main branch:
|
||||
|
||||
```bash
|
||||
pip install git+https://github.com/google/adk-python.git@main
|
||||
```
|
||||
|
||||
Note: The development version is built directly from the latest code commits. While it includes the newest fixes and features, it may also contain experimental changes or bugs not present in the stable release. Use it primarily for testing upcoming changes or accessing critical fixes before they are officially released.
|
||||
|
||||
## 📚 Documentation
|
||||
|
||||
Explore the full documentation for detailed guides on building, evaluating, and
|
||||
deploying agents:
|
||||
|
||||
* **[Documentation](https://google.github.io/adk-docs)**
|
||||
|
||||
## 🏁 Feature Highlight
|
||||
|
||||
### Define a single agent:
|
||||
|
||||
```python
|
||||
# my_agent/agent.py
|
||||
from google.adk.agents import Agent
|
||||
from google.adk.tools import google_search
|
||||
|
||||
root_agent = Agent(
|
||||
name="search_assistant",
|
||||
model="gemini-2.0-flash-exp", # Or your preferred Gemini model
|
||||
model="gemini-2.0-flash", # Or your preferred Gemini model
|
||||
instruction="You are a helpful assistant. Answer user questions using Google Search when needed.",
|
||||
description="An assistant that can search the web.",
|
||||
tools=[google_search]
|
||||
)
|
||||
```
|
||||
|
||||
Create `my_agent/__init__.py`:
|
||||
### Define a multi-agent system:
|
||||
|
||||
Define a multi-agent system with coordinator agent, greeter agent, and task execution agent. Then ADK engine and the model will guide the agents works together to accomplish the task.
|
||||
|
||||
```python
|
||||
# my_agent/__init__.py
|
||||
from . import agent
|
||||
from google.adk.agents import LlmAgent, BaseAgent
|
||||
|
||||
# Define individual agents
|
||||
greeter = LlmAgent(name="greeter", model="gemini-2.0-flash", ...)
|
||||
task_executor = LlmAgent(name="task_executor", model="gemini-2.0-flash", ...)
|
||||
|
||||
# Create parent agent and assign children via sub_agents
|
||||
coordinator = LlmAgent(
|
||||
name="Coordinator",
|
||||
model="gemini-2.0-flash",
|
||||
description="I coordinate greetings and tasks.",
|
||||
sub_agents=[ # Assign sub_agents here
|
||||
greeter,
|
||||
task_executor
|
||||
]
|
||||
)
|
||||
```
|
||||
|
||||
Run it via the CLI (from the directory *containing* `my_agent`):
|
||||
### Development UI
|
||||
|
||||
A built-in development UI to help you test, evaluate, debug, and showcase your agent(s).
|
||||
|
||||
<img src="https://raw.githubusercontent.com/google/adk-python/main/assets/adk-web-dev-ui-function-call.png"/>
|
||||
|
||||
### Evaluate Agents
|
||||
|
||||
```bash
|
||||
adk run my_agent
|
||||
adk eval \
|
||||
samples_for_testing/hello_world \
|
||||
samples_for_testing/hello_world/hello_world_eval_set_001.evalset.json
|
||||
```
|
||||
|
||||
Or launch the Web UI from the folder that contains `my_agent` folder:
|
||||
## 🤖 A2A and ADK integration
|
||||
|
||||
```bash
|
||||
adk web
|
||||
```
|
||||
|
||||
For a full step-by-step guide, check out the [quickstart](https://google.github.io/adk-docs/get-started/quickstart/) or [sample agents](https://github.com/google/adk-samples).
|
||||
|
||||
## 📚 Resources
|
||||
|
||||
Explore the full documentation for detailed guides on building, evaluating, and deploying agents:
|
||||
|
||||
* **[Get Started](https://google.github.io/adk-docs/get-started/)**
|
||||
* **[Browse Sample Agents](https://github.com/google/adk-samples)**
|
||||
* **[Evaluate Agents](https://google.github.io/adk-docs/guides/evaluate-agents/)**
|
||||
* **[Deploy Agents](https://google.github.io/adk-docs/deploy/)**
|
||||
* **[API Reference](https://google.github.io/adk-docs/api-reference/)**
|
||||
For remote agent-to-agent communication, ADK integrates with the
|
||||
[A2A protocol](https://github.com/google/A2A/).
|
||||
See this [example](https://github.com/google/A2A/tree/main/samples/python/agents/google_adk)
|
||||
for how they can work together.
|
||||
|
||||
## 🤝 Contributing
|
||||
|
||||
We welcome contributions from the community! Whether it's bug reports, feature requests, documentation improvements, or code contributions, please see our [**Contributing Guidelines**](./CONTRIBUTING.md) to get started.
|
||||
We welcome contributions from the community! Whether it's bug reports, feature requests, documentation improvements, or code contributions, please see our
|
||||
- [General contribution guideline and flow](https://google.github.io/adk-docs/contributing-guide/#questions).
|
||||
- Then if you want to contribute code, please read [Code Contributing Guidelines](./CONTRIBUTING.md) to get started.
|
||||
|
||||
## 📄 License
|
||||
|
||||
This project is licensed under the Apache 2.0 License - see the [LICENSE](LICENSE) file for details.
|
||||
|
||||
## Preview
|
||||
|
||||
This feature is subject to the "Pre-GA Offerings Terms" in the General Service Terms section of the [Service Specific Terms](https://cloud.google.com/terms/service-terms#1). Pre-GA features are available "as is" and might have limited support. For more information, see the [launch stage descriptions](https://cloud.google.com/products?hl=en#product-launch-stages).
|
||||
|
||||
---
|
||||
|
||||
*Happy Agent Building!*
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 463 KiB |
@@ -45,7 +45,7 @@ confidence=
|
||||
# can either give multiple identifiers separated by comma (,) or put this
|
||||
# option multiple times (only on the command line, not in the configuration
|
||||
# file where it should appear only once).You can also use "--disable=all" to
|
||||
# disable everything first and then reenable specific checks. For example, if
|
||||
# disable everything first and then re-enable specific checks. For example, if
|
||||
# you want to run only the similarities checker, you can use "--disable=all
|
||||
# --enable=similarities". If you want to run only the classes checker, but have
|
||||
# no Warning level messages displayed, use"--disable=all --enable=classes
|
||||
|
||||
+5
-1
@@ -33,7 +33,7 @@ dependencies = [
|
||||
"google-cloud-secret-manager>=2.22.0", # Fetching secrets in RestAPI Tool
|
||||
"google-cloud-speech>=2.30.0", # For Audo Transcription
|
||||
"google-cloud-storage>=2.18.0, <3.0.0", # For GCS Artifact service
|
||||
"google-genai>=1.9.0", # Google GenAI SDK
|
||||
"google-genai>=1.11.0", # Google GenAI SDK
|
||||
"graphviz>=0.20.2", # Graphviz for graph rendering
|
||||
"mcp>=1.5.0;python_version>='3.10'", # For MCP Toolset
|
||||
"opentelemetry-api>=1.31.0", # OpenTelemetry
|
||||
@@ -79,7 +79,11 @@ eval = [
|
||||
|
||||
test = [
|
||||
# go/keep-sorted start
|
||||
"anthropic>=0.43.0", # For anthropic model tests
|
||||
"langchain-community>=0.3.17",
|
||||
"langgraph>=0.2.60", # For LangGraphAgent
|
||||
"litellm>=1.63.11", # For LiteLLM tests
|
||||
"llama-index-readers-file>=0.4.0", # for retrieval tests
|
||||
"pytest-asyncio>=0.25.0",
|
||||
"pytest-mock>=3.14.0",
|
||||
"pytest-xdist>=3.6.1",
|
||||
|
||||
@@ -120,7 +120,7 @@ class BaseAgent(BaseModel):
|
||||
self,
|
||||
parent_context: InvocationContext,
|
||||
) -> AsyncGenerator[Event, None]:
|
||||
"""Entry method to run an agent via text-based conversaction.
|
||||
"""Entry method to run an agent via text-based conversation.
|
||||
|
||||
Args:
|
||||
parent_context: InvocationContext, the invocation context of the parent
|
||||
@@ -152,7 +152,7 @@ class BaseAgent(BaseModel):
|
||||
self,
|
||||
parent_context: InvocationContext,
|
||||
) -> AsyncGenerator[Event, None]:
|
||||
"""Entry method to run an agent via video/audio-based conversaction.
|
||||
"""Entry method to run an agent via video/audio-based conversation.
|
||||
|
||||
Args:
|
||||
parent_context: InvocationContext, the invocation context of the parent
|
||||
@@ -171,7 +171,7 @@ class BaseAgent(BaseModel):
|
||||
async def _run_async_impl(
|
||||
self, ctx: InvocationContext
|
||||
) -> AsyncGenerator[Event, None]:
|
||||
"""Core logic to run this agent via text-based conversaction.
|
||||
"""Core logic to run this agent via text-based conversation.
|
||||
|
||||
Args:
|
||||
ctx: InvocationContext, the invocation context for this agent.
|
||||
@@ -187,7 +187,7 @@ class BaseAgent(BaseModel):
|
||||
async def _run_live_impl(
|
||||
self, ctx: InvocationContext
|
||||
) -> AsyncGenerator[Event, None]:
|
||||
"""Core logic to run this agent via video/audio-based conversaction.
|
||||
"""Core logic to run this agent via video/audio-based conversation.
|
||||
|
||||
Args:
|
||||
ctx: InvocationContext, the invocation context for this agent.
|
||||
|
||||
@@ -23,7 +23,6 @@ from .readonly_context import ReadonlyContext
|
||||
if TYPE_CHECKING:
|
||||
from google.genai import types
|
||||
|
||||
from ..events.event import Event
|
||||
from ..events.event_actions import EventActions
|
||||
from ..sessions.state import State
|
||||
from .invocation_context import InvocationContext
|
||||
|
||||
@@ -124,7 +124,7 @@ class InvocationContext(BaseModel):
|
||||
agent_2, and agent_2 is the parent of agent_3.
|
||||
|
||||
Branch is used when multiple sub-agents shouldn't see their peer agents'
|
||||
conversaction history.
|
||||
conversation history.
|
||||
"""
|
||||
agent: BaseAgent
|
||||
"""The current agent of this invocation context. Readonly."""
|
||||
|
||||
@@ -32,7 +32,7 @@ class RemoteAgent(BaseAgent):
|
||||
sub_agents: list[BaseAgent] = Field(
|
||||
default_factory=list, init=False, frozen=True
|
||||
)
|
||||
"""Sub-agent is dsiabled in RemoteAgent."""
|
||||
"""Sub-agent is disabled in RemoteAgent."""
|
||||
|
||||
@override
|
||||
async def _run_async_impl(
|
||||
|
||||
@@ -42,7 +42,7 @@ class RunConfig(BaseModel):
|
||||
"""Speech configuration for the live agent."""
|
||||
|
||||
response_modalities: Optional[list[str]] = None
|
||||
"""The output modalities. If not set, its default to AUDIO."""
|
||||
"""The output modalities. If not set, it's default to AUDIO."""
|
||||
|
||||
save_input_blobs_as_artifacts: bool = False
|
||||
"""Whether or not to save the input blobs as artifacts."""
|
||||
|
||||
@@ -66,7 +66,8 @@ class OAuth2Auth(BaseModelWithConfig):
|
||||
redirect_uri: Optional[str] = None
|
||||
auth_response_uri: Optional[str] = None
|
||||
auth_code: Optional[str] = None
|
||||
token: Optional[Dict[str, Any]] = None
|
||||
access_token: Optional[str] = None
|
||||
refresh_token: Optional[str] = None
|
||||
|
||||
|
||||
class ServiceAccountCredential(BaseModelWithConfig):
|
||||
|
||||
@@ -82,7 +82,8 @@ class AuthHandler:
|
||||
or not auth_credential.oauth2
|
||||
or not auth_credential.oauth2.client_id
|
||||
or not auth_credential.oauth2.client_secret
|
||||
or auth_credential.oauth2.token
|
||||
or auth_credential.oauth2.access_token
|
||||
or auth_credential.oauth2.refresh_token
|
||||
):
|
||||
return self.auth_config.exchanged_auth_credential
|
||||
|
||||
@@ -93,7 +94,7 @@ class AuthHandler:
|
||||
redirect_uri=auth_credential.oauth2.redirect_uri,
|
||||
state=auth_credential.oauth2.state,
|
||||
)
|
||||
token = client.fetch_token(
|
||||
tokens = client.fetch_token(
|
||||
token_endpoint,
|
||||
authorization_response=auth_credential.oauth2.auth_response_uri,
|
||||
code=auth_credential.oauth2.auth_code,
|
||||
@@ -102,7 +103,10 @@ class AuthHandler:
|
||||
|
||||
updated_credential = AuthCredential(
|
||||
auth_type=AuthCredentialTypes.OAUTH2,
|
||||
oauth2=OAuth2Auth(token=dict(token)),
|
||||
oauth2=OAuth2Auth(
|
||||
access_token=tokens.get("access_token"),
|
||||
refresh_token=tokens.get("refresh_token"),
|
||||
),
|
||||
)
|
||||
return updated_credential
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ class _AuthLlmRequestProcessor(BaseLlmRequestProcessor):
|
||||
|
||||
for i in range(len(events) - 2, -1, -1):
|
||||
event = events[i]
|
||||
# looking for the system long running reqeust euc function call
|
||||
# looking for the system long running request euc function call
|
||||
function_calls = event.get_function_calls()
|
||||
if not function_calls:
|
||||
continue
|
||||
@@ -92,7 +92,7 @@ class _AuthLlmRequestProcessor(BaseLlmRequestProcessor):
|
||||
if not tools_to_resume:
|
||||
continue
|
||||
|
||||
# found the the system long running reqeust euc function call
|
||||
# found the the system long running request euc function call
|
||||
# looking for original function call that requests euc
|
||||
for j in range(i - 1, -1, -1):
|
||||
event = events[j]
|
||||
|
||||
@@ -19,7 +19,7 @@ from .auth_schemes import AuthScheme
|
||||
|
||||
|
||||
class AuthConfig(BaseModel):
|
||||
"""The auth config sent by tool asking client to collect auth credentails and
|
||||
"""The auth config sent by tool asking client to collect auth credentials and
|
||||
|
||||
adk and client will help to fill in the response
|
||||
"""
|
||||
|
||||
File diff suppressed because one or more lines are too long
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user