Commit Graph

5 Commits

Author SHA1 Message Date
Google Team Member 114db93d70 ADK changes
PiperOrigin-RevId: 794403729
2025-08-12 22:29:23 -07:00
Hangfei Lin e2518dc371 fix: Ignore AsyncGenerator return types in function declarations
For Vertex model backend, we send response back. This doesn't work for streaming tools that the return type is AsyncGenerator. So the fix here is to ignore the return type when it's AsyncGenerator.

We can't distinguish streaming vs non-streaming tool with AsyncGenerator though as LiveRequestQueue is optional in streaming tool.

Adds an `ignore_response` option to `build_function_declaration` to skip including the return type in the function declaration. This is enabled for tools that return `AsyncGenerator`, as the model does not yet support understanding these return types, while streaming tools can still handle them. Also, removes redundant return statements in `_get_mandatory_params`.

PiperOrigin-RevId: 794392846
2025-08-12 21:45:52 -07:00
Xiang (Sean) Zhou 927c75f0ee chore: Replace imports by importing from actual module instead of from package (__init__.py)
PiperOrigin-RevId: 786342250
2025-07-23 10:49:43 -07:00
Hangfei Lin 0ec69d05a4 feat: Enhance LangchainTool to accept more forms of functions
Now the LangchainTool can wrap:

* Langchain StructuredTool (sync and async).
* Langchain @Tool (sync and async).

This enhance the flexibility for user and enables async functionalities.

PiperOrigin-RevId: 784728061
2025-07-18 15:56:17 -07:00
Xiang (Sean) Zhou 7e637d3fa0 feat: support Langchain StructuredTool for Langchain tool
for fixing: https://github.com/google/adk-python/issues/707

PiperOrigin-RevId: 764781197
2025-05-29 11:48:15 -07:00