nltk 3.10.1 added an import-time security hook (nltk/inisec.py) that breaks any
ADK code path reaching nltk, in two independent ways:
1. It installs a meta-path finder that raises ImportError for any module whose
file resolves under the current working directory while an nltk frame is on
the stack. The standard layout puts the virtualenv inside the project
(.venv/), so every site-packages module nltk imports looks like a CWD hijack
and a plain `import nltk` dies on `import regex`.
2. It calls os.environ.setdefault("PYTHONSAFEPATH", "1"), which leaks into every
subprocess started afterwards. PYTHONSAFEPATH stops CPython from prepending
the script/CWD entry to sys.path, and that prepend is what causes the eagerly
created `google` namespace package (from google-cloud-aiplatform's legacy
*-nspkg.pth) to recompute its __path__ and pick up src/google. Without it,
`import google.adk` fails with ModuleNotFoundError in child interpreters.
Note this happens even when the nltk import itself fails, because the hook
installs before the failure, so catching the ImportError does not undo it.
Three extras reach nltk, and all three are constrained here:
* eval -> rouge-score -> nltk. Breaks final_response_match_v1,
response_evaluator, metric_evaluator_registry,
local_eval_service, the local eval sampler and the eval CLI.
* extensions -> llama-index-{embeddings-google-genai,readers-file} ->
llama-index-core -> nltk. llama-index-core imports nltk
lazily, so `import llama_index.core` is fine, but the first
real sentence split (SentenceSplitter, reached through
FilesRetrieval -> VectorStoreIndex for any document larger
than one chunk) triggers it.
* test -> both of the above.
nltk reverted the hook upstream in nltk/nltk#3732, but that is not released yet
and 3.10.1 is not yanked, so resolvers keep selecting it. The `!=` form picks up
3.10.2 automatically once it ships.
Co-authored-by: Liang Wu <wuliang@google.com>
PiperOrigin-RevId: 959276418
Importing google.adk eagerly pulled in Agent, Runner, Workflow, and the server
and CLI runtimes even for callers that used none of them, and google-genai
imported the MCP client and FastMCP server stack whenever MCP happened to be
installed. The package, agents, workflow, cli, and cli.utils namespaces now
resolve their exports lazily on first use (PEP 562) through a shared
google.adk.utils._lazy helper. Importing google.adk drops from roughly 2.1s to
a few ms.
Public APIs and object identities are unchanged, with two things to note when
upgrading:
* The google-genai floor moves from 2.9 to 2.12.1, the release that defers MCP
itself. Environments pinned below 2.12.1 will fail to resolve.
* google.adk.cli.utils no longer re-exports BaseAgent and LlmAgent. They were
unused eager imports, never part of that module's __all__; import them from
google.adk.agents instead.
Lazy resolution moves failures from import time to first use, so a missing or
broken optional dependency now surfaces on the first request rather than at
process start. Long-running servers pay the one-time resolution cost on their
first request; a warmup hook is deliberately left to a follow-up so this change
adds no public API.
Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 956721154
Raise the `extensions` and `test` floors past the releases that reconstruct
arbitrary Python objects while deserializing checkpoint data: langgraph 1.0.10
(CVE-2026-28277) and langgraph-checkpoint 4.1.1 (CVE-2026-48775).
langgraph-checkpoint needs a pin of its own because even langgraph 1.2.9 only
requires `langgraph-checkpoint>=4.1.0,<5`.
Breaking change: LangGraph 0.x is no longer supported. The `extensions` extra
and `LangGraphAgent` now require 1.x.
Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 956648992
Adds OCIGenAILlm under integrations/oci/, for Google Gemini and other models
hosted on Oracle Cloud Infrastructure Generative AI. Optional install:
pip install google-adk[oci]. LLMRegistry auto-routing and the
google.adk.models import surface are preserved.
The OpenAI-compatible transport from the source PR (OCIGenAIOpenAILlm) is
not taken. It reimplemented the message, tool and response conversion plus
the streaming loop that OpenAILlm already provides; the right form is a
small subclass overriding the OpenAI client, which cannot live in
integrations/ while OpenAILlm is still experimental. It can land separately
once that settles.
The OCI client is now built once per instance rather than per request, so a
call no longer re-reads the OCI config from disk.
Merge https://github.com/google/adk-python/pull/5285Closes#5069
Co-authored-by: George Weale <gweale@google.com>
COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/5285 from fede-kamel:feat/oci-generative-ai 0230acc0a93b7e43014f2ef3a8b89de463a50bd8
PiperOrigin-RevId: 955453382
Merge https://github.com/google/adk-python/pull/6458
Live/audio agent eval was only exercisable through private internal service imports; the public surface (CLI, dev-server, AgentEvaluator) always ran non-live text inference, so users had no supported path to evaluate Live API agents with a simulated audio user.
This threads `use_live` through all three public entrypoints, fixes the live-send path so native-audio models accept simulated user audio, and lets the dev-server select an audio (`llm_audio`) user simulator over HTTP. Live transcriptions are consolidated to text, with the text response preferred as the gradable output for turns carrying both audio and a transcript.
Adds a runnable sample (`live_non_blocking_tool_agent` evalset + `test_config` with `use_live: true` and a Gemini TTS audio simulator) plus unit tests covering `use_live` propagation, request validation, resampling, and the realtime-audio send path.
COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/6458 from allen-stephen:feat/live-eval-parity 3fc33a2616d1515c822387deb8d70c27d5bc6244
PiperOrigin-RevId: 954725627
This adds a new integration for Google Cloud Eventarc Advanced.
Provides `eventarc_toolset` which allows LLM agents to publish structured
CloudEvents. It strictly validates and sanitizes attributes according to the
CloudEvents 1.0 specification and supports dynamically resolving fields like `time`
and `id` at runtime using lambdas.
Includes comprehensive testing and documentation.
PiperOrigin-RevId: 952384562
Ensure requested tool confirmations are correctly serialized and
deserialized in the session service.
Co-authored-by: Shangjie Chen <deanchen@google.com>
PiperOrigin-RevId: 951775012
The starlette lower bound allowed releases affected by CVE-2026-48710 and
related advisories. Raise the minimum to 1.3.1, which resolves them.
Close#6038
Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 948661065
Widen the a2a-sdk dependency constraint to >=0.3.4,<2 (both the a2a and test
extras) and re-lock so the ADK A2A integration resolves to a2a-sdk 1.x by
default while still supporting 0.3.x. The dual-version CI added in the parent
change keeps the compatibility shim verified against both SDK majors.
PiperOrigin-RevId: 945017973
Scope the delta check to the files the CL changed via the kokoro
presubmit_request, and decouple the workspace copy so mypy module
resolution is stable.
Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 941321034
Merge https://github.com/google/adk-python/pull/6128
…ection
Expose a parameterized query tool execute_sql_parameterized that automatically maps and injects secure parameters (like user_id) from the tool context to Bigtable's view_parameters.
**Please ensure you have read the [contribution guide](https://github.com/google/adk-python/blob/main/CONTRIBUTING.md) before creating a pull request.**
### Link to Issue or Description of Change
**1. Link to an existing issue (if applicable):**
- Closes: #_issue_number_
- Related: #_issue_number_
**2. Or, if no issue exists, describe the change:**
_If applicable, please follow the issue templates to provide as much detail as
possible._
**Problem:**
_A clear and concise description of what the problem is._
**Solution:**
_A clear and concise description of what you want to happen and why you choose
this solution._
### Testing Plan
_Please describe the tests that you ran to verify your changes. This is required
for all PRs that are not small documentation or typo fixes._
**Unit Tests:**
- [ ] I have added or updated unit tests for my change.
- [ ] All unit tests pass locally.
_Please include a summary of passed `pytest` results._
**Manual End-to-End (E2E) Tests:**
_Please provide instructions on how to manually test your changes, including any
necessary setup or configuration. Please provide logs or screenshots to help
reviewers better understand the fix._
### Checklist
- [ ] I have read the [CONTRIBUTING.md](https://github.com/google/adk-python/blob/main/CONTRIBUTING.md) document.
- [ ] I have performed a self-review of my own code.
- [ ] I have commented my code, particularly in hard-to-understand areas.
- [ ] I have added tests that prove my fix is effective or that my feature works.
- [ ] New and existing unit tests pass locally with my changes.
- [ ] I have manually tested my changes end-to-end.
- [ ] Any dependent changes have been merged and published in downstream modules.
### Additional context
_Add any other context or screenshots about the feature request here._
COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/6128 from ad548:feat/bigtable-parameterized-views f5902fd7ef834f326a43c7c01990d0648e7ec06c
PiperOrigin-RevId: 941207338
`_get_contents` deep-copied `event.content` for every event on every LLM
request, just to strip ADK-generated (`adk-` prefixed) function call/response
ids and to isolate the contents from downstream request processors that mutate
parts in place (e.g. nl_planning clearing `part.thought`, code_execution
rewriting parts). The deepcopy recursed into large
`function_call.args`/`inline_data` payloads, and cost grew with conversation
length (a dominant non-LLM CPU sink in profiling, ~4-7s of a ~30s run).
Replace it with a shallow copy: the `Content` and every `Part` are
`model_copy`-d (so downstream in-place mutations stay isolated from session
events), but the payloads (`args`/`response`/`inline_data`/...) are shared by
reference instead of deep-copied.
Adds regression tests (id stripping and downstream-mutation isolation) and a
google_benchmark perf script.
Benchmark (_get_contents over a 500-turn history, ~23x):
Before (copy.deepcopy):
-------------------------------------------------------
Benchmark Time CPU Iterations
-------------------------------------------------------
get_contents 781559706 ns 781443557 ns 1
After (per-part shallow copy):
-------------------------------------------------------
Benchmark Time CPU Iterations
-------------------------------------------------------
get_contents 33996069 ns 33987197 ns 20
PiperOrigin-RevId: 940664677
Merge https://github.com/google/adk-python/pull/6074
## Summary
`ContainerCodeExecutor` runs model-generated code, which can be influenced by untrusted input (e.g. via prompt injection). It starts the container with default Docker networking and no capability restrictions, so the executed code can reach the cloud metadata endpoint (`169.254.169.254`) — which yields the host service-account token — reach internal services, or escalate privileges.
This is inconsistent with the isolation posture of every other ADK code executor:
- `GkeCodeExecutor` runs under gVisor with `cap_drop: ["ALL"]`, non-root, read-only root filesystem, and a strict security context.
- `BuiltInCodeExecutor` / `VertexAiCodeExecutor` / `AgentEngineSandboxCodeExecutor` run in managed server-side sandboxes.
- `UnsafeLocalCodeExecutor` is explicitly documented as unsafe.
`ContainerCodeExecutor` was the only executor running code with full network access and no isolation flags or warning.
## Change
- Start the container with networking disabled by default. This is exposed as a configurable `network_enabled` field — set it to `True` to re-enable networking when the executed code is trusted.
- Drop all Linux capabilities (`cap_drop=["ALL"]`) and forbid privilege escalation (`security_opt=["no-new-privileges"]`), matching `GkeCodeExecutor`.
- Document the security posture in the class docstring and point users to the sandboxed executors for untrusted code.
- Add unit tests covering the hardened defaults and the opt-in network path.
## Compatibility
Code that legitimately needs network access can opt back in with `ContainerCodeExecutor(..., network_enabled=True)`. Dropping capabilities and `no-new-privileges` do not affect normal Python code execution.
Co-authored-by: George Weale <gweale@google.com>
COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/6074 from adilburaksen:harden/container-code-executor-network f7eaec252d2369d710eb54ea6c51b2bc4e525e7a
PiperOrigin-RevId: 938260811
This change relaxes the litellm dependency pin from >=1.83.7,<=1.83.14 to
>=1.84.0. This resolves a critical security vulnerability (CVE-2026-49468)
by allowing upgrades to safe releases.
PiperOrigin-RevId: 937679582
Merge https://github.com/google/adk-python/pull/4853
## Description
The built-in `load_web_page` tool requires `beautifulsoup4` and `lxml`, which are available via the `[extensions]` optional dependency group. When a user installs `google-adk` without the `[extensions]` extra and calls `load_web_page`, they get a raw `ModuleNotFoundError: No module named 'bs4'` with no guidance on how to resolve it.
This change wraps the deferred imports in a `try/except` to provide a clear, actionable error message:
```
ImportError: load_web_page requires the "beautifulsoup4" and "lxml" packages.
Install them with: pip install google-adk[extensions]
```
Fixes#4852
Co-authored-by: Liang Wu <wuliang@google.com>
COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/4853 from brucearctor:fix/load-web-page-import-error 27aa20eb54d9b408e02a502ffd9ca0825e498cf6
PiperOrigin-RevId: 933416379
Merge https://github.com/google/adk-python/pull/6102
## Summary
Bump the floor on `opentelemetry-instrumentation-google-genai` from `>=0.6b0` / `>=0.3b0` to `>=0.7b1` in both the `otel-gcp` and `test` extras, so it is compatible with the pinned `google-genai>=2.8,<3`.
## Problem
`opentelemetry-instrumentation-google-genai` versions before `0.7b1` hardcode a runtime gate in `instrumentation_dependencies()`:
```python
return ["google-genai>=1.0.0,<2"]
```
This `<2` cap is **not** in the package metadata (which only declares `google-genai>=1.0.0`), so dependency resolvers happily install e.g. `0.7b0` alongside `google-genai 2.8.0`. The conflict only surfaces at runtime: `instrumentor.instrument()` detects the violation, logs a `DependencyConflict`, and **silently no-ops** — `Models.generate_content` is never wrapped, so genai telemetry is disabled entirely with no hard error.
This was caught by `tests/unittests/telemetry/test_functional.py::test_instrumented_with_opentelemetry_instrumentation_google_genai`, which fails with `assert False` when a pre-`0.7b1` instrumentor is resolved (the post-`instrument()` assertion that the SDK reports as instrumented).
## Fix
`0.7b1` widens the gate to `google-genai>=1.0.0,<3`, which `2.8.0` satisfies. The existing floors allowed resolvers to land on a broken version; raising both to `>=0.7b1` makes the requirement consistent with the genai 2.8 pin and fail-safe.
## Impact
- Restores google-genai OTel instrumentation for users on genai 2.x with the `otel-gcp` extra.
- Prevents the test suite from resolving a broken instrumentor.
## Test plan
- [x] `uv.lock` already resolved to `0.7b1`; no lockfile change needed (only the specifier floor moved).
- [x] `tests/unittests/telemetry/test_functional.py`: 6 passed (previously 1 failed: `test_instrumented_...`).
- [x] pre-commit (`pyproject-fmt`) passes.
Co-authored-by: Wei Sun (Jack) <weisun@google.com>
COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/6102 from google:fix/otel-genai-instrumentor-floor 8e2154fb72939d1f2dbbc9db2fb9597d10e3b2c2
PiperOrigin-RevId: 931465846
Tangential changes include:
- Including `parameters_json_schema` in experimental semconv tool
definitions
- Narrowing dependency on OTel libraries to:
- >= 1.39, because it removed the deprecated logging APIs
- <= 1.42.1, because it's the latest OTel version
Co-authored-by: Max Ind <maxind@google.com>
PiperOrigin-RevId: 931355343
Merge https://github.com/google/adk-python/pull/6097
## Summary
Adopts **ruff** to enforce unused-import (F401) hygiene going forward, so dead imports are caught automatically instead of relying on IDE highlights. (The bulk one-time cleanup already landed in #6095; this is just the tooling.)
- `[tool.ruff]` in `pyproject.toml`: select `F401`, exempt `__init__.py` (intentional public re-exports), and exclude four files that hardcode `googleapis.com` URLs so cleanup doesn't trip the `check-file-contents` mTLS policy.
- ruff pre-commit hook scoped to `src/`.
- `scripts/run_precommit_checks.py` (the no-git standalone runner) learns the ruff hook, passing `--force-exclude` so excludes are honored on explicit file args.
- Pin `ruff` in the dev extra to match the hook version.
## Test plan
- [x] `ruff check src/` passes (excludes honored)
- [x] pre-commit ruff hook runs green
- [x] standalone runner check/fix modes verified
Co-authored-by: Wei Sun (Jack) <weisun@google.com>
COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/6097 from google:chore/adopt-ruff-f401 b0636523926d02f12af4b86cff2b1a1bb94af150
PiperOrigin-RevId: 931304052
Merge https://github.com/google/adk-python/pull/6084
## Summary
Adds `scripts/run_precommit_checks.py` to run the `.pre-commit-config.yaml` checks **without** the `pre-commit` framework, which requires a git repository and so cannot run in environments such as a piper checkout that has no `.git`.
- Parses `.pre-commit-config.yaml` so the file lists, global/per-hook `exclude` and `files` patterns, and `args` all come from the config — only the hook-id → CLI command mapping (and each hook's implicit file-type/text filter) is maintained in the script.
- Defaults to fixing in place; pass `--check` to verify only (CI behavior).
- Limits the walk to `src`/`tests`/`contributing`/`pyproject.toml` and never follows symlinks, so `.venv`, build artifacts, and out-of-repo code (e.g. a symlinked `a2a`) are never touched.
- Skips binary files for text fixers, and batches arguments to stay under the OS arg limit.
- `scripts/run_precommit.sh` is a thin wrapper that prefers an already-synced interpreter (`.venv` / active venv) before falling back to `uv run`.
- Adds the standalone lint tools to the `dev` extra (capped at the next major) so `uv sync --extra dev` provides everything the script needs.
## Test plan
- [ ] `scripts/run_precommit.sh --check` passes on a clean tree
- [ ] `scripts/run_precommit.sh` (default fix mode) does not modify binaries (images/PDFs) or `.venv`
- [ ] Runs from any directory; PATH args are repo-root-relative
- [ ] `addlicense` / `check-new-py-prefix` degrade gracefully when unavailable / git-only
Co-authored-by: Wei Sun (Jack) <weisun@google.com>
COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/6084 from google:chore/dev-precommit-script fa3863332f9acf824df2a3ad3b923141d7838f5d
PiperOrigin-RevId: 930799785
Merge https://github.com/google/adk-python/pull/6083
### Link to Issue or Description of Change
Add support for live translation with the Live API -> https://ai.google.dev/gemini-api/docs/live-api/live-translate
### Testing Plan
**Unit Tests:**
- [X] I have added or updated unit tests for my change.
- [X] All unit tests pass locally.
### 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/6083 from allen-stephen:feat/enable-live-translate 6a0f5b7525bfc985f51b25e2d7f12a55ca14b75d
PiperOrigin-RevId: 930782786
Merge https://github.com/google/adk-python/pull/6040
## Summary
Introduces `google.adk.labs.antigravity` with `AntigravityAgent`, a `BaseAgent` that runs a Google Antigravity SDK agent (described by an `AgentConfig`) as a native ADK root agent. Lives under `labs/` as an experimental feature.
- Delegates each turn to a fresh SDK `Agent` and maps trajectory steps to ADK events: model text, function calls/responses, and SSE-gated partial thinking/text deltas.
- Folder-based session resumption via `config.save_dir`: renames the harness trajectory to a deterministic per-session name and skips replayed steps using a persisted resume step index.
- Restricted to standalone root use (local mode only) with construction-time guards (cannot be a sub-agent or have sub-agents).
- `serialize_agent` now honors `Field(exclude=True)` so the non-serializable `config` does not break the `build_graph` endpoint.
- Adds the `[antigravity]` optional extra (in both the extra and `test` groups, with `uv.lock` updated), a game-developer sample, package README, and unit tests.
## Test plan
- [ ] `pytest tests/unittests/labs/antigravity/` (22 unit tests pass)
- [ ] `pytest tests/unittests/cli/utils/test_graph_serialization.py`
- [ ] Manual: run the sample via `adk web` with `GEMINI_API_KEY` and a `[antigravity]` install, confirm multi-turn resumption and no duplicate events.
Co-authored-by: Wei Sun (Jack) <weisun@google.com>
COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/6040 from google:feat/antigravity-agent 304f6ad4d1e9edc414a28aa01eb77028519de11a
PiperOrigin-RevId: 930712984
Merge https://github.com/google/adk-python/pull/6031
> **Stacked on #6030** (`fix/experimental-typing`). This PR targets that branch; please review/merge #6030 first, after which this will be retargeted to `main`.
## Summary
Adds `E2BEnvironment`, a `BaseEnvironment` backed by an [E2B](https://e2b.dev) sandbox. It gives agents a persistent remote workspace for shell execution, file CRUD, and on-demand installs (`pip`/`apt`) without touching the host machine.
- The sandbox TTL is bounded to cap credit usage and is extended on each operation; an expired idle sandbox is transparently recreated.
- Lazy-imports the SDK behind a new `e2b` extra, so the base package stays lean.
- Includes a data-analysis sample that downloads a public (GCS-hosted) dataset and analyzes it inside the sandbox.
## Usage
```python
from google.adk.integrations.e2b import E2BEnvironment
from google.adk.tools.environment import EnvironmentToolset
toolset = EnvironmentToolset(environment=E2BEnvironment())
```
## Test plan
- [x] `pytest tests/unittests/integrations/e2b/` (14 passed)
- [x] `pyright src/google/adk/integrations/e2b/_e2b_environment.py` — 0 errors
- [x] Sample agent loads (`contributing/samples/environment_and_skills/e2b_environment`)
- [ ] Manual run against a live E2B sandbox (requires `E2B_API_KEY`)
Co-authored-by: Wei Sun (Jack) <weisun@google.com>
COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/6031 from google:feat/e2b f2b5584e28c71e7110e9d98e1d0839f575183368
PiperOrigin-RevId: 929443164
Starlette prior to 1.0.1 did not validate the HTTP Host header before
reconstructing request.url, allowing a malformed header to bypass
security restrictions based on request.url.path. Bump starlette to
>=1.0.1 and fastapi to >=0.133.0 (the minimum version compatible with
starlette >=1.0.1).
Fixes#5893
Merge https://github.com/google/adk-python/pull/5894
Change-Id: If7743e53d95740452c9e562e9bba98d132ae049e
Update ADK to support the new Interactions API. See: https://ai.google.dev/gemini-api/docs/interactions-breaking-changes-may-2026
Key changes include:
* Updated `interactions_utils.py` to parse new v2 interaction events such as
`InteractionCreatedEvent`, `InteractionCompletedEvent`, and explicit step
types (`ModelOutputStep`, `FunctionCallStep`, etc.).
* Transitioned from "turns" to "steps" terminology, including renaming
`convert_contents_to_turns` to `convert_contents_to_steps`.
* Updated `contributing/samples/interactions_api`
Breaking Changes in interactions_utils.py:
- Renamed "turn" functions to "step" equivalents:
- `convert_content_to_turn` -> `_convert_content_to_step`
- `convert_contents_to_turns` -> `_convert_contents_to_steps`
- `convert_interaction_output_to_part` -> `_convert_interaction_step_to_parts`
- Updated `build_interactions_request_log` to use required `input_steps` instead of `input_turns`.
- Deprecated `convert_part_to_interaction_content`
Change-Id: I962724321342ba0192251896ce51832b214d60d9
Importing `gcp_utils` during `adk create` caused a ModuleNotFoundError because `resourcemanager_v3` was imported at module level. Moved the import into `list_gcp_projects` function scope where ImportError is caught specifically to raise an informative RuntimeError indicating they need to install the 'gcp' optional dependency. Also added google-cloud-resource-manager to optional dependencies.
Fixes https://github.com/google/adk-python/issues/5766
Change-Id: I9469e03c72342730cd0a1418551305a5e8058f60
- 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