Commit Graph

11 Commits

Author SHA1 Message Date
Selcuk Gun
41b33d4a0a Move public_utils to utils in tests
Renamed conflicting utils.py as testing_utils.py

PiperOrigin-RevId: 761715808
2025-05-21 16:35:11 -07:00
Selcuk Gun
9e9dfa7472 Prevent session state injection for provider supplied instructions
When the user provides instruction provider, we assume that they will inject the session state parameters if needed. This assumption allows users to return code snippets in the instruction provider without any template replacement.

PiperOrigin-RevId: 759705471
2025-05-16 12:09:48 -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
Selcuk Gun
4c4cfb74ae Support async instruction and global instruction provider
PiperOrigin-RevId: 757808335
2025-05-12 10:03:34 -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
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