Commit Graph

2177 Commits

Author SHA1 Message Date
Liang Wu 77df6d8db7 ci: only keep --extra test in GitHub unit test workflow
Co-authored-by: Liang Wu <wuliang@google.com>
PiperOrigin-RevId: 873072872
2026-02-20 14:22:43 -08:00
Google Team Member 9c4c445369 feat: Add /chat/completions integration to ApigeeLlm
PiperOrigin-RevId: 873049983
2026-02-20 13:27:22 -08:00
Google Team Member 09ee3c3695 ADK changes
PiperOrigin-RevId: 873013637
2026-02-20 11:59:54 -08:00
George Weale a7b509763c feat: Use --memory_service_uri in ADK CLI run command
Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 873000092
2026-02-20 11:29:02 -08:00
George Weale e6b601a2ab fix: Invoke on_tool_error_callback for missing tools in live mode
In live mode, when the model calls an unregistered tool, ADK now runs on_tool_error_callback before failing. If the callback returns a response, ADK emits
that function response and continues; otherwise it keeps the old ValueError

Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 872996178
2026-02-20 11:20:51 -08:00
Kathy Wu 7478bdaa98 fix: Parallelize tool resolution in LlmAgent.canonical_tools()
Previously we resolved tools sequentially by awaiting _convert_tool_union_to_tools() in a loop -- reduce the latency by resolving tools concurrently.

Co-authored-by: Kathy Wu <wukathy@google.com>
PiperOrigin-RevId: 872979105
2026-02-20 10:45:18 -08:00
Sahaja Reddy Pabbathi Reddy bef3f117b4 feat: Bigquery ADK support for search catalog tool
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
2026-02-20 09:55:29 -08:00
George Weale a39ca946d6 chore: Add sqlite_span_exporter for .adk folder traces
Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 872948208
2026-02-20 09:49:38 -08:00
George Weale 4a88804ec7 feat: Add support for memory consolidation via Vertex AI Memory Bank
This change allows `add_memory` to use the `memories.generate` API with `direct_memories_source` when `custom_metadata["enable_consolidation"]` is set to True. This enables server-side consolidation of the provided memories

Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 872554004
2026-02-19 13:59:31 -08:00
George Weale eaf50ce37e chore: provide a way to disable model check for builtin tools
Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 872503435
2026-02-19 12:02:27 -08:00
George Weale f27a9cfb87 fix: Expand add_memory to accept MemoryEntry
The `add_memory` methods in `Context` and `BaseMemoryService` now accept `MemoryEntry` objects in addition to strings. The Vertex AI Memory Bank service implementation is updated to handle these new types

Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 872108561
2026-02-18 17:06:17 -08:00
Xiang (Sean) Zhou 2d8b6a2f5b chore: Release 1.25.1
Co-authored-by: Xiang (Sean) Zhou <seanzhougoogle@google.com>
PiperOrigin-RevId: 872062719
2026-02-18 15:12:50 -08:00
Google Team Member eccdf6d01e fix: Remove experimental decorators from user persona data models
PiperOrigin-RevId: 872026960
2026-02-18 13:50:47 -08:00
Wei Sun (Jack) 710d9de011 chore(release): Update release process to allow tag to use accurate commit sha in the branch
* use last-release-sha to locate the previous release commit in main for CHANGELOG generating.
* release tag can now use the commit sha in release branch

Co-authored-by: Wei Sun (Jack) <weisun@google.com>
PiperOrigin-RevId: 871909085
2026-02-18 09:30:33 -08:00
Google Team Member 33f7d118b3 feat(auth): Add native support for id_token in OAuth2 credentials
## Problem
When performing authentication flows via `OAUTH2` or `OPEN_ID_CONNECT`, the native `OAuth2Token` response from identity providers, like Google OAuth, often includes an `id_token` alongside the `access_token` and `refresh_token`. [MCP Toolbox](https://googleapis.github.io/genai-toolbox/resources/authservices/google/) implements authentication through ID Tokens and [integrates with ADK](https://google.github.io/adk-docs/integrations/mcp-toolbox-for-databases/) to provide easy tools management for the end-users.

However, the ADK's `update_credential_with_tokens` utility explicitly drops the `id_token`, preventing agents and tools from verifying user identity or extracting OIDC claims securely. Furthermore, the `OAuth2Auth` model does not have a designated field for `id_token`.

## Solution
1. Added an `id_token: Optional[str] = None` field to the `OAuth2Auth` pydantic model in `auth_credential.py`.
2. Updated `update_credential_with_tokens` in `oauth2_credential_util.py` to correctly extract and map `tokens.get("id_token")` into the `OAuth2Auth` credential object.
3. Updated the relevant unit tests to ensure `id_token` is asserted and preserved during credential updates.

### Testing Plan

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

PiperOrigin-RevId: 871801313
2026-02-18 04:34:39 -08:00
Google Team Member 6a53f414d3 chore: set a maximum number of rows for BigQuery query results in the sample agent
The `BigQueryToolConfig` now sets `max_query_result_rows=50` explicitly to showcase this particular configuration.

PiperOrigin-RevId: 871709345
2026-02-18 00:24:26 -08:00
Wei Sun (Jack) dbd64207ae fix(deps): Increase pydantic lower version to 2.7.0
```
  ┌──────────────────────────────┬─────────────────┬───────────────────────────────────────────────┐
  │           Feature            │ First Available │                    Used In                    │
  ├──────────────────────────────┼─────────────────┼───────────────────────────────────────────────┤
  │ SkipJsonSchema               │ 2.1.0           │ evaluation/eval_metrics.py                    │
  ├──────────────────────────────┼─────────────────┼───────────────────────────────────────────────┤
  │ AliasChoices                 │ 2.1.0           │ models/gemma_llm.py                           │
  ├──────────────────────────────┼─────────────────┼───────────────────────────────────────────────┤
  │ SerializeAsAny               │ 2.1.0           │ agents/workflow/workflow_graph.py             │
  ├──────────────────────────────┼─────────────────┼───────────────────────────────────────────────┤
  │ Discriminator, Tag           │ 2.5.0           │ agents/agent_config.py                        │
  ├──────────────────────────────┼─────────────────┼───────────────────────────────────────────────┤
  │ ser_json_bytes in ConfigDict │ 2.5.0           │ events/event.py, agents/live_request_queue.py │
  ├──────────────────────────────┼─────────────────┼───────────────────────────────────────────────┤
  │ Field(deprecated=True)       │ 2.7.0           │ agents/run_config.py                          │
  └──────────────────────────────┴─────────────────┴───────────────────────────────────────────────┘
```

Co-authored-by: Wei Sun (Jack) <weisun@google.com>
PiperOrigin-RevId: 871478269
2026-02-17 13:47:26 -08:00
Google Team Member 2703613572 fix: Replace the global DEFAULT_USER_PERSONA_REGISTRY with a function call to get_default_persona_registry
PiperOrigin-RevId: 871422993
2026-02-17 11:45:24 -08:00
Xiang (Sean) Zhou e1e0d63616 refactor: Extract reusable function for building agent transfer instructions
Co-authored-by: Xiang (Sean) Zhou <seanzhougoogle@google.com>
PiperOrigin-RevId: 871410286
2026-02-17 11:19:11 -08:00
Kathy Wu 4285f852d5 fix: Include list of skills in every message and remove list_skills tool from system instruction
The list_skills method is not for model tool listing, but for giving the developer flexibility to load the skill name/description at runtime (from discussion in go/orcas-rfc-555)

Co-authored-by: Kathy Wu <wukathy@google.com>
PiperOrigin-RevId: 871406905
2026-02-17 11:12:11 -08:00
Haiyuan Cao ea034877ec fix: Improve BigQuery Agent Analytics plugin reliability and code quality
This CL fixes several bugs in the BigQuery Agent Analytics plugin and refactors the internal data-passing pattern for better type safety and maintainability.

-   **Stale Loop State Validation:** Use `loop.is_closed()` — a public, reliable API — to detect and clean up stale asyncio loop states in `_batch_processor_prop`, `_get_loop_state`, and `flush`. The previous approach used `asyncio.Queue._loop` which is `None` on Python 3.10+, causing the check to always treat states as stale.
-   **Quota Project ID Fallback:** Remove the `or project_id` fallback when setting `quota_project_id` on `BigQueryWriteAsyncClient`. This fixes Workload Identity Federation flows where the federated identity lacks `serviceusage.services.use` on the quota project.
-   **Kwargs Passthrough:** Pass `**kwargs` through to `_log_event` in all callbacks. Previously only model callbacks forwarded them, causing custom attributes (e.g. `customer_id`) to silently drop for agent, tool, run, and error events.
-   **State Delta Logging:** Replace the dead `on_state_change_callback` (never invoked by the framework) with `on_event_callback`, which is already dispatched by the runner for every event. Remove duplicate `STATE_DELTA` logging from `after_tool_callback`.
-   **EventData Dataclass:** Replace the `**kwargs`-as-data-bus pattern in `_log_event` with an explicit `EventData` dataclass. This makes the interface self-documenting, catches typos at construction time, and eliminates shared dict mutation across `_resolve_span_ids`, `_extract_latency`, and `_enrich_attributes`. All 12 callback call sites now construct typed `EventData` instances.
-   **Multi-Subagent Tool Logging Tests:** Add `TestMultiSubagentToolLogging` (6 tests) verifying that tool events are correctly attributed to subagents in multi-turn, multi-agent scenarios. Total tests: 111 (up from 60).

Co-authored-by: Haiyuan Cao <haiyuan@google.com>
PiperOrigin-RevId: 871381533
2026-02-17 10:24:34 -08:00
Google Team Member 6a808c60b3 feat: Introduce User Personas to the ADK evaluation framework
PiperOrigin-RevId: 871366815
2026-02-17 09:54:23 -08:00
Xiang (Sean) Zhou 976a238544 refactor: Extract reusable private methods
Co-authored-by: Xiang (Sean) Zhou <seanzhougoogle@google.com>
PiperOrigin-RevId: 871359399
2026-02-17 09:36:25 -08:00
Google Team Member 42eeaef2b3 refactor: Extract reusable private methods
PiperOrigin-RevId: 871151624
2026-02-17 00:05:25 -08:00
Xiang (Sean) Zhou 706f9fe74d refactor: Extract reusable private methods
Co-authored-by: Xiang (Sean) Zhou <seanzhougoogle@google.com>
PiperOrigin-RevId: 871128393
2026-02-16 22:52:47 -08:00