Commit Graph

124 Commits

Author SHA1 Message Date
Ankur Sharma
984c1d6b8b test: Added unit test coverage for local_eval_set_results_manager.py
PiperOrigin-RevId: 767202237
2025-06-04 10:39:09 -07:00
Xiang (Sean) Zhou
b1a74d099f fix: relax openapi spec to gemini schema conversion to tolerate more cases
PiperOrigin-RevId: 766985694
2025-06-03 22:59:34 -07:00
Selcuk Gun
eaee49bc89 fix: Simplify content for ollama provider
Even though litellm type definitions and openai API specifies content as list of dictionaries (with type and relevant attributes potentially to allow multimodal inputs/outputs in addition to text), ollama has been demonstrating marshal errors. As a workaround this change simplifies the content as string when there is no more than one content part.

Fixes #642, #928, #376

PiperOrigin-RevId: 766890141
2025-06-03 17:37:43 -07:00
Xiang (Sean) Zhou
7b51ae9724 fix: enhance agent loader exception handler and expose precise error information
PiperOrigin-RevId: 766876662
2025-06-03 16:56:29 -07:00
Google Team Member
ec8bc7387c fix: ParallelAgent should only append to its immediate sub-agent, not transitive descendants
Restores automatic conversation history sharing for sequential/loop sub-agents.

PiperOrigin-RevId: 766742380
2025-06-03 16:55:51 -07:00
Google Team Member
16f7d98acf feat: Update for anthropic models
Enable parallel tools for anthropic models, and add agent examples, and also added functional test for anthropic models.

PiperOrigin-RevId: 766703018
2025-06-03 16:55:34 -07:00
Google Team Member
af95dd2932 feat: Add sortByColumn functionality to List Operation
This change introduces the ability to sort results by a specific column in the List Operation.

PiperOrigin-RevId: 766468964
2025-06-03 16:55:17 -07:00
Ankur Sharma
174afb3975 Added unit test coverage for local_eval_sets_manager.py
PiperOrigin-RevId: 766392263
2025-06-03 16:54:58 -07:00
Xiang (Sean) Zhou
5a67a946d2 fix: fix parameter schema generation for gemini
this fixes https://github.com/google/adk-python/issues/1055
and https://github.com/google/adk-python/issues/881

PiperOrigin-RevId: 766288394
2025-06-02 12:03:02 -07:00
Xiang (Sean) Zhou
15a45a68fd chore: move fast api test case to cli package to match source codes package structure
PiperOrigin-RevId: 766268528
2025-06-02 11:16:14 -07:00
Xiang (Sean) Zhou
f07abcc09c chore: fix ut for test_functions_request_euc.py
PiperOrigin-RevId: 766268126
2025-06-02 11:15:13 -07:00
Selcuk Gun
b181cbc8bc fix: Handle non-indexed function call chunks with incremental fallback index
This is in response to the litellm v1.71.2 + ollama v0.9.0 sending function call chunks with 0 indices across multiple calls and lacking call ids.

Solutions introduced:
1. increment fallback index when accumulated arg becomes json parsable.
2. tolerate finish reason == stop when tool calls are present
3. fallback to index when tool call id is None

Fixes https://github.com/google/adk-python/issues/294

PiperOrigin-RevId: 766258344
2025-06-02 10:51:56 -07:00
Jaeyeon Kim(김재연)
b0403b2d98 Copybara import of the project:
--
8772b3de0b2fd04f246cc90c4c8032f9dc8cfed9 by Jaeyeon Kim <anencore94@gmail.com>:

fix: update unit test code for test_connection

 - Fix for Unit Test Failures

--
8e0b45c2a64994bfda6401847e485fdd9edc8306 by Jaeyeon Kim <anencore94@gmail.com>:

fix useless changes

--
54efa004fa0fc9bcf78b49061221994650e162bc by Jaeyeon Kim <anencore94@gmail.com>:

fix conflict resolve issue

--
003ed4418c73b74bfba5ff055a364b62ddc18fa7 by Wei Sun (Jack) <weisun@google.com>:

Autoformat test_connections_client.py

COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/578 from anencore94:bugfix/failed_unittests ba0e1d33ad905b0b046023b685c70f4ef05e4efa
PiperOrigin-RevId: 766221165
2025-06-02 09:20:41 -07:00
Shangjie Chen
8d36dbda52 feat: Add an option to use gcs artifact service in adk web.
Resolves https://github.com/google/adk-python/issues/309

PiperOrigin-RevId: 765772763
2025-06-01 00:28:49 -07:00
Calvin Giles
0e72efb439 fix: Call all tools in parallel calls during partial authentication
Copybara import of the project:

--
ffd6184d7e402b0787b0fa37fc09cd519adcc7f3 by Calvin Giles <calvin.giles@trademe.co.nz>:

fix: Call all tools in parallel calls during partial authentication

--
c71782a582ba825dbe2246cdb5be3f273ca90dca by seanzhou1023 <seanzhou1023@gmail.com>:

Update auth_preprocessor.py
--
843af6b1bc0bc6291cb9cb23acf11840098ba6dd by seanzhou1023 <seanzhou1023@gmail.com>:

Update test_functions_request_euc.py
--
955e3fa852420ecbf196583caa3cf86b7b80ab56 by seanzhou1023 <seanzhou1023@gmail.com>:

Update test_functions_request_euc.py

COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/853 from calvingiles:fix-parallel-auth-tool-calls f44671e37b9fe44a25c9b1c0c25a26fc634b011c
PiperOrigin-RevId: 765639904
2025-05-31 13:14:06 -07:00
Xiang (Sean) Zhou
036f954a2a refactor: uniform Google LLM variant and parsing logic and make contant value consistent with Google GenAI SDK : 903e0729ce/google/genai/_automatic_function_calling_util.py (L96)
PiperOrigin-RevId: 765639681
2025-05-31 13:12:25 -07:00
Ankur Sharma
e06e6753ad chore: Add the name of the agent as a billing label. This will help consumers slice their billing reports by Agent.
Fixes https://github.com/google/adk-python/issues/452

PiperOrigin-RevId: 765402643
2025-05-30 17:54:28 -07:00
Calvin Giles
4075290a1d chore: Fix reqeust -> request typo
Copybara import of the project:

--
6beac4451fef1774365e75ab67779253c5ac79be by Calvin Giles <calvin.giles@trademe.co.nz>:

chore: Fix reqeust -> request typo
#non-breaking
COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/883 from calvingiles:fix-reqeust-typo cfe592e6ad4ebc79bd2b3ebcd0370f868b57ff10
PiperOrigin-RevId: 765354040
2025-05-30 15:13:42 -07:00
Google Team Member
ba5b80d5d7 feat: use bigquery scope by default in bigquery credentials.
Right now the agent builder has to specify the bigquery scope explicitly for bigquery tools, which is somewhat unnecessary. With this change the user does not have to specify scopes, although they would still have the ability to overrides scopes if necessary.

PiperOrigin-RevId: 765354010
2025-05-30 15:12:49 -07:00
Shawn Yang
3930a4b989 chore: Add agent engine telemetry
PiperOrigin-RevId: 765346182
2025-05-30 14:49:39 -07:00
Shangjie Chen
65063023a5 fix: Continue fetching events if there are multiple pages.
Fixes https://github.com/google/adk-python/issues/920

PiperOrigin-RevId: 764985371
2025-05-29 19:42:50 -07:00
Wei Sun (Jack)
4214c7eddd chore: auto-format files.
PiperOrigin-RevId: 764980009
2025-05-29 19:24:16 -07:00
Amulya Bhatia
face2e8cf2 Copybara import of the project:
--
8baeb0b569eaedc638b20e46894178a3b878dbd6 by Amulya Bhatia <amulya.bhatia@t-online.de>:

test: unit tests for built_in_code_executor and unsafe_code_executor

--
cfac73b9271557ead96eb5fb419e05d88c6e8cd4 by Amulya Bhatia <amulya.bhatia@t-online.de>:

test: unit tests for built_in_code_executor and unsafe_code_executor
COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/971 from iamulya:code-executor-tests 55290e27b5e58ef3835905aec88639e936318d01
PiperOrigin-RevId: 764976316
2025-05-29 19:08:55 -07:00
Xiang (Sean) Zhou
ae7d3a79c8 chore: autoformat the test_litellm.py
PiperOrigin-RevId: 764937761
2025-05-29 16:49:20 -07:00
Xiang (Sean) Zhou
2b41824e46 chore: fix fast api ut
PiperOrigin-RevId: 764935253
2025-05-29 16:40:40 -07:00
Liang Wu
41ba2d1c8a chore: reformat the code using autoformat.sh.
PiperOrigin-RevId: 764918729
2025-05-29 15:56:29 -07:00
LucasNobre
05f4834759 Copybara import of the project:
--
cef3ca1ed3493eebaeab3e03bdf5e56b35c0b8ef by Lucas Nobre <lucaas.sn@gmail.com>:

feat: Add index tracking to handle parallel tool call using litellm
COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/759 from lucasnobre212:fix/issue_484 65e22934bf839f9ea03963b9ec6c23fdce03f59f
PiperOrigin-RevId: 764902433
2025-05-29 15:11:23 -07:00
Google Team Member
ac52eab88e ADK changes
PiperOrigin-RevId: 764776124
2025-05-29 11:47:55 -07:00
Selcuk Gun
999a7fe69d Make tool_call one span for telemetry
Also renamed tool_call as execute_tool and added attributes as recommended in https://opentelemetry.io/docs/specs/semconv/gen-ai/gen-ai-spans/#execute-tool-span.

PiperOrigin-RevId: 764594179
2025-05-29 11:47:40 -07:00
Xiang (Sean) Zhou
96b36b70dc chore: fix base_llm_flow ut
PiperOrigin-RevId: 764585592
2025-05-29 11:47:31 -07:00
Xiang (Sean) Zhou
0250d9e3ac chore: reformat codes using autoformat.sh
PiperOrigin-RevId: 764584699
2025-05-29 11:47:22 -07:00
Xiang (Sean) Zhou
b92e068155 chore: fix function tool UT
PiperOrigin-RevId: 764567867
2025-05-28 22:30:42 -07:00
Almas Akchabayev
795605a37e fix: separate thinking from text parts in streaming mode
Copybara import of the project:

--
79962881ca1c17eb6d7bd9dcf31a44df93c9badd by Almas Akchabayev <almas.akchabayev@gmail.com>:

fix: separate thinking from text parts in streaming mode
COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/777 from almeynman:separate-thinking-and-text-parts-in-stream-mode b63dcc7fd0fc3973888dcbb9d4cc7e7e0a66e7f7
PiperOrigin-RevId: 764561932
2025-05-28 22:11:14 -07:00
Google Team Member
60ceea72bd fix: do not convert "false" value to dict
This causes information loss, and is unexpected from user.

PiperOrigin-RevId: 764558190
2025-05-28 21:56:52 -07:00
Xiang (Sean) Zhou
791ac9eb68 refactor: refactor cli to use agent loader
PiperOrigin-RevId: 764546019
2025-05-28 21:09:40 -07:00
Danny Park
9d4ca4ed44 fix: Fix filtering by user_id for vertex ai session service listing
When the user id contains special characters (i.e. an email), we have added in extra url parsing to address those characters. We have also added an if statement to use the correct url when there is no user_id supplied.

Copybara import of the project:

--
ef8499001afaea40bd037c4e9946b883e23a5854 by Danny Park <dpark@calicolabs.com>:
--
773cd2b50d15b9b056b47b6155df492b0ca8034c by Danny Park <dpark@calicolabs.com>:

COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/996 from dpark27:fix/list_vertex_ai_sessions d351d7f6017c03165129adc7d0212f21d1340d88
PiperOrigin-RevId: 764522026
2025-05-28 19:46:39 -07:00
Shangjie Chen
bf27f22a95 fix: Make GroundingMetadata JSON serializable. Also use the same logic to simplify content serialization.
PiperOrigin-RevId: 764401248
2025-05-28 13:50:25 -07:00
avidelatm
7fc09b2c64 chore: Adding regex for claude-4 models to anthropic_llm and updating tests
Copybara import of the project:

--
824b4379d59a375191f8ce10997efd4021d5d0b3 by Andres Videla <andres.videla@trademe.co.nz>:

Adding regex for claude-4 models to anthropic_llm and updating tests

--
8fa2a2df1931026dc803eee0e9b60e82e90c9efa by Wei Sun (Jack) <Jacksunwei@gmail.com>:

Adds trailing comma.

COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/934 from avidelatm:feature/add-support-for-claude-4-models-to-anthropic_llm 8d10bacdbec952ec9832180ac6c1d220916641da
PiperOrigin-RevId: 764396694
2025-05-28 13:39:04 -07:00
Google Team Member
d6c6bb4b24 feat: add BigQuery first-party tools.
These tools support getting BigQuery dataset/table metadata and query results.

PiperOrigin-RevId: 764139132
2025-05-28 00:59:19 -07:00
Xiang (Sean) Zhou
d40df2edf2 chore: fix unit tests
PiperOrigin-RevId: 764107186
2025-05-27 23:07:29 -07:00
Xiang (Sean) Zhou
618c824994 feat: extract agent loading logic from fast_api.py to a separate AgentLoader class and support more agent definition folder/file structure.
Structures supported:
a) agents_dir/agent_name.py (with root_agent or agent.root_agent in it)
b) agents_dir/agent_name_folder/__init__.py (with root_agent or agent.root_agent in the package)
c) agents_dir/agent_name_folder/agent.py (where agent.py has root_agent)

PiperOrigin-RevId: 763943716
2025-05-27 14:14:51 -07:00
Stephen Smith
03fe909ada Copybara import of the project:
--
b781880d9bfb9786bd5e50314eaedc441fc2a93e by Stephen Smith <stephen.smith@newfront.com>:

Telemetry unit test for non-serializable data.

--
179da9db997bb3f992e126c9c64193ff7df67b3d by Stephen Smith <stephen.smith@newfront.com>:

When converting the llm_request to JSON, skip non-serializable data.

--
5dc68f4f5a6d12b753fdb81d1449716d13490afb by Stephen Smith <stephen.smith@newfront.com>:

Update _create_invocation_context() return type to InvocationContext.

--
23a33f754409fcd2a7641098d68cef7e4f1c72c6 by Stephen Smith <stephen.smith@newfront.com>:

Oops, remove unnecessary import.

COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/879 from stephensmithnewfront:main f71e195a9ed157e4c0b3abfa74ae078b0c1a920a
PiperOrigin-RevId: 763922003
2025-05-27 13:21:44 -07:00
Yongsul Kim
c024ac5762 Align event filtering and ordering logic
Copybara import of the project:

--
d01a8fd5f079bc4fca9e4b71796dbe65312ce9ff by Leo Yongsul Kim <ystory84@gmail.com>:

fix(DatabaseSessionService): Align event filtering and ordering logic

This commit addresses inconsistencies in how DatabaseSessionService
handles config.after_timestamp and config.num_recent_events
parameters, aligning its behavior with InMemorySessionService and
VertexAiSessionService.

Key changes:
- Made after_timestamp filtering inclusive
- Corrected num_recent_events behavior to fetch the N most recent events
- Refined timezone handling for after_timestamp
- Updated the unit test test_get_session_with_config to includeSessionServiceType.DATABASE, allowing verification of these fixes.

Fixes #911

COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/915 from ystory:fix/database-session-timestamp-recency 5cc8cf5f5a5c0cb3e87f6ab178a5725d3f696c88
PiperOrigin-RevId: 763874840
2025-05-27 11:22:04 -07:00
Xiang (Sean) Zhou
be0786ea88 refactor: rename agent_dir to agents_dir and rename app_id to app_name in fast_api.py to make it consistent among every endpoints
PiperOrigin-RevId: 763483339
2025-05-26 11:51:19 -07:00
Xiang (Sean) Zhou
694eca08e5 fix: fix bigquery credentials and bigquery tool to make it compatible with python 3.9 and make the credential serializable in session
PiperOrigin-RevId: 763332829
2025-05-26 01:58:52 -07:00
Xiang (Sean) Zhou
74a331f1fb chore: reformat the code with autoformat.sh
PiperOrigin-RevId: 763256626
2025-05-25 20:33:45 -07:00
Calvin Giles
1a43cf0f60 Copybara import of the project:
--
73826d258b136f92a8da8171f7dc14d5f07de8dd by Calvin Giles <calvin.giles@trademe.co.nz>:

fix: Enable InMemoryRunner to be used in async tests
COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/868 from calvingiles:enable-test-runner-in-async fb9033ed6f350a3114859715cae51798f864ecf6
PiperOrigin-RevId: 763233472
2025-05-25 18:49:35 -07:00
Xiang (Sean) Zhou
a380d70ac7 chore: fix cli UT
PiperOrigin-RevId: 762734348
2025-05-24 00:11:32 -07:00
Xiang (Sean) Zhou
756a326033 feat: add customized bigquer tool wrapper class to facilitate developer to handcraft bigquery api tool
PiperOrigin-RevId: 762626700
2025-05-23 17:23:41 -07:00
Google Team Member
8076b2294f ADK changes
PiperOrigin-RevId: 762573275
2025-05-23 14:41:27 -07:00