1904 Commits

Author SHA1 Message Date
George Weale 6c67b6c0f4 fix: map LiteLLM thought parts to reasoning_content
- Treat Part(thought=True) as reasoning_content when building assistant messages.
- Add unit tests for thought-only and thought+text cases.

Close #4069

Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 853790274
v1.22.0
2026-01-08 10:10:13 -08:00
Xiang (Sean) Zhou 9b2bd411dd chore: Put user_id in the error message when session is not found
Co-authored-by: Xiang (Sean) Zhou <seanzhougoogle@google.com>
PiperOrigin-RevId: 853771033
2026-01-08 09:19:31 -08:00
Xiang (Sean) Zhou 392dda1e0c chore: Update live multi agent sample with latest live models
Co-authored-by: Xiang (Sean) Zhou <seanzhougoogle@google.com>
PiperOrigin-RevId: 853769664
2026-01-08 09:14:45 -08:00
Google Team Member a0b2aac108 fix: Add google-cloud-geminidataanalytics to dependencies
PiperOrigin-RevId: 853515315
2026-01-07 19:57:53 -08:00
Google Team Member 3cd3d56176 fix: Add google-cloud-geminidataanalytics to dependencies
PiperOrigin-RevId: 853504915
2026-01-07 19:19:24 -08:00
Google Team Member c34feb4c0e feat: add new conversational analytics api tool set
PiperOrigin-RevId: 853489874
2026-01-07 18:26:05 -08:00
Google Team Member aaf76a6a51 feat: add new conversational analytics api tool set
PiperOrigin-RevId: 853434500
2026-01-07 15:23:43 -08:00
Yifan Wang 45a25d780b chore: update adk web to match main branch
Co-authored-by: Yifan Wang <wanyif@google.com>
PiperOrigin-RevId: 853331843
2026-01-07 10:58:37 -08:00
George Weale 5912835c97 fix: Add checks for event content and parts before accessing
Close #3769

Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 853327479
2026-01-07 10:48:14 -08:00
George Weale b30c2f4e13 fix: avoid local .adk storage in Cloud Run/GKE
Default session and artifact services to in-memory when running in Cloud Run/Kubernetes (or when agents_dir isn’t writable) to prevent startup failures from attempting to create .adk under read-only/unwritable container paths (e.g. /app/agents/.adk). Local development defaults are unchanged.

  - ADK_FORCE_LOCAL_STORAGE=1 to always use .adk defaults
  - ADK_DISABLE_LOCAL_STORAGE=1 to always avoid local storage

If local artifact initialization raises PermissionError, fall back to in-memory and log a warning

Close #3907

Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 853315459
2026-01-07 10:18:11 -08:00
Xiang (Sean) Zhou d5bd8d939e chore: Clean up the invocation context initialization logic for LIVE
1. Removed dead code: The if not run_config.response_modalities: branch was never executed since run_live already sets the default (https://github.com/google/adk-python/blob/19de45b3250d09b9ec16c45788e7d472b3e588c2/src/google/adk/runners.py#L947-L948).
2. Simplified condition: Changed from checking 'TEXT' not in ... to 'AUDIO' in ...

Co-authored-by: Xiang (Sean) Zhou <seanzhougoogle@google.com>
PiperOrigin-RevId: 853274401
2026-01-07 08:31:01 -08:00
Sasha Sobran 96c5db5a07 fix: use mode='json' in model_dump to serialize bytes correctly when using telemetry
fixes #4043

Co-authored-by: Sasha Sobran <asobran@google.com>
PiperOrigin-RevId: 853256045
2026-01-07 07:38:18 -08:00
Xuan Yang 10bdc078a4 chore: Add docstring for StreamingMode
Related: #3705

Co-authored-by: Xuan Yang <xygoogle@google.com>
PiperOrigin-RevId: 853116282
2026-01-07 00:15:12 -08:00
Xiang (Sean) Zhou a4b914b09f fix: Set the default response modality to AUDIO only
Currently Live API only allow one response modality although the config is defined as a list.

Co-authored-by: Xiang (Sean) Zhou <seanzhougoogle@google.com>
PiperOrigin-RevId: 853107710
2026-01-06 23:47:08 -08:00
Xiang (Sean) Zhou 19de45b325 fix: Honor the modalities parameter in adk api server for live API
Co-authored-by: Xiang (Sean) Zhou <seanzhougoogle@google.com>
PiperOrigin-RevId: 853077949
2026-01-06 22:06:57 -08:00
George Weale b28721508a feat: make LlmAgent.model optional with a default fallback
LlmAgent now resolves model from ancestors or a system default (gemini-2.5-flash) when unset. Added LlmAgent.set_default_model() to override the default globally

Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 853006116
2026-01-06 17:56:14 -08:00
George Weale 742c9265a2 fix: Validate app name in adk create command
The `adk create` command now checks if the provided agent name is a valid Python identifier. An invalid name, such as one containing hyphens, will raise a `click.BadParameter` error before any files are created.

Close #3977

Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 853001295
2026-01-06 17:37:36 -08:00
Xiang (Sean) Zhou 9403a44f34 chore: Cleanup the workaround logic for streamlit
Co-authored-by: Xiang (Sean) Zhou <seanzhougoogle@google.com>
PiperOrigin-RevId: 852995899
2026-01-06 17:18:49 -08:00
Liang Wu 35308d3809 chore: add min version of Google Auth to include fix
Context: https://github.com/googleapis/python-genai/commit/930c7ca7d5b696d3388fe16fb724184eb88c6a65. The GenAI SDK relies on Google Auth for the fix, and adding this as a direct dependency in ADK will decouple the release of ADK and GenAI SDK.

Co-authored-by: Liang Wu <wuliang@google.com>
PiperOrigin-RevId: 852990837
2026-01-06 17:01:16 -08:00
Xiang (Sean) Zhou ecc9f182e3 chore: remove unecessary event loop creation in LiveRequstQueue constructor
Before Python 3.10, asyncio.Queue() required a running event loop at creation time. This was deprecated in 3.8-3.9 and fully removed in 3.10. ADK requires Python 3.10+, thus remove this unecessary logic

Co-authored-by: Xiang (Sean) Zhou <seanzhougoogle@google.com>
PiperOrigin-RevId: 852989791
2026-01-06 16:57:23 -08:00
George Weale 6dce7f8a8f fix: Add schema type sanitization to OpenAPI spec parser
This change introduces a `_sanitize_schema_types` method to the OpenAPI spec parser. This method recursively removes or filters out non-standard schema types (e.g., "Any", "Unknown") from the OpenAPI specification

Close #3704
Close #3108

Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 852986491
2026-01-06 16:47:06 -08:00
Liang Wu ce64787c3e feat: Add database schema migration command and script
Final part of https://github.com/google/adk-python/discussions/3605.

This change introduces:
-   A new `adk migrate session` CLI command to run database schema upgrades.
-   A migration script to upgrade from the old Pickle-based session schema (v0) to the new JSON-based schema (v1).
-   A migration runner that orchestrates the upgrade process, handling sequential migrations and using temporary SQLite databases for intermediate steps if needed.
-   Unit tests for the v0 to v1 migration.

Co-authored-by: Liang Wu <wuliang@google.com>
PiperOrigin-RevId: 852983323
2026-01-06 16:36:45 -08:00
George Weale 0827d12ccd fix: Prevent .env files from overriding existing environment variables
This change modifies `load_dotenv_for_agent` to first capture the environment variables already set in the process. After loading the `.env` file with `override=True`, it restores the values of these initially set variables, ensuring that explicitly set environment variables are not overwritten by the `.env` file. A new environment variable, `ADK_DISABLE_LOAD_DOTENV`, is also introduced to completely skip the `.env` loading process

Close #4020
Close $4018

Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 852981654
2026-01-06 16:31:24 -08:00
Liang Wu 8329fec0fc chore: Add disambiguation message to enterprise_search_tool
Co-authored-by: Liang Wu <wuliang@google.com>
PiperOrigin-RevId: 852969034
2026-01-06 15:56:22 -08:00
George Weale 1ace8fc678 fix: Filter out thought parts in lite_llm._get_content
Thought parts represent internal model reasoning and should not be included in the content sent back to the model in subsequent turns

Close #3948

Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 852965417
2026-01-06 15:44:33 -08:00