Commit Graph

246 Commits

Author SHA1 Message Date
Xuan Yang 8ada46a18e chore: remove the redundant service.bucket setting in mock_gcs_artifact_service
PiperOrigin-RevId: 784253138
2025-07-17 11:29:32 -07:00
Xuan Yang 1c4c887bec fix: use the same word extractor for query and event contents in InMemoryMemoryService
PiperOrigin-RevId: 784236637
2025-07-17 10:43:01 -07:00
Ankur Sharma b17d8b6e36 fix: Raise NotFoundError in list_eval_sets function when app_name doesn't exist
PiperOrigin-RevId: 784216832
2025-07-17 09:53:26 -07:00
Xiang (Sean) Zhou 377b5a9b78 fix: Add response schema for agent tool function declaration even when it's return None
PiperOrigin-RevId: 784216811
2025-07-17 09:51:34 -07:00
Xiang (Sean) Zhou 33ac8380ad fix: Set response schema for function that returns None
PiperOrigin-RevId: 784053725
2025-07-16 23:59:45 -07:00
Hangfei Lin 7415f2c094 feat: Add tool callback chaining support for live streaming
**Highlights:**

-   **Callback Chaining:** Now supports a list of before and after callbacks, as in the non-live version. Callbacks are executed in order, stopping when one returns a response.
-   **Unit Tests:** Added new unit tests for before and after callbacks, async and sync versions, callback chains and mixed callbacks.
-   **Sample Agent:** Introduced a new example agent with multiple callbacks showing various behaviors: audit, security, validation, and enhancement. This provides practical usage examples.

PiperOrigin-RevId: 783884562
2025-07-16 13:56:06 -07:00
Xiang (Sean) Zhou b977d12ea8 refactor: Add save_credential and load_credential in callback context for developer to access credential service
developer may want to save/load credentials themselves to/from credential service. see (https://github.com/google/adk-python/issues/1816)

PiperOrigin-RevId: 783487628
2025-07-15 15:09:19 -07:00
Xiang (Sean) Zhou 1a75848391 refactor: Use CallbackContext in credential service for saving/loading credential
1. credential service may be accessed by callbacks
2. plan to add load_credential and save_credential method in CallbackContext (see cl/782158513) given customer has requirement to access credential service themselves. (see https://github.com/google/adk-python/issues/1816)

It's backward compatible given CallbackContext is parent class of ToolContext

PiperOrigin-RevId: 783480378
2025-07-15 14:48:38 -07:00
Xiang (Sean) Zhou bf7745f428 fix: Create correct object for image and video content in litellm
PiperOrigin-RevId: 783478779
2025-07-15 14:44:14 -07:00
Alejandro Cruzado-Ruiz 94dc03761e fix: return empty list in place of raising FileNotFoundError when there are no eval sets
PiperOrigin-RevId: 783439932
2025-07-15 12:56:38 -07:00
Xiang (Sean) Zhou 3c6e18fd1c fix: Don't set error_code and error_message when model stop response in normal case
PiperOrigin-RevId: 783415488
2025-07-15 11:47:53 -07:00
Copybara-Service 391cf3f320 Merge pull request #1669 from zshehov:use-starred-tuple-unpacking-on-gcs-artifact-blob-names-versions
PiperOrigin-RevId: 783413576
2025-07-15 11:43:14 -07:00
Xiang (Sean) Zhou a5d6f1e52e fix: Support project-based gemini model path for BuiltInCodeExecutor and all built-in tools
This is to support model path like :
projects/265104255505/locations/us-central1/publishers/google/models/gemini-2.0-flash-001"

PiperOrigin-RevId: 783413351
2025-07-15 11:41:37 -07:00
Xiang (Sean) Zhou 30d7b37069 refactor: Move list_artifacts from tool_context to callback_context
1. users may want to list_artifacts in callbacks
2. save/load artifacts are already in callback_context

PiperOrigin-RevId: 783399941
2025-07-15 11:08:17 -07:00
Copybara-Service 57043d3e7d Merge pull request #1955 from iwknow:func_fix
PiperOrigin-RevId: 783391431
2025-07-15 10:47:16 -07:00
Zdravko Shehov 4a2589a090 fix: Use starred tuple unpacking on GCS artifact blob names for versions function 2025-07-15 11:47:18 +03:00
Ankur Sharma c25911c912 feat: Implement in memory EvalSetsManager
This version of the EvalSetsManager is intended to support two main behaviors

1) The agent developer wants to bring in their own eval set file, which is usually the case with `adk eval` cli. Once their eval sets are uploaded into this version of the eval sets manager, the EvalSetManager could be handed over to the Eval system for running evals.

2) As a part of AgentEvaluator testing, we expect developers to supply Eval cases in json files. The in-memory version of the EvalSetsManager will help us run those test cases using LocalEvalService.

PiperOrigin-RevId: 783198788
2025-07-14 23:34:35 -07:00
Google Team Member a50419961c fix: Process ListEvents response correctly when getSession is called
When get session is being called on a session with more than 1 page of events (100+), the response of the subsequent listevents calls fails due to missing parsing logic. This change fixes the processing of the listevents responses.

PiperOrigin-RevId: 783166959
2025-07-14 21:21:51 -07:00
Frank Liu 94b5aaf0a1 fix: Correct EventAction merging logic and add corresponding tests 2025-07-14 14:54:36 -07:00
Xiang (Sean) Zhou 62a611956f fix: Add instruction in long running tool description to avoid being invoked again by model
PiperOrigin-RevId: 783039620
2025-07-14 14:18:49 -07:00
Ankur Sharma bab3be2cf3 feat: Add support for persisting eval run results
If the EvalRunResultsManager is provided to LocalEvalService, then we want to persist the eval run results using it.

PiperOrigin-RevId: 782196848
2025-07-11 19:29:32 -07:00
Ankur Sharma 33eec34577 feat: Adding implementation of evaluate method in LocalEvalService
Also, delete agent_creator.py file. We added this file by mistake.

PiperOrigin-RevId: 782193593
2025-07-11 19:15:40 -07:00
Xiang (Sean) Zhou 134ec0d71e fix: Fix the long running function response event merge logic
1) raise explicit error if the response event contains responses against multiple function call events
2) merge all function responses for the corresponding function call event

PiperOrigin-RevId: 782154577
2025-07-11 16:48:59 -07:00
Xiang (Sean) Zhou a8fcc1b8ab fix: Return final task result in task artifact instead of status message
According to a2a protocol task artifact is a different concept from adk artifact.
if a task is completed the final result should be in task artifact.

PiperOrigin-RevId: 782154265
2025-07-11 16:47:28 -07:00
seanzhou1023 997b6a964d Merge branch 'main' into expose_credential_service 2025-07-11 15:38:27 -07:00