This change introduces `_add_events_to_memory_via_ingest` in `VertexAiMemoryBankService` to support adding events to memory using the `memories.ingest_events` API. This allows passing additional configurations such as `stream_id`, `force_flush`, and `generation_trigger_config`.
This path is triggered when `custom_metadata` contains `use_ingest` or `generation_trigger_config`.
Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 900924805
This allows headers to refresh on each request. Also only add auth headers if no auth_scheme or auth_credential is specified
Co-authored-by: Kathy Wu <wukathy@google.com>
PiperOrigin-RevId: 900900323
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
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
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
## 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
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
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
END_PUBLIC
Merge https://github.com/google/adk-python/pull/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 https://github.com/google/adk-python-community/pull/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=https://github.com/google/adk-python/pull/5088 from ScottMansfield:feat/firestore 99efca50e1d5a932fac7b722ebe7e9b4e0eb1ae9
PiperOrigin-RevId: 899328760
- 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
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
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
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
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
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
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
Merge https://github.com/google/adk-python/pull/5218
### Link to Issue or Description of Change
**1. Link to an existing issue (if applicable):**
(None, this is a new sample)
**2. Or, if no issue exists, describe the change:**
**Problem:**
There was no sample demonstrating how to use `LocalEnvironment` with `EnvironmentToolset` for manual skill activation (discovering and loading skills by reading files) instead of using the pre-configured `SkillToolset`.
**Solution:**
Created a new sample `local_environment_skill` that demonstrates this pattern:
- Agent is instructed to find skills in `skills/` folder using the `find` command.
- Agent loads skills by reading `SKILL.md` using the `ReadFile` tool.
- Added a weather skill sample and reference data to demonstrate usage.
### Testing Plan
**Unit Tests:**
*(This is a sample/demonstration, so no new unit tests were added for the framework itself.)*
**Manual End-to-End (E2E) Tests:**
1. Ran `adk web contributing/samples`.
2. Interacted with the agent in the Web UI.
3. Prompt: "Can you check the weather in Sunnyvale?"
4. Verified that the agent successfully used `find` to locate the skill, read `SKILL.md`, read `weather_info.md`, and answered correctly.
### 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 manually tested my changes end-to-end.
COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/5218 from google:samples/local_env_skill 39404309e8b9237a279ecd6ed14bb87eb84098f0
PiperOrigin-RevId: 897229752
Parameter Manager is a feature of Secret Manager that provides centralized storage and management for workload parameters. It supports various formats (plain text, YAML, JSON) and can reference Secret Manager secrets.
The ADK integration will provide a simplified interface for agents to retrieve rendered parameter values, supporting both global and regional endpoints.
PiperOrigin-RevId: 896823376
* Skip sending conversation history when a live session is being resumed using a handle.
* Catch ConnectionClosed and APIError exceptions during live sessions and attempt to reconnect if a session resumption handle is available.
* Handle the server's "go_away" signal by proactively closing the connection to trigger a reconnection with the latest session handle.
* Propagate the "go_away" signal from the Gemini connection to the LlmResponse.
* Add unit tests for reconnection on ConnectionClosed, APIError, skipping history on resumption, and handling the go_away signal.
Closes#4996
Co-authored-by: Liang Wu <wuliang@google.com>
PiperOrigin-RevId: 896687925