Commit Graph

1096 Commits

Author SHA1 Message Date
Shangjie Chen fb009d8ea6 fix: Add custom_metadata to DatabaseSessionService
Resolve https://github.com/google/adk-python/issues/2677

PiperOrigin-RevId: 802375768
2025-09-02 20:09:46 -07:00
Google Team Member aad153322e docs: update the ask_data_insights docstring
PiperOrigin-RevId: 802362601
2025-09-02 19:21:04 -07:00
Shangjie Chen 219815d2d7 chore: Update create_session endpoint to use Request message as post body
Also deprecate create_session_with_id which is not very RESTful.

PiperOrigin-RevId: 802357718
2025-09-02 18:56:45 -07:00
Xiang (Sean) Zhou a503a0c807 ci: Load discussion data from event content to avoid additional GraphQL API call
PiperOrigin-RevId: 802308383
2025-09-02 15:22:17 -07:00
Xiang (Sean) Zhou 408d3dfeb1 chore: refactor discussion answering agent to merge answer_discussions.py into main.py
mainly to dedup duplicated functionality in both file.

PiperOrigin-RevId: 802291102
2025-09-02 14:25:32 -07:00
Google Team Member 831e2e6d4d ADK changes
PiperOrigin-RevId: 801284664
2025-08-30 11:08:43 -07:00
Hangfei Lin dff733c6fc feat: Upgrade ADK stack to use App instead in addition to root_agent
The convention:
- If some fields(like plugin) are defined both at root_agent and app, then a error will be raised.
- app code should be located within agent.py.
- an instance named app should be created

PiperOrigin-RevId: 801252329
2025-08-30 08:01:53 -07:00
Xiang (Sean) Zhou 67f23df25a feat: Allow user specify embedding model for file retrieval
And use Gemini embedding model as default model if no embedding model is specified.

PiperOrigin-RevId: 801161505
2025-08-29 23:35:25 -07:00
Shangjie Chen 0c87907bcb fix: Enforce foreign key constraint for SQLite DB
Resolves https://github.com/google/adk-python/issues/2752

PiperOrigin-RevId: 801106660
2025-08-29 19:07:22 -07:00
Google Team Member 214f2884f5 feat: Upgrade ADK stack to use App instead in addition to root_agent
The convention:
- If some fields(like plugin) are defined both at root_agent and app, then a error will be raised.
- app code should be located within agent.py.
- an instance named app should be created

PiperOrigin-RevId: 801103084
2025-08-29 18:49:04 -07:00
Hangfei Lin a2e89a22a5 feat: Upgrade ADK stack to use App instead in addition to root_agent
The convention:
- If some fields(like plugin) are defined both at root_agent and app, then a error will be raised.
- app code should be located within agent.py.
- an instance named app should be created

PiperOrigin-RevId: 801084463
2025-08-29 17:33:38 -07:00
Xiang (Sean) Zhou 98b0426cd2 chore: Make UT of a2a consistent about how tests should be skipped when python verison < 3.10
PiperOrigin-RevId: 801040421
2025-08-29 14:59:27 -07:00
Google Team Member 2eddc5e4d3 feat: allow setting compute project for BigQuery tools
This will allow restricting BigQuery SQL executions to the specified project. The agent/LLM should resolve the `project_id` param for tools like `execute_sql` and sometimes they can resolve it to an unexpected value due to hallucination or ambiguity. This guardrail will protect against that situation.

PiperOrigin-RevId: 801039685
2025-08-29 14:56:47 -07:00
Shangjie Chen a17bcbb2aa feat: Add a tool confirmation flow that can guard tool execution with explicit confirmation and custom input
The existing `LongRunningTool` does not define a programmatic way to provide & validate structured input, also it relies on LLM to reason and parse the user's response.

For a quick start, annotate the function with `FunctionTool(my_function, require_confirmation=True)`. A more advanced flow is shown in the `human_tool_confirmation` sample.

The new flow is similar to the existing Auth flow:
- User request a tool confirmation by calling `tool_context.request_confirmation()` in the tool or `before_tool_callback`, or just using the `require_confirmation` shortcut in FunctionTool.
- User can provide custom validation logic before tool call proceeds.
- ADK creates corresponding RequestConfirmation FunctionCall Event to ask user for confirmation
- User needs to provide the expected tool confirmation to a RequestConfirmation FunctionResponse Event.
- ADK then checks the response and continues the tool call.

PiperOrigin-RevId: 801019917
2025-08-29 13:56:54 -07:00
Xiang (Sean) Zhou 3ed9097983 chore: Add initial version of agent builder assistant that assists user to build config based agent
PiperOrigin-RevId: 801014241
2025-08-29 13:42:31 -07:00
George Weale 9291daaa8e chore: Add warning for using Gemini models via LiteLLM
Recommend to use Gemini outside of LiteLLM

PiperOrigin-RevId: 800971705
2025-08-29 11:32:45 -07:00
Google Team Member fcd748e17f chore: add contributing Spanner tools RAG agent sample
PiperOrigin-RevId: 800938492
2025-08-29 10:00:43 -07:00
Xiang (Sean) Zhou bb4cfdec12 fix: inject artifact into instructions
a. complain when artifact is None
b. inject None value as empty string instead of `None`

PiperOrigin-RevId: 800930613
2025-08-29 09:38:01 -07:00
George Weale e45c3be238 fix: send full MIME types for image/video/pdf in get_content
Use full media types (image/jpeg, video/mp4, application/pdf) instead of suffixes (jpeg/mp4/pdf) when constructing LiteLLM payloads
This fxes compatibility with providers that validate media types (Anthropic)
Updated and added unit tests to assert full MIME types for image/video/pdf

PiperOrigin-RevId: 800685204
2025-08-28 18:02:18 -07:00
Google Team Member 11a2ffe35a feat: allow setting agent/application name for BigQuery tools
This will allow tracking of tool usage per agent/application.

PiperOrigin-RevId: 800607186
2025-08-28 14:10:01 -07:00
Jinning Li f4a8df0ba2 feat:Add tool_responses to IntermediateData
PiperOrigin-RevId: 800600571
2025-08-28 13:55:15 -07:00
Wei Sun (Jack) 8e43f0dd83 fix(deploy): Add back installing requirements.txt to Dockerfile template for cloud run
PiperOrigin-RevId: 800595427
2025-08-28 13:43:03 -07:00
Xiang (Sean) Zhou b92b288c97 chore: fix flaky unit tests: tests/unittests/flows/llm_flows/test_functions_simple.py
original tests assert too strict time boundary, now we only assert the parallel execution time should be less than sequential execution time

PiperOrigin-RevId: 800563929
2025-08-28 12:17:03 -07:00
Xiang (Sean) Zhou 8d6f138fbe chore: Update oauth calendar sample agent to test the case when a subsequent tool call happends right after a tool call that requires auth
context: this is for reproducing https://github.com/google/adk-python/issues/1944 and verify corresponding fix
PiperOrigin-RevId: 800561025
2025-08-28 12:10:43 -07:00
Xiang (Sean) Zhou 3b922a2f6d fix: Only process the auth responses in the last event with content (if applicable i.e. it's authored by user)
fixes : https://github.com/google/adk-python/issues/1944
PiperOrigin-RevId: 800560805
2025-08-28 12:09:21 -07:00