- Claude Opus 4.7 rejects `thinking.type: "enabled"` with a 400 error
and requires `thinking.type: "adaptive"`; adaptive is also the
recommended mode for Opus 4.6 / Sonnet 4.6 where `"enabled"` is
deprecated.
- The genai `ThinkingConfig.thinking_budget = -1` (AUTOMATIC) sentinel
is the natural mapping for adaptive: the model picks the depth
itself. Callers opt in with `-1`; positive values keep the existing
`"enabled"` path so older models are unchanged.
- Bump `anthropic>=0.78` in `pyproject.toml`; 0.78 introduced
`ThinkingConfigAdaptiveParam`. The previous floor (`>=0.43`) let
Kokoro install `anthropic==0.75.0`, which crashes the new tests
with `AttributeError: module 'anthropic.types' has no attribute
'ThinkingConfigAdaptiveParam'`.
PiperOrigin-RevId: 917449729
This ensures that adding README.md files to subdirectories (as discussed
for new folders and integrations) won't result in them being included in
the published package.
Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 916075206
Merge https://github.com/google/adk-python/pull/5489Closes#5488
## Summary
Bumps the `litellm` constraint from `<=1.82.6` to `>=1.83.7,<=1.83.14`
in both the base project dependencies and the `[test]` extras.
The current cap was added in
[`77f1c41`](https://github.com/google/adk-python/commit/77f1c41) to
exclude the March 2026 supply-chain compromise of litellm 1.82.7
and 1.82.8. Since then, **five CVEs have been disclosed against
litellm `<=1.82.6`** (2 critical, 3 high), with patches in 1.83.0
and 1.83.7. The new lower bound (1.83.7) is strictly above the
originally compromised versions, so the original concern is still
respected.
The upper bound is pinned to the current latest release on PyPI
(1.83.14) per reviewer request, mirroring the project's prior
exact-version cap pattern. New litellm releases will require an
explicit ADK PR to admit, the same way `<=1.82.6` did.
Full CVE list and rationale in the linked issue (#5488).
## Diff
Two identical edits, one in project deps (line 126) and one in
`[test]` extras (line 145):
```diff
- "litellm>=1.75.5,<=1.82.6", # ... supply chain attack ...
+ "litellm>=1.83.7,<=1.83.14", # For LiteLlm class. Lower bound: 5 CVE patches (2026-04). Upper bound pinned to current latest; bump deliberately. See #5488.
```
## Testing plan
1. Re-installed `google-adk` (editable) against the updated
constraint; pip resolved litellm to 1.83.13 (latest stable
compatible with the rest of the lockfile, inside the new
`[1.83.7, 1.83.14]` window).
2. Ran `tests/unittests/models/test_litellm.py` and
`tests/unittests/models/test_litellm_import.py`; **all 259
tests pass**. Output below.
3. Verified `pyproject.toml` is parseable as TOML.
### Upstream litellm test output
```
collected 259 items
tests/unittests/models/test_litellm.py ................................. [ 12%]
........................................................................ [ 40%]
........................................................................ [ 68%]
........................................................................ [ 96%]
....... [ 98%]
tests/unittests/models/test_litellm_import.py ... [100%]
============================= 259 passed in 6.57s ==============================
```
## Heads up: litellm hard-pins python-dotenv
While verifying, we discovered that **litellm 1.83.7 (and every
subsequent version through 1.83.14) hard-pins
`python-dotenv==1.0.1`** as an unconditional core dependency. By
contrast, litellm 1.82.6 declared `python-dotenv>=0.2.0` (loose).
This does **not** affect adk-python itself -- ADK declares
`python-dotenv>=1,<2`, which admits `1.0.1` cleanly. But any
downstream project that has tightened `python-dotenv` (e.g.
`>=1.2.x`) will hit a resolver conflict after this bump and may
need to either relax its python-dotenv constraint or apply a
package-manager override. This is a litellm anti-pattern, not an
ADK problem; included here so reviewers know to expect downstream
issues of that shape.
## Out of scope
`langgraph` has a similar dep cap (`<0.4.8`) and one
medium-severity CVE
([GHSA-g48c-2wqr-h844](https://github.com/advisories/GHSA-g48c-2wqr-h844)),
but bumping past 0.4.x requires porting ADK's use of the removed
`graph.graph` API (per
[#1687](https://github.com/google/adk-python/pull/1687)). That is
real engineering work, not a dep cap bump, and is left as a
separate effort.
COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/5489 from cwest:topic/bump-litellm-cap 559f0c2ee9d1e911bcc83832d4dee9ccbafa5c12
PiperOrigin-RevId: 906979886
Use sphinx-click to automatically generate documentation for the CLI commands in the google.adk.cli module. Closes#4500
Co-authored-by: Sasha Sobran <asobran@google.com>
PiperOrigin-RevId: 906328549
- Revert non-standard src imports and fix formatting/import order across tests and samples to satisfy CI checks.
- Remove check-added-large-files as there are pre-existing large js / sample files
- Add allow-multiple-documents to support Kubernetes manifest that have multiple YAML in one file
Co-authored-by: Shangjie Chen <deanchen@google.com>
PiperOrigin-RevId: 905085090
This change introduces `_add_events_to_memory_via_ingest` in `VertexAiMemoryBankService` to support adding events to memory using the `memories.ingest_events` API. This allows passing additional configurations such as `stream_id`, `force_flush`, and `generation_trigger_config`.
This path is triggered when `custom_metadata` contains `use_ingest` or `generation_trigger_config`.
Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 900924805
END_PUBLIC
Merge https://github.com/google/adk-python/pull/5088
Adding support for Firestore for both session and memory storage.
This started by copying the Firestore support from the Java ADK into the Python ADK and also takes inspiration from @anmolg1997's PR https://github.com/google/adk-python-community/pull/104. It does things differently from both.
Firestore contains a hierarchical set of data for sessions:
```
Hierarchy for sessions:
adk-session
↳ <app name>
↳ users
↳ <user ID>
↳ sessions
↳ <session ID>
↳ events
↳ <event ID>
Hierarchy for shared App/User state configurations:
app_states
↳ <app name>
user_states
↳ <app name>
↳ users
↳ <user ID>
Hierarchy for memory:
memories
↳ <memory ID>
```
The firestore memory service creates a top-level collection that hold indexed memories when sessions are added.
### Link to Issue or Description of Change
This is from an existing customer request for firestore support.
### Testing Plan
**Unit Tests:**
- [x] I have added or updated unit tests for my change.
- [x] All unit tests pass locally.
```
$ pytest tests/unittests/integrations/firestore/
===================================== test session starts ======================================
platform darwin -- Python 3.11.14, pytest-9.0.2, pluggy-1.6.0
rootdir: /Users/scottmansfield/projects/adk-python
configfile: pyproject.toml
plugins: mock-3.15.1, xdist-3.8.0, langsmith-0.7.23, asyncio-1.3.0, anyio-4.13.0
asyncio: mode=Mode.AUTO, debug=False, asyncio_default_fixture_loop_scope=function, asyncio_default_test_loop_scope=function
collected 29 items
tests/unittests/integrations/firestore/test_firestore_memory_service.py ............. [ 44%]
tests/unittests/integrations/firestore/test_firestore_session_service.py ................ [100%]
======================================= warnings summary =======================================
src/google/adk/features/_feature_decorator.py:72
/Users/scottmansfield/projects/adk-python/src/google/adk/features/_feature_decorator.py:72: UserWarning: [EXPERIMENTAL] feature FeatureName.PLUGGABLE_AUTH is enabled.
check_feature_enabled()
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
================================ 29 passed, 1 warning in 1.44s =================================
```
**Manual End-to-End (E2E) Tests:**
I created a demo app locally to test the session and memory storage with a real firebase instance. It successfully records sessions and memories, verified by manually checking the cloud console.
Memory did require an index, which will be created by the user the first time the memory session is used. Firestore has a specific deep link that it will create to give the exact index needed. After that, memory worked fine.
### Checklist
- [x] I have read the [CONTRIBUTING.md](https://github.com/google/adk-python/blob/main/CONTRIBUTING.md) document.
- [x] I have performed a self-review of my own code.
- [x] I have commented my code, particularly in hard-to-understand areas.
- [x] I have added tests that prove my fix is effective or that my feature works.
- [x] New and existing unit tests pass locally with my changes.
- [x] I have manually tested my changes end-to-end.
- [x] Any dependent changes have been merged and published in downstream modules.
COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/5088 from ScottMansfield:feat/firestore 99efca50e1d5a932fac7b722ebe7e9b4e0eb1ae9
PiperOrigin-RevId: 899328760
Parameter Manager is a feature of Secret Manager that provides centralized storage and management for workload parameters. It supports various formats (plain text, YAML, JSON) and can reference Secret Manager secrets.
The ADK integration will provide a simplified interface for agents to retrieve rendered parameter values, supporting both global and regional endpoints.
PiperOrigin-RevId: 896823376
This PR updates the `toolbox-adk` package version in the `pyproject.toml` and also updates the MCP Toolbox server version to the latest in the docs.
PiperOrigin-RevId: 890633573
Versions 1.82.7 and 1.82.8 of LiteLLM were affected by a supply chain attack and are now explicitly excluded from the dependency constraints for both project and dev dependencies.
Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 888818704
Renames the imported module from `agentic_sandbox` to `k8s_agent_sandbox` in `gke_code_executor.py` and updates the required version in `pyproject.toml` to `>=0.1.1.post3`.
Closes#4883
Co-authored-by: Liang Wu <wuliang@google.com>
PiperOrigin-RevId: 885840142
The metric takes into account all the turns of the multi-turn conversation.
The class delegates the responsibility to Vertex Gen AI Eval SDK. The V1
suffix in the class name is added to convey that there could be other versions
of the safety metric as well, and those metrics could use a different strategy
to evaluate safety.
Co-authored-by: Ankur Sharma <ankusharma@google.com>
PiperOrigin-RevId: 884504910
The gemini-embedding-2-preview model requires the Vertex AI
:embedContent endpoint instead of the legacy :predict endpoint used
by older models (text-embedding-004, text-embedding-005).
In google-genai <1.64.0, embed_content() unconditionally routed to
:predict on Vertex AI, which returns FAILED_PRECONDITION for this
model.
v1.64.0 (googleapis/python-genai@af40cc6) introduced model-aware
dispatch in embed_content(): models with "gemini" in the name are
routed to :embedContent via t_is_vertex_embed_content_model(), while
older text-embedding-* models continue to use :predict.
This version also enforces a single-content-per-call limit for the
embedContent API, which is why FilesRetrieval sets embed_batch_size=1.
Co-authored-by: Xiang (Sean) Zhou <seanzhougoogle@google.com>
PiperOrigin-RevId: 883689438
* Update the `toolbox-adk` package version to latest.
* Update `README.md` with the latest MCP Toolbox server version.
* Simplify Toolbox agent sample code with default toolset.
* Fix an error that says `cannot invoke close() on None`.
* Update Gemini model to `2.5` as `2.0` is deprecated.
PiperOrigin-RevId: 879400015
Previous rollback CL - cl/872951141
This change introduces a new search_catalog tool within the BigQuery toolset, enabling users to search for BigQuery assets across projects using the Dataplex Catalog API.
Key changes include:
- Adding google-cloud-dataplex as a dependency in pyproject.toml.
- Updating BigQuery credentials to include the Dataplex scope.
- Implementing get_dataplex_catalog_client in client.py to create Dataplex API clients.
- Creating search_tool.py with the search_catalog function, which constructs and executes Dataplex search queries.
- Adding extensive unit tests for the new Dataplex client and the search_catalog tool, covering various scenarios including query filtering and error handling.
- Updating the BigQuery toolset to include the new search_catalog tool.
- Updating the BigQuery samples README to mention the new tool.
PiperOrigin-RevId: 878435463
details:
* Uses GEPA (https://gepa-ai.github.io/gepa/) to optimize the instructions for the root agent. Can be extended to sub-agents and other components in the future.
* GEPA package is imported dynamically; you do not need to install it along with ADK unless you plan to use this optimizer.
Co-authored-by: Keyur Joshi <keyurj@google.com>
PiperOrigin-RevId: 878009649
Updates _model_response_to_chunk to better handle LiteLLM's streaming delta/message structure, including prioritizing delta when it contains meaningful content and preserving reasoning_content
Close#4225
Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 873097502
Merge https://github.com/google/adk-python/pull/4171
**Problem:**
The BigQuery ADK tools currently lack the ability to search for and discover BigQuery assets using the Dataplex Catalog. Users cannot leverage Dataplex's search capabilities within the ADK to find relevant data assets before querying them.
**Solution:**
This PR integrates a new search_catalog_tool into the BigQuery ADK. This tool utilizes the dataplex catalog client library to interact with the Dataplex API, allowing users to search the catalog.
**Unit Tests:**
- [x] I have added or updated unit tests for my change.
- [x] All unit tests pass locally.
Added the screenshots of the manual adk web UI tests - https://docs.google.com/document/d/1c_lMW7NYGKuLAvPFmSkLehbqySeNyXQIhzQlvo3ixmQ/edit?usp=sharing
### Checklist
- [x] I have read the [CONTRIBUTING.md](https://github.com/google/adk-python/blob/main/CONTRIBUTING.md) document.
- [x] I have performed a self-review of my own code.
- [x] I have commented my code, particularly in hard-to-understand areas.
- [x] I have added tests that prove my fix is effective or that my feature works.
- [x] New and existing unit tests pass locally with my changes.
- [x] I have manually tested my changes end-to-end.
- [x] Any dependent changes have been merged and published in downstream modules.
COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/4171 from sahaajaaa:sahaajaaa-bq-adk 3dbbaa4f909cb25259e8e7d73a00a58fbe9c2f09
PiperOrigin-RevId: 872951141
Relax version constraints for opentelemetry-api and opentelemetry-sdk to allow versions between 1.36.0 and 1.40.0
Close#4229
Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 864896212
Merge https://github.com/google/adk-python/pull/4276
This adds 2 mypy GitHub Actions checks:
* `mypy.yml` runs mypy on every PR. This will list all errors, so it shouldn't block until errors are resolved.
* `mypy-new-errors.yml` compares the PR branch to `main` to ensure no new mypy errors are introduced. This check can be made blocking now and can be removed once all errors are resolved in favor of `mypy.yml`.
### Checklist
- [x] I have read the [CONTRIBUTING.md](https://github.com/google/adk-python/blob/main/CONTRIBUTING.md) document.
- [x] I have performed a self-review of my own code.
- [x] I have commented my code, particularly in hard-to-understand areas.
- [x] I have added tests that prove my fix is effective or that my feature works.
- [x] New and existing unit tests pass locally with my changes.
- [x] I have manually tested my changes end-to-end.
- [x] Any dependent changes have been merged and published in downstream modules.
COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/4276 from sararob:mypy-gh-actions 63130773c4862e90e352d4cb79221d78a6b9f5fd
PiperOrigin-RevId: 862226296
* The main fix is in eval_metrics.py
* Removed some deprecated paths in the FastAPI server
* Added a unit test to catch future breakages
* Bump fastapi version to be 0.124.1 to capture the fix in https://github.com/fastapi/fastapi/pull/14482
* Removed the upper-bound restriction on fastapi version which was used to temporarily fix the issue
Fixes#3173
Co-authored-by: Liang Wu <wuliang@google.com>
PiperOrigin-RevId: 861867708