2334 Commits

Author SHA1 Message Date
Xiang (Sean) Zhou 950a3b2d0a chore: update the component owner
Co-authored-by: Xiang (Sean) Zhou <seanzhougoogle@google.com>
PiperOrigin-RevId: 885138365
v1.27.2
2026-03-17 11:59:20 -07:00
George Weale fc45fa68d7 feat: Add support for Anthropic's thinking_blocks format in LiteLLM integration
This change enables the LiteLLM adapter to correctly parse and generate Anthropic's structured "thinking_blocks" format, which includes a "signature" for each thought block. The "signature" is crucial for Anthropic models to maintain their reasoning state across multiple turns, particularly when tool calls are made

Close #4801

Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 885131757
2026-03-17 11:45:37 -07:00
George Weale b318eee979 fix: Store and retrieve usage_metadata in Vertex AI custom_metadata
The Vertex AI session service does not natively support persisting usage_metadata. This change serializes usage_metadata into the custom_metadata field under the key '_usage_metadata' when appending events and deserializes it back when retrieving events. This allows usage information to be round-tripped through the Vertex AI session service.

Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 885121070
2026-03-17 11:24:32 -07:00
Google Team Member 28618a8dcb feat: Add Spanner Admin Toolset
This change introduces a new `SpannerAdminToolset` with tools for managing Google Cloud Spanner resources. The toolset includes functions to list and get details of Spanner instances and instance configurations, and to create, list databases. The new toolset is marked as experimental. Unit tests for the new admin tools are also added

PiperOrigin-RevId: 885116111
2026-03-17 11:14:37 -07:00
Xuan Yang 22fc332c95 fix: Support resolving string annotations for find_context_parameter
Co-authored-by: Xuan Yang <xygoogle@google.com>
PiperOrigin-RevId: 884686010
2026-03-16 16:18:35 -07:00
George Weale 8b973187df test: Update LiteLLM finish_reason unmapped test
The previous test for unmapped LiteLLM finish_reason values was ineffective because LiteLLM's internal models normalize certain values (e.g., "eos" to "stop") before ADK processes them

Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 884678119
2026-03-16 16:02:20 -07:00
Divyansh Shukla e6476c9790 fix: Prevent uv.lock modifications in unittests.sh
PiperOrigin-RevId: 884597343
2026-03-16 13:01:15 -07:00
nikkie a231c729e6 fix(models): update 429 docs link for Gemini
Merge https://github.com/google/adk-python/pull/4818

**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

**2. Or, if no issue exists, describe the change:**

**Problem:**
`src/google/adk/models/google_llm.py` includes a mitigation link for `429 RESOURCE_EXHAUSTED`, but the current URL points to a broken docs anchor:
https://google.github.io/adk-docs/agents/models/#error-code-429-resource_exhausted
<img width="1067" height="640" alt="image" src="https://github.com/user-attachments/assets/8aee07da-3007-4312-93d3-161321c01f2f" />

**Solution:**
Update the link to the current Gemini-specific docs page so users are directed to the correct troubleshooting section:
https://google.github.io/adk-docs/agents/models/google-gemini/#error-code-429-resource_exhausted
<img width="1161" height="732" alt="image" src="https://github.com/user-attachments/assets/1badf7ab-9411-4f56-a719-6ba2a61ca7ce" />

### Testing Plan

This is a small string-only fix for a broken documentation link.
No unit tests were added because there does not appear to be existing test coverage for this message and the change does not affect runtime behavior beyond the emitted URL.

**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:**

Confirmed the updated URL in the source points to the intended documentation page/anchor.

### 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.
- [ ] 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.
- [x] I have manually tested my changes end-to-end.
- [ ] Any dependent changes have been merged and published in downstream modules.

### Additional context

This change only updates the documentation URL shown in the `RESOURCE_EXHAUSTED` guidance message.

COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/4818 from ftnext:fix-429-doc-link 1c533453a9428a3fcc6d22b97d64834f0a4f3acb
PiperOrigin-RevId: 884581120
2026-03-16 12:24:49 -07:00
Xiang (Sean) Zhou 4752f3f993 chore: Add a sample agent for files_retrieval tool
this sample can be used to test the latest gemini embedding model

Co-authored-by: Xiang (Sean) Zhou <seanzhougoogle@google.com>
PiperOrigin-RevId: 884574396
2026-03-16 12:12:21 -07:00
George Weale 50d6f35139 fix: Remove redundant client_id from fetch_token call
When using OAuth2Session with `client_secret_post`, Authlib automatically includes the client_id and client_secret in the request body. Explicitly passing `client_id` again results in a duplicate parameter in the token exchange request, which can cause issues with some OAuth providers.

Close #4782

Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 884574091
2026-03-16 12:11:30 -07:00
Kathy Wu 71d26ef7b9 feat: Add support for timeout to UnsafeLocalCodeExecutor
Co-authored-by: Kathy Wu <wukathy@google.com>
PiperOrigin-RevId: 884557773
2026-03-16 11:39:31 -07:00
Ankur Sharma 38bfb44754 feat: Add MultiTurn Task trajectory and tool trajectory metrics
Tool use:
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.
Task trajectory:
this metric is different from `Multi-Turn Overall Task Success`,
  in the sense that task success only concerns itself with the goal of whether
  the success was achieved or not. How that was achieved is not its concern.
  This metric on the other hand does care about the path that agent took to
  achieve the goal.

Co-authored-by: Ankur Sharma <ankusharma@google.com>
PiperOrigin-RevId: 884525532
2026-03-16 10:44:28 -07:00
Ankur Sharma 9a75c06873 feat: Add MultiTurn Task success metric
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
2026-03-16 10:09:05 -07:00
Google Team Member 360e0f7eba feat: Add database_role property to SpannerToolSettings and use it in execute_sql to support fine grained access controls
PiperOrigin-RevId: 884166439
2026-03-15 19:31:08 -07:00
Google Team Member 6c34694da6 feat: Enhance AgentEngineSandboxCodeExecutor sample to automatically provision an Agent Engine if neither agent_engine_resource_name nor sandbox_resource_name is provided
The AgentEngineSandboxCodeExecutor now has three initialization modes:
1.  Create both an Agent Engine and sandbox if neither resource name is provided.
2.  Creating a new sandbox within a provided agent_engine_resource_name.
3.  Using a provided sandbox_resource_name.

PiperOrigin-RevId: 884088248
2026-03-15 13:48:07 -07:00
Xiang (Sean) Zhou f8270c826b fix(deps): bump google-genai minimum to >=1.64.0 for gemini-embedding-2-preview
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
2026-03-14 10:33:41 -07:00
Liang Wu 4010716470 fix(bigquery): use valid dataplex OAuth scope
Closes issue #4805

Co-authored-by: Liang Wu <wuliang@google.com>
PiperOrigin-RevId: 883403628
2026-03-13 16:59:53 -07:00
Kathy Wu b24f60452d chore: Move langchain tool into integrations folder
Co-authored-by: Kathy Wu <wukathy@google.com>
PiperOrigin-RevId: 883403479
2026-03-13 16:59:02 -07:00
Kathy Wu e3b58e22c3 chore: Move crew ai tool into integrations folder
Co-authored-by: Kathy Wu <wukathy@google.com>
PiperOrigin-RevId: 883401885
2026-03-13 16:54:18 -07:00
Piyush Mourya 8f826972cc feat(mcp): add sampling callback support for MCP sessions
Merge https://github.com/google/adk-python/pull/4718

### Link to Issue or Description of Change

**1. Link to an existing issue (if applicable):**

- Closes: N/A
- Related: N/A

**2. Or, if no issue exists, describe the change:**

**Problem**

ADK’s MCP integration currently does not expose the MCP sampling callback capability.
This prevents agent-side LLM sampling handlers from being used when interacting with MCP servers that support sampling.

The MCP Python SDK supports sampling callbacks, but these parameters are not propagated through the ADK MCP integration layers.

**Solution**

Add sampling callback support by propagating the parameters through the MCP stack:

- Add `sampling_callback` and `sampling_capabilities` parameters to `McpToolset`
- Forward them to `MCPSessionManager`
- Forward them to `SessionContext`
- Pass them into `ClientSession` initialization

This enables agent-side sampling handling when interacting with MCP servers.

---

### Testing Plan

**Unit Tests**

- [x] I have added or updated unit tests for my change.
- [x] All unit tests pass locally.

Added `test_mcp_sampling_callback.py` to verify that the sampling callback is correctly invoked.

Example result:
pytest tests/unittests/tools/mcp_tool/test_mcp_sampling_callback.py
1 passed

**Manual End-to-End (E2E) Tests**

Manual testing was performed using a FastMCP sampling example server where the sampling callback was invoked from the agent side and returned the expected response.

---

### Checklist

- [x] I have read the CONTRIBUTING.md document.
- [x] I have performed a self-review of my own code.
- [x] I have commented my code where necessary.
- [x] I have added tests proving the feature works.
- [x] Unit tests pass locally.
- [x] I have manually tested the change end-to-end.

---

### Additional context

This change aligns ADK MCP support with the sampling capabilities available in the MCP Python SDK and enables agent implementations to handle sampling requests via a callback.

Co-authored-by: Kathy Wu <wukathy@google.com>
COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/4718 from Piyushmrya:fix-mcp-sampling-callback 18f477f04ad357d698b0a4c8a4392936b9f6d185
PiperOrigin-RevId: 883401178
2026-03-13 16:53:22 -07:00
Xiang (Sean) Zhou faafac9bb3 feat: Support new embedding model in files retrieval
Co-authored-by: Xiang (Sean) Zhou <seanzhougoogle@google.com>
PiperOrigin-RevId: 883401159
2026-03-13 16:52:33 -07:00
Wei (Jack) Sun 9b3888b637 chore: merge release v1.27.1 to main
Merge https://github.com/google/adk-python/pull/4833

Syncs version bump and CHANGELOG from release v1.27.1 to main.

COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/4833 from google:release/v1.27.1 bc1b50020109004c6797b153a5e9b8144a22aebd
PiperOrigin-RevId: 883394436
2026-03-13 16:34:07 -07:00
Achuth Narayan Rajagopal 0e18f81a5c fix(telemetery): Rolling back change to fix issue affecting LlmAgent creation due to missing version field
Co-authored-by: Achuth Narayan Rajagopal <achuthr@google.com>
PiperOrigin-RevId: 883336463
2026-03-13 14:21:10 -07:00
Xuan Yang 51c19cbc13 docs: Use a dedicated API key for docs agents
Co-authored-by: Xuan Yang <xygoogle@google.com>
PiperOrigin-RevId: 883246168
2026-03-13 11:04:26 -07:00
Google Team Member 6f0dcb3e26 feat: Add a new extension for the new version of ADK-A2A integration
This change introduces a new interceptor that adds the 'https://google.github.io/adk-docs/a2a/a2a-extension/' extension to the request headers in the A2A client from the RemoteAgent side. To send this extension along with requests, the RemoteAgent has to be instantiated with the `use_legacy` flag set to False. The AgentExecutor will default to the new implementation when this extension is requested by the client, but this behavior can be disabled via the `use_legacy` flag.
The 'force_new' flag on the agent_executor side can be used to bypass the presence of the extension, and always activate the new version of the agent_executor.

PiperOrigin-RevId: 883021792
2026-03-13 01:29:11 -07:00
Rohit Yanamadala 780093f389 docs: Feat/Issue Monitoring Agent
Merge https://github.com/google/adk-python/pull/4622

Co-authored-by: Xuan Yang <xygoogle@google.com>
COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/4622 from rohityan:feat/IssueWatchdog 560937039d0a218b27d9cea767abd9a88a004822
PiperOrigin-RevId: 882987318
2026-03-12 23:56:52 -07:00
Guoyi Lou 31b005c301 ADK changes
Co-authored-by: Guoyi Lou <guoyilou@google.com>
PiperOrigin-RevId: 882787811
2026-03-12 17:37:28 -07:00
Wei (Jack) Sun abf88a9476 chore: merge release v1.27.0 to main
Co-authored-by: Liang Wu <18244712+wuliang229@users.noreply.github.com>
2026-03-12 15:56:40 -07:00
Liang Wu c910961501 feat: Add SSE streaming support to conformance tests
Co-authored-by: Liang Wu <wuliang@google.com>
PiperOrigin-RevId: 882293566
2026-03-11 18:08:05 -07:00
Liang Wu 0847f511d2 chore: Update actions/checkout to v6 in GitHub workflows
V4 still uses deprecated Node.js 20.

Co-authored-by: Liang Wu <wuliang@google.com>
PiperOrigin-RevId: 882275971
2026-03-11 17:18:26 -07:00
Divyansh Shukla 6f6fd955f6 fix: Fix IDE hangs by moving test venv and cache to /tmp
PiperOrigin-RevId: 882270600
2026-03-11 17:04:24 -07:00
George Weale 7b94a76733 fix: Refactor LiteLlm check to avoid ImportError
The `can_use_output_schema_with_tools` function now checks if a model is a LiteLlm instance by inspecting its type's Method Resolution Order, rather than directly importing `LiteLlm`

Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 882253446
2026-03-11 16:25:01 -07:00
Kathy Wu 066fcec3e8 feat: Add support for toolsets to additional_tools field of SkillToolset
Co-authored-by: Kathy Wu <wukathy@google.com>
PiperOrigin-RevId: 882212923
2026-03-11 14:58:24 -07:00
George Weale ae565be30e fix: Preserve thought_signature in LiteLLM tool calls
This change adds logic to extract and re-embed the `thought_signature` field associated with function calls in Gemini models when converting between LiteLLM's ChatCompletionMessageToolCall and ADK's types.Part

Close #4650

Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 882212223
2026-03-11 14:56:52 -07:00
Yifan Wang 22799c0833 chore: update adk web, see changelog [web] section
Co-authored-by: Yifan Wang <wanyif@google.com>
PiperOrigin-RevId: 882192675
2026-03-11 14:16:22 -07:00
Google Team Member 3117446293 feat: Added tracking headers for ADK CLI command to Agent Engine
PiperOrigin-RevId: 882138997
2026-03-11 12:26:58 -07:00
Luke Street ab4b736807 fix: Refactor type string update in Anthropic tool param conversion
The _update_type_string function now recursively processes "properties" at any level of the schema, ensuring that all "type" fields within nested objects are correctly lowercased. This improves handling of complex

Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 882050939
2026-03-11 09:20:13 -07:00
Google Team Member 0ad4de7350 ADK changes
PiperOrigin-RevId: 881782296
2026-03-10 21:48:28 -07:00
Google Team Member d004074c90 feat(auth): Add pluggable support for auth integrations using AuthProviderRegistry within CredentialManager
The flow for integrating a new auth method will be as follows. The ADK framework contributor will
1. extend the `AuthScheme` to create their own within `adk/auth/auth_scheme.py`
2. implement `BaseAuthProvider` within their dedicated directory in `adk/integrations/auth`
3. do the static registration of the new scheme and provider with AuthProviderRegistry of CredentialManager.

PiperOrigin-RevId: 881775983
2026-03-10 21:29:58 -07:00
Keyur Joshi 9154ef59d2 refactor: Rename base classes and TypeVars in optimization data types
The classes `BaseSamplingResult` and `BaseAgentWithScores` are renamed to `SamplingResult` and `AgentWithScores`, respectively. The corresponding TypeVars are renamed to `SamplingResultT` and `AgentWithScoresT` to avoid naming conflicts. Imports across ADK are updated to reflect these changes.

These changes were made to better align with the naming philosophy of ADK.

Co-authored-by: Keyur Joshi <keyurj@google.com>
PiperOrigin-RevId: 881635593
2026-03-10 14:55:03 -07:00
Achuth Narayan Rajagopal 77bf325d2b feat: add missing token usage span attributes during model usage
**1. Link to an existing issue (if applicable):**
- Closes: #_issue_number_
- Related: #_issue_number_

**2. Or, if no issue exists, describe the change:**

**Problem:**

- Currently, the ADK doesn't expose telemetry for reasoning tokens limit, reasoning tokens and system instruction tokens.
- In addition to this, the OpenTelemetry semantic conventions for Generative AI do not yet formally include usage fields for `reasoning_tokens_limit`, `reasoning_tokens`, and `system_instruction_tokens`.
- Setting these natively under the standard `gen_ai.usage.*` namespace risks colliding with future official OTel specifications if determining the structure or naming changes prior to stabilization.

**Solution:**

Namespace these telemetry attributes as experimental by adding the `experimental.` prefix to their keys in telemetry/tracing.py.

(For example, changing them to `gen_ai.usage.experimental.reasoning_tokens`).

This safely scopes these usage metrics until they are officially standardized by the OTel community.

### Testing Plan

**Unit Tests:**
- [x] I have added or updated unit tests for my change.
- [x] All unit tests pass locally.

_Please include a summary of passed `pytest` results._
All existing tests across `google-adk` pass correctly.

**Manual End-to-End (E2E) Tests:**
N/A - This is purely a key rename for OpenTelemetry exports and does not negatively impact functional framework logic.

### 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.

### Additional context
None

Co-authored-by: Achuth Narayan Rajagopal <achuthr@google.com>
PiperOrigin-RevId: 881568099
2026-03-10 12:30:03 -07:00
Yuvraj Angad Singh 078b5163ff feat(tools): add preserve_property_names option to OpenAPIToolset
Merge https://github.com/google/adk-python/pull/4505

Co-authored-by: Xuan Yang <xygoogle@google.com>
COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/4505 from yuvrajangadsingh:fix/openapi-preserve-property-names 8b9debf8222263e64de5159635dc1519520812d0
PiperOrigin-RevId: 881534964
2026-03-10 11:23:07 -07:00
George Weale 4c6096baa1 fix: Handle length finish reason in LiteLLM responses
This change updates the LiteLLM integration to correctly process responses with a "length" finish reason. Specifically, it:
- Maps "length" to types.FinishReason.MAX_TOKENS.
- Checks for truncated JSON arguments within tool calls when the finish reason is "length" and reports an error if parsing fails.

Close #4482

Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 881514246
2026-03-10 10:44:16 -07:00
weiguang li eff724ac9a feat(runners): pass GetSessionConfig through Runner to session service
Merge https://github.com/google/adk-python/pull/4693

### Link to Issue or Description of Change

**1. Link to an existing issue:**

- Closes: #4673
- Related: #3562, PR #3662

**Problem:**

When `EventsCompactionConfig` is configured on an `App`, the compaction mechanism correctly summarizes old events, but `Runner._get_or_create_session` still calls `get_session()` **without any `GetSessionConfig`**, loading the **full event history** on every invocation.

This means compaction only reduces the LLM context window — it does nothing to reduce the session loading overhead. As reported in #4673, real-world sessions with ~4,800 events take 70+ seconds to load via `get_session` even though compaction summaries exist.

**Solution:**

Add a `get_session_config` field to `RunConfig` and thread it through all Runner entry points so the session service can filter events during loading:

- **`RunConfig.get_session_config`**: New optional `GetSessionConfig` field that users can set to control `num_recent_events` or `after_timestamp`.
- **`_get_or_create_session`**: Updated to accept and forward `get_session_config` to `session_service.get_session()`.
- **All entry points updated**: `run_async`, `run_live`, `rewind_async`, and `run_debug` all pass the config through.

This subsumes the approach in stale PR #3662 (open since Dec 2025 with unaddressed review feedback) while also addressing the reviewer's requested changes (pass config in `rewind_async`, initialize in `run_debug`, add comprehensive tests).

**Usage:**

```python
from google.adk.agents.run_config import RunConfig
from google.adk.sessions.base_session_service import GetSessionConfig

# Only load the 50 most recent events — sufficient when compaction is active
run_config = RunConfig(
    get_session_config=GetSessionConfig(num_recent_events=50),
)

async for event in runner.run_async(
    user_id=user_id,
    session_id=session_id,
    new_message=message,
    run_config=run_config,
):
    ...
```

### Testing Plan

**Unit Tests:**

- [x] I have added or updated unit tests for my change.
- [x] All unit tests pass locally.

5 new tests added covering all entry points:

- `test_run_async_passes_get_session_config` — verifies `run_async` forwards config
- `test_run_live_passes_get_session_config` — verifies `run_live` forwards config
- `test_rewind_async_passes_get_session_config` — verifies `rewind_async` forwards config
- `test_run_debug_passes_get_session_config` — verifies `run_debug` forwards config
- `test_get_session_config_limits_events` — verifies `InMemorySessionService` actually limits events

```
======================= 39 passed, 10 warnings in 2.44s ========================
```

### 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] Any dependent changes have been merged and published in downstream modules.

### Additional context

This is the minimal viable fix — it gives users explicit control over session loading. A follow-up enhancement could automatically derive `GetSessionConfig` from `EventsCompactionConfig` (e.g., only load events after the last compaction timestamp), but that requires additional design decisions about the feedback loop between compaction and session loading.

COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/4693 from OiPunk:codex/adk-python-4673-get-session-config 85a814e679095c9fb20e4389320b51972bde6ce1
PiperOrigin-RevId: 881479524
2026-03-10 09:40:51 -07:00
Drew Afromsky a98f8173aa - When using the Google ADK LLM Agent (from google.adk.agents import Agent) equipped with the Gemini live API (model="gemini-live-2.5-flash-preview-native-audio-09-2025" or model="gemini-live-2.5-flash") and one or both of the following tools (VertexAiSearchTool and/or enterprise_web_search), the grounding_metadata from the LLM Response ([LlmResponse](https://github.com/google/adk-python/blob/main/src/google/adk/models/llm_response.py#L28)) is not returned in the [events](https://github.com/google/adk-python/blob/main/src/google/adk/events/event.py#L30) returned from [running in live mode](https://github.com/google/adk-python/blob/main/src/google/adk/runners.py#L981)
-  Tools:
     -  `VertexAiSearchTool` (i.e. `from google.adk.tools import VertexAiSearchTool`)
     -  `enterprise_web_search` (i.e. `from google.adk.tools import enterprise_web_search`)

- Re-ran `./scripts/unittests.sh` without any errors and all tests (including `pytest`) pass in all environments.
- Successfully completed steps 5 (`./scripts/unittests.sh`) - step 8 in [CONTRIBUTING.md](https://github.com/google/adk-python/blob/main/CONTRIBUTING.md).
- Confirmed desired behavior in three different scenarios:
  - `<User query requiring web/internet search, Root LLM Agent + Live API model without search tool>`
  - `<User query requiring web/internet search, Root LLM Agent + Live API model + VAIS tool>`
  - `<User query requiring web/internet search, Root LLM Agent + Live API model + EWS tool>`
  - `<User query requiring web/internet search, Root LLM Agent + Live API model + VAIS tool + EWS tool>`

Co-authored-by: Drew Afromsky <drewsky@google.com>
PiperOrigin-RevId: 881478340
2026-03-10 09:38:40 -07:00
Google Team Member 52b2f278b2 feat: Update docstring for BigQuery search tool
This helps the agent to have clearer understanding of when to select `search_catalog` over other BigQuery tools

PiperOrigin-RevId: 881468337
2026-03-10 09:16:32 -07:00
Achuth Narayan Rajagopal ffe97ec5ad feat(telemetry): add new gen_ai.agent.version span attribute
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:

Problem:
The agent's specific version wasn't being tracked in our telemetry data, limiting our ability to trace issues to specific agent versions. This change introduces the gen_ai.agent.version attribute to span context, defaulting to an empty string if omitted for backwards compatibility.

Solution:
We want to capture the specific version of an agent during execution by adding an optional version field to the base agent configurations (BaseAgent, BaseAgentConfig).

This solution was chosen because exposing this field directly to OpenTelemetry span attributes (gen_ai.agent.version) ensures the version is automatically recorded alongside other existing metadata (like name and description) during invocation. Defaulting the value to an empty string ensures backwards compatibility without breaking existing agent implementations that do not specify a version.

Testing Plan

- Added test_trace_agent_invocation_with_version to verify that the gen_ai.agent.version attribute is correctly captured when agent.version is populated.
- Updated existing telemetry span tests to ensure gen_ai.agent.version safely defaults to an empty string ('') when no version is provided.

Unit Tests:

- I have added or updated unit tests for my change.
- All unit tests pass locally.

Manual End-to-End (E2E) Tests:

- Tested on Agent Engine and in a local deployment.

Checklist
[x] I have read the 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.

Additional context
Add any other context or screenshots about the feature request here.

Co-authored-by: Achuth Narayan Rajagopal <achuthr@google.com>
PiperOrigin-RevId: 881234134
2026-03-09 23:13:13 -07:00
Vishwa Murugan 86db35c338 feat: Add support for MCP App UI widgets in MCPTool
Co-authored-by: Vishwa Murugan <vishwamurugan@google.com>
PiperOrigin-RevId: 881131683
2026-03-09 18:12:52 -07:00
Google Team Member a86aa8b03d feat: Add code execution in the sample agent
PiperOrigin-RevId: 881114111
2026-03-09 17:21:21 -07:00
Vishwa Murugan 530ff06ece feat: Add UiWidget to EventActions for supporting new experimental UI Widgets feature
Co-authored-by: Vishwa Murugan <vishwamurugan@google.com>
PiperOrigin-RevId: 881099147
2026-03-09 16:42:17 -07:00