Commit Graph

255 Commits

Author SHA1 Message Date
Shangjie Chen
14933ba470 feat: Extract content encode/decode logic to a shared util and resolve issues with JSON serialization.
feat: Update key length for DB table to avoid key too long issue in mysql

PiperOrigin-RevId: 753614879
2025-05-01 09:13:28 -07:00
Wei Sun
b691904e57 chore: Adds a github action to check pyformat via pyink.
PiperOrigin-RevId: 753246116
2025-04-30 11:28:12 -07:00
Wei Sun (Jack)
641781bced
Merge pull request #434 from AlankritVerma01/support-async-tool-callbacks
feat(llm_flows): support async before/after tool callbacks
2025-04-29 22:49:18 -07:00
Wei Sun (Jack)
c4e09a2edb
Merge branch 'main' into support-async-tool-callbacks 2025-04-29 22:48:45 -07:00
João Campista
acbbdb7266 Copybara import of the project:
--
709e1dd079d03d7eb4d742b9448ed3d1b946ff30 by joao.campista <joaocampista@proton.me>:

feat: add ordering to recent events in database session service
COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/454 from lugui-co:main 912503f972c9cbd8982f2b7f8b210d4e0fe08b69
PiperOrigin-RevId: 753013663
2025-04-29 22:13:41 -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
Alankrit Verma
926b0ef1a6
Merge branch 'main' into support-async-tool-callbacks 2025-04-29 22:08:18 -04:00
Xiang (Sean) Zhou
dbbeb190b0 Add two adk run options:
--replay : a json file that contains the initial session state and user queries, adk run will create a new session based on the state and run the user queries against the session. Users cannot continue to interact with agent.

--resume : a json file that contains the previously saved session (by --save_session option), adk run will replay this session and then user can continue to interact with the agent.
PiperOrigin-RevId: 752923403
2025-04-29 16:23:10 -07:00
Shangjie Chen
2a9ddec7e3 Set the max size of strings in database columns.
PiperOrigin-RevId: 752918808
2025-04-29 16:07:45 -07:00
Xiang (Sean) Zhou
2ea4315e9f update the doc comments of requested_auth_configs to make it more precise.
PiperOrigin-RevId: 752861847
2025-04-29 13:33:37 -07:00
Wei Sun (Jack)
67b6fbbe01
chore: Adds a github action to check pyformat via pyink. (#440)
* Adds pyink.yml github action to check file format

* Update pyink.yml to give recommended commands.
2025-04-29 09:39:18 -07:00
Alankrit Verma
fcbf57466e refactor: update callback type signatures to support sync and async responses 2025-04-29 09:02:09 -04:00
Alankrit Verma
504aa6ba06
Merge branch 'main' into support-async-tool-callbacks 2025-04-28 23:21:10 -04:00
Alankrit Verma
08ac9a117e 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
2025-04-28 23:16:43 -04:00
Paul Lam
4ae8d72a8d
docs: correct typo in conversion_utils.py (#351)
* docs: correct typo in conversion_utils.py

* docs: edited for conciseness
2025-04-28 19:47:34 -07:00
Alankrit Verma
21736067f9 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
2025-04-28 14:36:25 -04:00
Shangjie Chen
9a9f7a3765 Update callback comments.
PiperOrigin-RevId: 752162448
2025-04-27 22:20:02 -07:00
Hangfei Lin
aa7a98ad9d update readme
PiperOrigin-RevId: 751168005
2025-04-24 15:50:09 -07:00
Yifan Wang
a5bf6e3608 ADK changes
PiperOrigin-RevId: 751099184
2025-04-24 12:48:31 -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
Wei Sun (Jack)
e6109b1dd6 Copybara import of the project:
--
005028831b2e0873414db62af9ec02ef47a670d2 by Wei Sun (Jack) <weisun@google.com>:

Excludes tests/unittests/tools/application_integration_tool/clients/test_connections_client.py from python-unit-tests.yml
--
42ed38ff814f1a4811468d78cf1872869279919d by Wei Sun (Jack) <weisun@google.com>:

reorder skipped tests in python-unit-tests.yml

COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/368 from google:fix-unittests 42ed38ff814f1a4811468d78cf1872869279919d
PiperOrigin-RevId: 750782234
2025-04-23 17:35:34 -07:00
Google Team Member
ca993277de ADK changes
PiperOrigin-RevId: 750763037
2025-04-23 16:28:57 -07:00
Wei Sun
a49d339251 bump version number to 0.3.0.
PiperOrigin-RevId: 750661619
2025-04-23 11:22:54 -07:00
Wei Sun (Jack)
04e4c85b4e
Merge pull request #355 from wyf7107/live-error-toast
fix: Add error toast message when live does not work with certain models
2025-04-22 22:26:38 -07:00
Yifan
3ad939d34c Copybara import of the project:
--
dc53678606 by Yifan Wang <wanyif@google.com>:

Update Google Search Tool display to the correct one

--
bbeb6525ea by Yifan Wang <wanyif@google.com>:

add license header to complied js file

--
db5ea6bc56 by Yifan Wang <wanyif@google.com>:

fix: Enable error toast when live does not work with certain models
COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/355 from wyf7107:live-error-toast 2062aa38a7
PiperOrigin-RevId: 750449832
2025-04-22 22:09:59 -07:00
Yifan
2062aa38a7
Merge branch 'main' into live-error-toast 2025-04-22 21:19:43 -07:00
Yifan Wang
db5ea6bc56 fix: Enable error toast when live does not work with certain models 2025-04-22 21:16:20 -07:00
Hangfei Lin
5c069cca8f
chore: Update README.md (#353)
add instruction about our releases.
2025-04-22 18:18:44 -07:00
Hangfei Lin
22cab9e9a4
chore: Update README.md (#328)
* chore: Update README.md

chore: update readme for contributing guideline

* chore: Update CONTRIBUTING.md

chore: Update CONTRIBUTING.md

* Update CONTRIBUTING.md
2025-04-22 17:20:24 -07:00
Shangjie Chen
a9da7a8fc3 feat: Add session_db_url to adk deploy option.
PiperOrigin-RevId: 750355535
2025-04-22 15:53:09 -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
Wei Sun
49d8c0fbb2 bump min version of google-genai sdk to latest.
PiperOrigin-RevId: 750324961
2025-04-22 14:17:27 -07:00
Yifan Wang
645402903a ADK changes
PiperOrigin-RevId: 750287732
2025-04-22 12:32:01 -07:00
Yifan
c531bb6ef1
Merge branch 'main' into google-search-display 2025-04-22 12:18:57 -07:00
Yifan
7cc3167e54 Copybara import of the project:
--
dc53678606 by Yifan Wang <wanyif@google.com>:

Update Google Search Tool display to the correct one

--
bbeb6525ea by Yifan Wang <wanyif@google.com>:

add license header to complied js file

COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/325 from wyf7107:google-search-display 353ff50611
PiperOrigin-RevId: 750284170
2025-04-22 12:17:25 -07:00
Yifan
353ff50611
Merge branch 'main' into google-search-display 2025-04-22 11:30:38 -07:00
Yifan Wang
bbeb6525ea add license header to complied js file 2025-04-22 11:21:22 -07:00
Vignesh Iyer
0e9096d865
chore: add support for overriding skip_summarization in AgentTool (#324) 2025-04-22 09:41:31 -07:00
Vignesh Iyer
923d806637 Copybara import of the project:
--
94c7f9579c56cb20252fd61b5fe568f73d864679 by Vignesh Iyer <vgnshiyer@gmail.com>:

chore: add support for overriding `skip_summarization` in AgentTool
COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/324 from vgnshiyer:main 94c7f9579c56cb20252fd61b5fe568f73d864679
PiperOrigin-RevId: 750060638
2025-04-21 23:24:25 -07:00
Yifan
463797be25
Merge branch 'main' into google-search-display 2025-04-21 20:53:06 -07:00
Yifan Wang
dc53678606 Update Google Search Tool display to the correct one 2025-04-21 20:50:26 -07:00
Che Liu
21d2047ddc ADK changes
PiperOrigin-RevId: 749973427
2025-04-21 17:28:53 -07:00
Wei Sun
a5f191650b chore: update the readme for a2a integration.
PiperOrigin-RevId: 749856734
2025-04-21 11:17:04 -07:00
Wei Sun
1e752b1378 chore: Fixes type hints in google_api_tool_set.py.
PiperOrigin-RevId: 749844560
2025-04-21 10:42:48 -07:00
Hangfei Lin
5ab43e804a
chore: update the readme for a2a integration (#319)
chore: update the readme for a2a integration
2025-04-21 09:55:30 -07:00
Nilanjan De
220b327a73
chore: fix typos (#272)
Co-authored-by: Hangfei Lin <hangfei@google.com>
2025-04-21 09:26:02 -07:00
Nilanjan De
1664b45562 Copybara import of the project:
--
16994cb2d5d646341f5285ca71d72697d81d18fe by Nilanjan De <nilanjan.de@gmail.com>:

chore: fix typos
COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/272 from n1lanjan:fix-typos a1ab655b08ec08c5dd2da71aab9a2386e3610e84
PiperOrigin-RevId: 749690489
2025-04-20 22:53:15 -07:00
Hangfei Lin
23f0383284
fix: The previous commit has a merge conflict. Fix it by adding this back.
The previous commit has a merge conflict. Fix it by adding this back.
2025-04-20 17:08:25 -07:00
Hangfei Lin
f7b436a985 No public description
COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/282 from hangfei:main 7b9c5e3bff76ed475fb57d45333a9ab135cac32d
PiperOrigin-RevId: 749616712
2025-04-20 16:05:06 -07:00
Wei Sun
2af777af6d No public description
PiperOrigin-RevId: 749409258
2025-04-19 16:34:44 -07:00