Generated test JSON files for parallel_functions and pydantic_argument samples to verify their behavior.
Also fixed a test replay issue by ignoring timestamps in state (in agent_test_runner.py) to prevent false failures due to dynamic data.
Note: Some sample agents could not have tests generated successfully due to:
1. agent_tool_with_grounding_metadata: Fails on replay because AgentTool hides sub-agent events, causing mock LLM to get out of sync.
2. hello_world_stream_fc_args: Fails on rebuild because streaming function calls are not supported in the Unary API used by the test recorder.
3. output_schema_with_tools: Has external dependencies (Wikipedia/Google Search), making it unsuitable for automated regression tests without proper mocking.
Change-Id: I69df7daf49d175905dcbd85cf70914e460717915
- 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
* Implements live inference in evaluation_generator.py using Runner.run_live().
* Updates base_eval_service.py, local_eval_service.py to support live mode data structures and connection handling.
Testing: Added unit tests:
* test_generates_inferences_with_user_simulator_live
* test_live_session_manually_triggers_callbacks
* test_live_session_manually_triggers_callbacks_with_tools
* test_perform_inference_with_use_live
* test_perform_inference_single_eval_item_live
* test_perform_inference_single_eval_item_non_live
PiperOrigin-RevId: 916231029
Adds @functools.lru_cache to find_context_parameter so the inspect.signature
+ typing.get_type_hints lookup runs once per function, not on every MCP
confirmation callback or declaration build. No public surface change.
Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 916204929
AgentTool.run_async only extracted text parts from the inner agent's
response, silently dropping code_execution_result.output and
executable_code.code. Outer agents using an inner agent with a code
executor saw nothing.
Close#5481
Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 916196604
Previously, an empty `candidates` list without `prompt_feedback` resulted in an `UNKNOWN_ERROR`. This change updates the logic to handle such cases as a successful completion with no generated content, which is valid for certain model interactions like tool-driven turns.
Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 916115022
`part_to_message_block` iterated `content` char-by-char when a tool
returned it as a plain string (e.g. `LoadSkillResourceTool`'s
`{"content": <file text>}`), producing `"H\ne\nl\nl\no"` instead of
`"Hello"`. Guard the list branch with `isinstance(..., list)` and add
a sibling branch that passes a scalar string through directly, matching
Anthropic's `content: str | list[ContentBlockParam]` shape.
Close#5358
Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 916109239
This change introduces logic to identify events containing requests for tool confirmation or auth credentials. The compaction process will now stop before any such "Human-in-the-Loop" (HITL) events, ensuring that the full context of the interaction is preserved and not summarized away. This applies to both sliding window and token threshold compaction strategies.
Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 916108771
When judge_model_config is None, LlmRequest raises a ValidationError
because it requires a config. We now construct a default GenerateContentConfig
if one isn't provided.
Close#5677
Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 916087055
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
- Restrict invoke and review triggers purely to explicit user comments.
- Enforce strict author association verification (OWNER, MEMBER, COLLABORATOR).
- Enforce strict targeting assertion to ensure pull requests act on the main branch.
- Synchronize prompt constraints and GitHub action tools with the community catalog.
- Refine action API key options to uniformly target secrets.GOOGLE_API_KEY.
Co-authored-by: Shangjie Chen <deanchen@google.com>
PiperOrigin-RevId: 915654346
This CL implements the class in the integrations folder, used specifically for the Skill Registry API.
Co-authored-by: Kathy Wu <wukathy@google.com>
PiperOrigin-RevId: 915627057
This change enables the Google Cloud Telemetry exporter to use mTLS endpoints. It checks for the availability of client certificates and respects the GOOGLE_API_USE_CLIENT_CERTIFICATE environment variables to determine whether to use the mTLS-specific endpoint and configure the session accordingly.
PiperOrigin-RevId: 915541335
This is related to https://github.com/google/adk-python/issues/5327.
`BaseToolset.get_auth_config()` returns `None` by default and removing its overrides in toolsets that don't need OAuth flows to list tools does the job.
No regressions in unit tests (`pytest tests/unittests/auth`):
```
================================================================= 181 passed, 508 warnings in 4.23s =================================================================
```
PiperOrigin-RevId: 915128706
This change removes support for the deprecated `--session_db_url`, `--artifact_storage_uri`, and `--verbosity` flags from the ADK CLI. It also simplifies the service URI handling in `cli_deploy.py` by always using the new `--session_service_uri`, `--artifact_service_uri`, and `--memory_service_uri` flags, regardless of the ADK version.
The deprecated flags has been more than 1 year
Co-authored-by: Shangjie Chen <deanchen@google.com>
PiperOrigin-RevId: 915100881
Currently, BaseToolset caches its tools per invocation_id. Because SkillToolset dynamically resolves additional tools from the state when a skill is loaded, the cache prevents new tools from being picked up in the same invocation right after a load_skill call. This change sets `_use_invocation_cache = False` in SkillToolset so that it correctly re-evaluates the state-dependent tools at each step of the LLM generation loop within an invocation, preventing "Tool not found" errors.
PiperOrigin-RevId: 914997555
This CL introduces logic to handle scenarios where a non-ADK agent transitions to the `TaskState.input_required` or `TaskState.auth_required` states. It intercepts these events and converts them into a synthetic ADK `FunctionCall` event.
PiperOrigin-RevId: 914877123
When resuming a session with Anthropic (Claude) models, tool_use IDs were
getting stripped during content replay, causing BadRequestError from the
Anthropic API. Two fixes: (1) preserve function call IDs in the contents
flow for AnthropicLlm models, (2) sanitize invalid/empty tool_use IDs
to match Anthropic's required pattern (^[a-zA-Z0-9_-]+$) instead of
passing empty strings.
Fixes#5074
Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 914550905
Merge https://github.com/google/adk-python/pull/5597
**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):**
- Related: https://github.com/google/adk-python/issues/4971
**2. Or, if no issue exists, describe the change:**
_If applicable, please follow the issue templates to provide as much detail as
possible._
**Problem:**
A2A support lacked pluggable or persistent task store backends, forcing a strict default to `InMemoryTaskStore`.
**Solution:**
Extended `ServiceRegistry` and `ServiceFactory` to support URI-driven configuration for A2A task stores. Added built-in support for `memory://`, `postgresql://`, `mysql://`, and `sqlite://` schemes. Plumbed the options down into `to_a2a()` and `get_fast_api_app()`, ensuring connection strings are securely redacted from application logs.
### Testing Plan
**Unit Tests:**
- [x] I have added or updated unit tests for my change.
- [x] All unit tests pass locally.
Summary: Ran `pytest` against `test_agent_to_a2a.py`, `test_fast_api.py`, `test_service_registry.py`, and `test_service_factory.py`. All 131 unit tests passed successfully.
**Manual End-to-End (E2E) Tests:**
Compiled the package distribution wheel via `uv build` and successfully validated its installation inside a clean isolated sandbox environment via `uv pip install dist/google_adk-1.32.0-py3-none-any.whl[a2a]`. Verified that the application instantiates default in-memory stores and custom persistent URI stores
### 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/5597 from allen-stephen:feat/a2a-task-store-support f53ba0fa35fa3c28e4923b6850a5873fd5293525
PiperOrigin-RevId: 914496800