Open
Conversation
…viderRegistry 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
PiperOrigin-RevId: 881782296
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
PiperOrigin-RevId: 882138997
Co-authored-by: Yifan Wang <wanyif@google.com> PiperOrigin-RevId: 882192675
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
Co-authored-by: Kathy Wu <wukathy@google.com> PiperOrigin-RevId: 882212923
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
PiperOrigin-RevId: 882270600
V4 still uses deprecated Node.js 20. Co-authored-by: Liang Wu <wuliang@google.com> PiperOrigin-RevId: 882275971
Co-authored-by: Liang Wu <wuliang@google.com> PiperOrigin-RevId: 882293566
Co-authored-by: Liang Wu <18244712+wuliang229@users.noreply.github.com>
Co-authored-by: Guoyi Lou <guoyilou@google.com> PiperOrigin-RevId: 882787811
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
Co-authored-by: Xuan Yang <xygoogle@google.com> PiperOrigin-RevId: 883246168
…creation due to missing version field Co-authored-by: Achuth Narayan Rajagopal <achuthr@google.com> PiperOrigin-RevId: 883336463
Co-authored-by: Xiang (Sean) Zhou <seanzhougoogle@google.com> PiperOrigin-RevId: 883401159
Merge #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=#4718 from Piyushmrya:fix-mcp-sampling-callback 18f477f PiperOrigin-RevId: 883401178
Co-authored-by: Kathy Wu <wukathy@google.com> PiperOrigin-RevId: 883401885
Co-authored-by: Kathy Wu <wukathy@google.com> PiperOrigin-RevId: 883403479
Closes issue #4805 Co-authored-by: Liang Wu <wuliang@google.com> PiperOrigin-RevId: 883403628
…-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
…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
… execute_sql to support fine grained access controls PiperOrigin-RevId: 884166439
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
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
Co-authored-by: Kathy Wu <wukathy@google.com> PiperOrigin-RevId: 884557773
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
Passing in ADC auth headers to non-google MCP toolsets is a vulnerability. To fix, only pass in the headers to Google MCP toolsets. Co-authored-by: Kathy Wu <wukathy@google.com> PiperOrigin-RevId: 897230159
…Flow This enables cross-connection session resumption for Gemini Live API sessions, allowing applications to capture the resumption handle and reuse it upon reconnection. - Add `live_session_resumption_update` to the skip check condition to ensure it's not discarded when content is empty. - Yield the event after the skip check, similar to transcription events. - Add unit test in `test_base_llm_flow.py` to verify the behavior. Closes #4357 Co-authored-by: Liang Wu <wuliang@google.com> PiperOrigin-RevId: 897318123
Close #5169 Co-authored-by: George Weale <gweale@google.com> PiperOrigin-RevId: 897334695
This change updates the Gemma LLM integration to support Gemma 4 models by broadening the model regex from `gemma-3.*` to `gemma-.*` Close #5156 Co-authored-by: George Weale <gweale@google.com> PiperOrigin-RevId: 897385272
If the user created an express mode project but has a different gcloud project set, we should help them unset it so that they doesn't run into permissions errors / the express mode one gets used. Co-authored-by: Kathy Wu <wukathy@google.com> PiperOrigin-RevId: 897783336
In preparation to launching GA of the BigQuery agentic tools in ADK, this change marks BIG_QUERY_TOOLSET and BIG_QUERY_TOOL_CONFIG as stable features. The experimental decorators and warnings associated with these features have been removed. PiperOrigin-RevId: 897865928
…entity feature PiperOrigin-RevId: 898786239
After an agent gets deployed to agent engine, include a link to try out the agent. Co-authored-by: Kathy Wu <wukathy@google.com> PiperOrigin-RevId: 899093067
Co-authored-by: Kathy Wu <wukathy@google.com> PiperOrigin-RevId: 899104727
Closes #5110 Co-authored-by: George Weale <gweale@google.com> PiperOrigin-RevId: 899108631
Testing plan: Added new unit tests - `test_avatar_config_initialization` - `test_avatar_config_with_name` - `test_receive_video_content` - `test_streaming_with_avatar_config` PiperOrigin-RevId: 899193911
…ck test - Remove outdated TODOs regarding requested_tool_confirmations and native compaction support - Add a warning log when falling back to legacy storage - Avoid overwriting valid timestamps from `raw_event` with `None` if the API returns `None` - Provide a fallback timestamp (current time) to prevent Pydantic validation errors when the API returns no timestamp Co-authored-by: Shangjie Chen <deanchen@google.com> PiperOrigin-RevId: 899195056
…back Merge #5000 Fixes #4798 — `required` fields lost in `FunctionDeclaration` when the `parameters_json_schema` fallback path is used. Co-authored-by: Xuan Yang <xygoogle@google.com> COPYBARA_INTEGRATE_REVIEW=#5000 from giulio-leone:fix/required-fields-json-schema-fallback e9783d7 PiperOrigin-RevId: 899243799
END_PUBLIC Merge #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 google/adk-python-community#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=#5088 from ScottMansfield:feat/firestore 99efca5 PiperOrigin-RevId: 899328760
Co-authored-by: Sasha Sobran <asobran@google.com> PiperOrigin-RevId: 899626720
The Gemini session now has a dedicated `send_tool_response` method, which is used instead of wrapping function responses in a `LiveClientToolResponse` and calling `send`. `send` is deprecated. Co-authored-by: Liang Wu <wuliang@google.com> PiperOrigin-RevId: 899796634
We added sampling_capabilities to mcp client session, but it did not exist in mcp versions prior to 1.24.0. Fixes #5058. Co-authored-by: Kathy Wu <wukathy@google.com> PiperOrigin-RevId: 899814337
…onal` for conversation_scenario support (#5215) Co-authored-by: Ankur <ankusharma@google.com>
The `send` method was deprecated. Co-authored-by: Liang Wu <wuliang@google.com> PiperOrigin-RevId: 899826160
…modifications Previously, on_event_callback ran after append_event, so plugin modifications (e.g. custom_metadata) were only visible in the yielded stream but never persisted to the session store. This moves the callback before persistence, matching the documented contract in base_plugin.py. Fixes #3990 Co-authored-by: George Weale <gweale@google.com> PiperOrigin-RevId: 899845848
Co-authored-by: Liang Wu <wuliang@google.com> PiperOrigin-RevId: 899943556
## Overview This PR updates internal tutorials and demonstration guidance following the renaming of the database connectivity tools (`genai-toolbox` -> `mcp-toolbox`) and aligns resource downloads with the newly scoped artifact destinations. ## Changes * Removed references to legacy `googleapis.github.io/genai-toolbox` pages. * Updated download commands to pull binaries directly from the rebranded bucket. * Bumped the embedded curl instruction default payload target to the newly stable `v1.1.0` release tier. PiperOrigin-RevId: 900207615
…tadata Fixes #5073, #5310, and #5311 with three targeted updates to the `BigQueryAgentAnalyticsPlugin` (no changes to ADK core): - Classifies `TransferToAgentTool` transfers to `RemoteA2aAgent` as `TRANSFER_A2A` instead of the generic `TRANSFER_AGENT` by resolving the target agent at the call level. - Ensures a self-consistent BigQuery span tree by preferring the plugin's internal span stack over ambient OTel spans, resolving dangling `parent_span_id` references. - Surfaces remote A2A interaction metadata (`a2a:request`, `a2a:response`, etc.) in BigQuery by detecting them in custom metadata and logging new `A2A_INTERACTION` events. Co-authored-by: Haiyuan Cao <haiyuan@google.com> PiperOrigin-RevId: 900224778
Implement AgentEngineSandboxComputer, a BaseComputer implementation that
uses Vertex AI Agent Engine Computer Use Sandbox as a remote browser
environment. This enables computer-use agents to operate in secure,
isolated cloud-based browser environments.
Key features:
- SandboxClient: Low-level CDP client using vertexai SDK send_command()
- AgentEngineSandboxComputer: BaseComputer implementation with session
state management for sandbox sharing across invocations
- Support for both auto-provisioning and bring-your-own-sandbox (BYOS) modes
- Automatic token refresh and retry logic for transient navigation errors
- Fix wait_5_seconds adapter to properly pass tool_context
Co-authored-by: Xiang (Sean) Zhou <seanzhougoogle@google.com>
PiperOrigin-RevId: 900292803
Merge #5338 ### Summary After deploying an agent with `adk deploy agent_engine`, the generated Google Cloud Console URL uses the outdated path `agent-platform/runtimes`, which no longer resolves to the correct page. ### Changes **`src/google/adk/cli/cli_deploy.py`** Updated the URL path in `_print_agent_engine_url` from: ``` https://console.cloud.google.com/agent-platform/runtimes/locations/... ``` to: ``` https://console.cloud.google.com/vertex-ai/agents/agent-engines/locations/... ``` Fixes #5336 COPYBARA_INTEGRATE_REVIEW=#5338 from anmolg1997:fix/deploy-console-url 1fb352e PiperOrigin-RevId: 900308294
Co-authored-by: Xiang (Sean) Zhou <seanzhougoogle@google.com> PiperOrigin-RevId: 900322196
This change introduces a `live_session_id` field to the `LlmResponse` dataclass and populates it in all responses generated by the `GeminiLlmConnection` when using a Live session. This allows tracking which Live session each response belongs to. Co-authored-by: Liang Wu <wuliang@google.com> PiperOrigin-RevId: 900354397
…ager clients Update unit tests to verify the presence and value of the client_info argument during client initialization. PiperOrigin-RevId: 900448054
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Automated sync of v1 changes from main into v2. The oncall is responsible for reviewing and merging this PR. Resolve conflicts in favor of the v2 implementation.