Commit Graph

55 Commits

Author SHA1 Message Date
Selcuk Gun
509db3f9fb Add token usage to gemini (streaming), litellm and anthropic
Also included a token_usage sample that showcases the token usage of subagents with different models under a parent agent.

PiperOrigin-RevId: 759347015
2025-05-15 16:22:36 -07:00
Ankur Sharma
1c23556225 Updated test cases to use the new EvalSet schema to store test data. Also, added a utility to help migrate existing tests files to the new schema.
Also, migrated existing test files to the new schema and deleted test session files as they are no longer needed.

PiperOrigin-RevId: 759318735
2025-05-15 15:10:06 -07:00
Shangjie Chen
a71d9ea9a1 fix: fix broken tests.
PiperOrigin-RevId: 759312577
2025-05-15 14:57:04 -07:00
Ankur Sharma
4c6820e78c Update AgentEvaluator to new new EvalSchema
PiperOrigin-RevId: 759293759
2025-05-15 14:09:23 -07:00
Google Team Member
05917cabbd ADK changes
PiperOrigin-RevId: 759259620
2025-05-15 12:46:44 -07:00
Google Team Member
1804ca39a6 feat! Update session service interface to be async.
Also keep the sync version in the InMemorySessionService as create_session_sync() as a temporary migration option.

PiperOrigin-RevId: 759252188
2025-05-15 12:24:13 -07:00
Shangjie Chen
5b3204c356 feat! Update session service interface to be async.
Also keep the sync version in the InMemorySessionService as create_session_sync() as a temporary migration option.

PiperOrigin-RevId: 759224250
2025-05-15 11:17:13 -07:00
Xiang (Sean) Zhou
4a0751941b fix: fix application integration toolset
PiperOrigin-RevId: 759018346
2025-05-15 00:30:19 -07:00
Ankur Sharma
3686608f8d Fixes test_cli_eval_success_path test.
PiperOrigin-RevId: 758981214
2025-05-14 22:20:59 -07:00
Xiang (Sean) Zhou
14cf910ce6 refactor: refactor application integration toolset to hide non-public field
PiperOrigin-RevId: 758469938
2025-05-13 19:28:01 -07:00
Xiang (Sean) Zhou
00e0035c8a refactor: refactor google api toolset to hide non-public field
PiperOrigin-RevId: 758469484
2025-05-13 19:26:05 -07:00
Xiang (Sean) Zhou
9647426500 refactor: refactor openapi toolset and tool parser to hide non public field
PiperOrigin-RevId: 758436303
2025-05-13 17:14:20 -07:00
Xiang (Sean) Zhou
af978fe194 fix apihub toolset ut
PiperOrigin-RevId: 758400203
2025-05-13 15:32:28 -07:00
Selcuk Gun
303af440ee Await canonical instructions in test_llm_agent_fields.py
PiperOrigin-RevId: 758372807
2025-05-13 14:17:31 -07:00
Xiang (Sean) Zhou
dd8e9b71e5 fix application integration toolset unit tests
PiperOrigin-RevId: 758080966
2025-05-13 00:06:56 -07:00
Google Team Member
d740b93e03 feat: trigger in ApplicationIntegrationTools is changed to triggers and is a list of strings
PiperOrigin-RevId: 758034458
2025-05-12 21:13:27 -07:00
Xiang (Sean) Zhou
6a04ff84ba adapt google api toolset and api hub toolset to new toolset interface
PiperOrigin-RevId: 757946541
2025-05-12 15:58:39 -07:00
Google Team Member
660c2efa4d Define EvalReport data model.
PiperOrigin-RevId: 757933585
2025-05-12 15:22:57 -07:00
Xiang (Sean) Zhou
5462862795 fix eval unittests failure
PiperOrigin-RevId: 757872670
2025-05-12 12:42:19 -07:00
Shangjie Chen
70a6bfae90 fix: Explictly throw execption when custom id is set for vertex ai session service.
PiperOrigin-RevId: 757815469
2025-05-12 10:19:25 -07:00
Selcuk Gun
4c4cfb74ae Support async instruction and global instruction provider
PiperOrigin-RevId: 757808335
2025-05-12 10:03:34 -07:00
Google Team Member
9a8c77e04a Added filterClause in Update and Delete Request
PiperOrigin-RevId: 757013222
2025-05-09 20:50:36 -07:00
Thiago Neves
ac97fc638f fix(tests): use mock GCS client in artifact service tests to avoid real credentials
Copybara import of the project:

--
ade1d98e030a966183f56cb5c9c1b04cf51f5337 by Thiago Neves <thiagohneves@gmail.com>:

fix(tests): use mock GCS client in artifact service tests to avoid real credentials

--
becd2925feebf60196129b029a0ab8d490f7b19e by Thiago Neves <thiagohneves@gmail.com>:

test(agents): add unit tests for live_request_queue, readonly_context, and run_config

COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/641 from thiagoneves:feature/increase-test-coverage 0f7a9fc55d97902e190a394f099324fbeb1541af
PiperOrigin-RevId: 756798390
2025-05-09 09:33:40 -07:00
𝕂
8963300518 test(cli): Add unit tests for CLI functionality
Copybara import of the project:

--
f60707a22905f30040808b41b7e3510a47a80fc6 by K <51281148+K-dash@users.noreply.github.com>:

test(cli): Add unit tests for CLI functionality

This commit introduces unit tests for the following CLI-related components:

- cli_deploy.py: Tests for the cloud deployment feature.
- cli_create.py: Tests for the agent creation feature.
- cli.py: Tests for the main CLI execution logic.
- cli_tools_click.py: Tests for the Click-based CLI tools.

--
7be2159a475d0785619fea5e40c70e6461a7f4e1 by K <51281148+K-dash@users.noreply.github.com>:

fix test_cli_eval_success_path

COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/577 from K-dash:test/add-unit-tests-for-cli 69f12d3a27d9c50a46ef269075e050f498dee67a
PiperOrigin-RevId: 756602765
2025-05-08 22:18:33 -07:00
Selcuk Gun
2cbbf88135 Support chaining for tool callbacks
(before/after) tool callbacks are invoked throughout the provided chain until one callback does not return None. Callbacks can be async and sync.

PiperOrigin-RevId: 756526507
2025-05-08 17:38:04 -07:00
Thiago Neves
5fd6a448de Copybara import of the project:
--
0723b0915550a0af9d1eb2952ee193238eee8178 by Thiago Neves <thiagohneves@gmail.com>:

fix(tests): use mock GCS client in artifact service tests to avoid real credentials

COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/601 from thiagoneves:fix/mock-gcs-client-in-tests e7d16719b9c3116b652988d2ed1b1f8893686f3e
PiperOrigin-RevId: 756381115
2025-05-08 11:02:13 -07:00
Selcuk Gun
d45084f311 Support chaining for agent callbacks
(before/after) agent callbacks are invoked throughout the provided chain until one callback does not return None. Callbacks can be async and sync.

PiperOrigin-RevId: 756359693
2025-05-08 10:09:33 -07:00
Google Team Member
7f76af4d76 feat: trigger in ApplicationIntegrationTools is changed to triggers and is a list of strings
PiperOrigin-RevId: 756111287
2025-05-07 20:04:47 -07:00
Xiang (Sean) Zhou
e7d9cf359a make eval functions async
PiperOrigin-RevId: 756106627
2025-05-07 19:53:19 -07:00
Google Team Member
357143c2aa feat: trigger in ApplicationIntegrationTools is changed to triggers and is a list of strings
PiperOrigin-RevId: 755691136
2025-05-06 22:58:12 -07:00
luaifei
d5b3a89fe7 fix: fix a few unit tests
Copybara import of the project:

--
93cc9c0b71a92991a888c93675ddc8aee11f21dc by luaifei <lu.aifei@thoughtworks.com>:

fix: Update skipped tests in test_auth_handlers

--
06ddf559c76c113231719bff549d41801a93daf4 by luaifei <lu.aifei@thoughtworks.com>:

fix: Update skipped & failed tests in test_connections_client and test_streaming

--
b8f2d357c1101c59ee9b65fa89a75f216e014a7c by luaifei <lu.aifei@thoughtworks.com>:

fix: Remove ignored test file from Python unit tests workflow
COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/553 from luaifei:fix-tests d51e42841e71d388c16cc719a4798b029182084f
PiperOrigin-RevId: 755669644
2025-05-06 21:45:17 -07:00
Selcuk Gun
e4317c9eb7 Support chaining for model callbacks
(before/after) model callbacks are invoked throughout the provided chain until one callback does not return None. Callbacks can be async and sync.

PiperOrigin-RevId: 755565583
2025-05-06 16:16:02 -07:00
Selcuk Gun
794a70edcd Support async agent and model callbacks
PiperOrigin-RevId: 755542756
2025-05-06 15:14:10 -07:00
Allen
1393965720 Fix: config.after_timestamp behavior in InMemorySessionService.get_session() and add a test
Copybara import of the project:

--
c1d0d649b5aae1322a02dbaa586822d69b8546f6 by allengour <allengour@google.com>:

fix: fix and test `config.after_timestamp` behavior in `InMemorySessionService.get_session()`
COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/438 from allengour:fix/issue-437-after_timestamp-behavior 4b49a5e6509b5ad9dd9103a6dc357fd44c101f31
PiperOrigin-RevId: 755492201
2025-05-06 13:09:59 -07:00
Shangjie Chen
905c20dad6 ADK changes
PiperOrigin-RevId: 755201925
2025-05-05 21:58:47 -07:00
Hangfei Lin
a7b4c98253 fix: Handle the case when parameter.required is None and fix tests
PiperOrigin-RevId: 754519323
2025-05-03 22:39:28 -07:00
Bart
ad4226b3d8 Copybara import of the project:
--
1ca16aba5b7b869afa8e0a0cddaea539acd737f5 by bart.lee(이철민)/kakao <bart.lee@kakaocorp.com>:

chore: Improves session update time validation message

Enhances the error message when a session's last update time is later than the storage update time.
This provides better readability by formatting the timestamps in the error message.

COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/446 from kakao-bart-lee:main a2a0cff036429b61bd7cf1600fc4c2c0cf50089d
PiperOrigin-RevId: 754452381
2025-05-03 17:07:53 -07:00
Hangfei Lin
81aa11f070
fix: Update test_operation_parser.py 2025-05-03 14:50:30 -07:00
Hangfei Lin
a6b3c23f74
fix: fix typo in function name in unit tests(test_rest_api_tool.py)
fix: fix typo in function name in unit tests
2025-05-03 14:25:36 -07:00
Xiang (Sean) Zhou
5846b24b71 set param required tag to False by default
PiperOrigin-RevId: 754382785
2025-05-03 10:31:38 -07:00
Nilesh
c74879d849
fix: Correct various typos in CHANGELOG.md and test_rest_api_tool.py (#498)
Corrected the following spelling errors:
 - CHANGELOG.md: "impprovements" -> "improvements"
 - test_rest_api_tool.py: "def sample_endpiont:" -> "def sample_endpoint:"
 - Updated all the references of sample_endpiont -> sample_endpoint as well.
 - CHANGELOG.md: "credentails" -> "credentials"
 - CHANGELOG.md: "auido" -> "audio"

Co-authored-by: Hangfei Lin <hangfei@google.com>
2025-05-02 23:12:00 -07:00
Hangfei Lin
60d23c028f ADK changes
PiperOrigin-RevId: 754193272
2025-05-02 17:53:31 -07:00
Nilesh
eff5903175 Copybara import of the project:
--
6c3b8b5fa2eb9805c6f723f560e5526649dd61f0 by knileshh <neutron_stays@protonmail.com>:

fix: Correct various typos in CHANGELOG.md and test_rest_api_tool.py

Corrected the following spelling errors:
 - CHANGELOG.md: "impprovements" -> "improvements"
 - test_rest_api_tool.py: "def sample_endpiont:" -> "def sample_endpoint:"
 - CHANGELOG.md: "credentails" -> "credentials"
 - CHANGELOG.md: "auido" -> "audio"

COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/498 from knileshh:main caadbdbd78e3dc757b494f3f4d45991e88eac30d
PiperOrigin-RevId: 754189420
2025-05-02 17:36:16 -07:00
hsuyuming
879064343c Copybara import of the project:
--
ad923c2c8c503ba73c62db695e88f1a3ea1aeeea by YU MING HSU <abego452@gmail.com>:

docs: enhance Contribution process within CONTRIBUTING.md

--
8022924fb7e975ac278d38fce3b5fd593d874536 by YU MING HSU <abego452@gmail.com>:

fix: move _maybe_append_user_content from google_llm.py to base_llm.py,
so subclass can get benefit from it, call _maybe_append_user_content
from generate_content_async within lite_llm.py

--
cf891fb1a3bbccaaf9d0055b23f614ce52449977 by YU MING HSU <abego452@gmail.com>:

fix: modify install dependencies cmd, and use pyink to format codebase
COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/428 from hsuyuming:fix_litellm_error_issue_427 dbec4949798e6399a0410d1b8ba7cc6a7cad7bdd
PiperOrigin-RevId: 754124679
2025-05-02 13:59:50 -07:00
Alankrit Verma
27ce65ff50 Copybara import of the project:
--
21736067f9 by Alankrit Verma <alankrit386@gmail.com>:

feat(llm_flows): support async before/after tool callbacks

Previously, callbacks were treated as purely synchronous,
so passing an async coroutine caused “was never awaited”
errors and Pydantic serialization failures.

Now we detect awaitable return values from
before_tool_callback and after_tool_callback,
and `await` them if necessary.

Fixes: #380

--
08ac9a117e by Alankrit Verma <alankrit386@gmail.com>:

Refactor function callback handling and update type signatures

- Simplify variable names in `functions.py`: always use `function_response` and `altered_function_response`
- Update LlmAgent callback type aliases to support async:
  - Import `Awaitable`
  - Change `BeforeToolCallback` and `AfterToolCallback` signatures to return `Awaitable[Optional[dict]]`
- Ensure `after_tool_callback` uses `await` when necessary

--
fcbf57466e by Alankrit Verma <alankrit386@gmail.com>:

refactor: update callback type signatures to support sync and async responses
COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/434 from AlankritVerma01:support-async-tool-callbacks 926b0ef1a6
PiperOrigin-RevId: 753005846
2025-04-29 21:40:33 -07:00
Ankur Sharma
f872577f68 Currently if a model calls a FunctionTool without all the mandatory parameters, the code will just break. This change basically adds the capability for the FunctionTool to identify if the model is missing required arguments, and in that case, instead of breaking the execution, it provides a error message to the model so it could fix the request and retry.
PiperOrigin-RevId: 751023475
2025-04-24 09:31:40 -07:00
Google Team Member
ca993277de ADK changes
PiperOrigin-RevId: 750763037
2025-04-23 16:28:57 -07:00
Xiang (Sean) Zhou
956fb912e8 feat(auth)!: expose access_token and refresh_token at top level of auth credentails
BREAKING CHANGE: `token` attribute of OAuth2Auth credentials used to be a dict containing both access_token and refresh_token, given that may cause confusions, now we replace it with access_token and refresh_token at top level of the auth credentials

PiperOrigin-RevId: 750346172
2025-04-22 15:23:21 -07:00
Che Liu
21d2047ddc ADK changes
PiperOrigin-RevId: 749973427
2025-04-21 17:28:53 -07:00
Trần Đặng Trung Đức
e31cd0b5f8 No public description
COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/243 from trandangtrungduc:fix_typos 6e317d69de
PiperOrigin-RevId: 749106557
2025-04-18 12:07:52 -07:00