Commit Graph

4 Commits

Author SHA1 Message Date
Selcuk Gun
794a70edcd Support async agent and model callbacks
PiperOrigin-RevId: 755542756
2025-05-06 15:14:10 -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
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
Jack Sun
05142a07cc
Moves unittests to root folder and adds github action to run unit tests. (#72)
* Move unit tests to root package.

* Adds deps to "test" extra, and mark two broken tests in tests/unittests/auth/test_auth_handler.py

* Adds github workflow

* minor fix in lite_llm.py for python 3.9.

* format pyproject.toml
2025-04-11 08:25:59 -07:00