Commit Graph

685 Commits

Author SHA1 Message Date
Shangjie Chen 3d2f13cecd chore: Update the retry logic of create session polling
This should slightly increase the timeout also reduce the polling frequency.

PiperOrigin-RevId: 778323416
2025-07-01 21:21:57 -07:00
Liang Wu 9af2394e0a fix: continue the action when grep -L returns exit status 1
`grep -L` returns status 1 when there are modified files that don't have the `from __future__ import annotations` pattern. Previously if this happens, the entire GitHub action by default will stop and exit with status 1. Adding `|| true` will prevent this from happening and continue the workflow.

PiperOrigin-RevId: 778246018
2025-07-01 16:57:56 -07:00
Copybara-Service 873beca088 Merge pull request #1709 from google:my-feature-branch-llmstxt
PiperOrigin-RevId: 778239103
2025-07-01 16:38:48 -07:00
hangfei a903c54bac chore: Add util to build our llms.txt and llms-full.txt files 2025-07-01 16:21:12 -07:00
Ankur Sharma b0d88bf172 feat: BaseEvalService declaration and surrounding data models
Also, adds a metric registry.

PiperOrigin-RevId: 778186012
2025-07-01 14:13:48 -07:00
Shangjie Chen 17d6042995 fix: Make sure each partial event has different timestamp
PiperOrigin-RevId: 778148175
2025-07-01 12:36:33 -07:00
Jianfeng Zeng 43083baddc chore: update adk web
Update minified files for adk-web

PiperOrigin-RevId: 777618082
2025-06-30 10:09:18 -07:00
Hangfei Lin 9b75e24d8c fix: Avoid pydantic.ValidationError when the model stream returns empty final chunk
Bug: When a model emits a stream of tokens, it sometimes emits a final chunk of whitespace or no content. The agent was trying to parse that content into JSON, causing a validation error.

Fix: If a model is expected to return JSON and the last streamed token is empty/whitespace, the agent will no longer try to parse it, and exit gracefully.

New unit tests confirm the scenario and the fix.

PiperOrigin-RevId: 777609415
2025-06-30 09:50:04 -07:00
Hangfei Lin a58cc3d882 chore: Create an example for multi agent live streaming
This example include multi agents:
- Root agent.
- Sub agent for Rolling Dice.
- Sub agent for checking primes.

Added README.md to demonstrate how to use it.

PiperOrigin-RevId: 777599625
2025-06-30 09:21:15 -07:00
Google Team Member 37108be855 docs: Add AGENTS.md to provide relevant project context for the Gemini CLI
Including details on the ADK style guide and how to run specific tools.

PiperOrigin-RevId: 776827602
2025-06-27 21:00:54 -07:00
Xuan Yang b6c7b5b64f chore: refactor the ADK Triaging Agent to make the code easier to read
PiperOrigin-RevId: 776763061
2025-06-27 16:45:38 -07:00
Hangfei Lin ffa9b361db docs: Update CONTRIBUTING.md
Merge https://github.com/google/adk-python/pull/1703

COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/1703 from google:hangfei-patch-1 251b530e8346ab03a3bfd84c837f14578be37285
PiperOrigin-RevId: 776670181
2025-06-27 12:06:18 -07:00
Google Team Member dc43d518c9 feat: Support protected write in BigQuery execute_sql tool
This change adds a new enum value which the agent builder can pass in the `BigQueryToolConfig` to allow limited writes to the `execute_sql` tool.

PiperOrigin-RevId: 776661744
2025-06-27 11:44:30 -07:00
Xiang (Sean) Zhou e2748b3ed5 chore: Add an a2a agent to demo oauth flow
PiperOrigin-RevId: 776661038
2025-06-27 11:43:05 -07:00
Xiang (Sean) Zhou 379810dd6a chore: Add a human in the loop a2a agent demo sample
PiperOrigin-RevId: 776660876
2025-06-27 11:41:47 -07:00
Xiang (Sean) Zhou 1cf5cf0d0a chore: Add a basic a2a agent demo sample
PiperOrigin-RevId: 776660703
2025-06-27 11:40:26 -07:00
Xiang (Sean) Zhou f0183a9b98 feat: Enable A2A features as experimental
PiperOrigin-RevId: 776656783
2025-06-27 11:28:28 -07:00
Xuan Yang 3f621ae6f2 fix: treat SQLite database update time as UTC for session's last update time
Fixes https://github.com/google/adk-python/issues/1180

We are using `func.now()` to set the `onupdate` time for db, when SQLAlchemy generates the SQL to build the database, it actually translates `func.now()` into `NOW()` or `CURRENT_TIMESTAMP`. The value it returns depends on the database server settings. For example, if the global/default timezone for a db is set to be UTC, the update time will be set to be a UCT time; if the global time zone for a db is set to be a local time zone (e.g. America/Los_Angeles), the update time will be a local time.

Normally, the best practice is to set database server to use UTC. Applications will convert it into different time zones as needed.

For SQLite, there is no way to config the default timezone, it will just treat it as UTC. But because it is a naive datetime (with no timezone info), python will assume it is a local time and then covert it into a UTC, which is why we see the bug (e.g. we create a session at 2025-06-17 12:49:33 local time, but when we read the session, its last update time is 2025-06-17 19:49:33 local time).

The solution is converting the native datatime to be timezone aware before `.timestamp()`.

The change in this CL only affects SQLite database.

PiperOrigin-RevId: 776654443
2025-06-27 11:22:23 -07:00
Keisuke Oohashi 4e765ae2f3 fix: raise ValueError when sessionId and userId are incorrect combination(#1653)
Merge https://github.com/google/adk-python/pull/1655

Fix #1653

When session_id and user_id are incorrect combination on vertex ai session service, it should not return the session.

COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/1655 from soundTricker:fix/1653-invalid-session 7a3dee2fc75602a2685ea922799cc5f5ba666e97
PiperOrigin-RevId: 776648361
2025-06-27 11:06:15 -07:00
Xiang (Sean) Zhou c13c9875cf feat: Add remote a2a agent
PiperOrigin-RevId: 776643130
2025-06-27 10:52:01 -07:00
Xiang (Sean) Zhou 045aea9b15 fix: Support API-Key for MCP Tool authentication
PiperOrigin-RevId: 776641474
2025-06-27 10:47:42 -07:00
Xiang (Sean) Zhou 20279d9a50 fix: Save output in state via output_key only when the event is authored by current agent
PiperOrigin-RevId: 776640671
2025-06-27 10:45:34 -07:00
Xiang (Sean) Zhou 09e487df3c chore: Use context_id as session_id and construct temp user_id from context_id
PiperOrigin-RevId: 776639713
2025-06-27 10:42:15 -07:00
Hangfei Lin 51a559eb2a chore: Adding PR commit check github workflow
This will fail a PR check if multiple commits are added, and will give the user instructions on how to fix the issue.

PiperOrigin-RevId: 776638574
2025-06-27 10:38:36 -07:00
Xiang (Sean) Zhou 1fe9c47cc6 chore: Enhance a2a_agent_executor module to raise error with meaningful error message to ask user upgrade python when python version < 3.10
PiperOrigin-RevId: 776631647
2025-06-27 10:21:26 -07:00