Skip to content

Conversation

@RashRAJ
Copy link
Contributor

@RashRAJ RashRAJ commented Apr 18, 2025

This PR improves the resilience of the _process_function_live_helper method by ensuring that inspect.isasyncgenfunction(tool.func) is only called when the tool object actually has a func attribute.

In current usage, when an agent is wrapped as a tool (e.g., AgentTool) and passed to run_live, it results in an AttributeError because AgentTool does not define .func. This fix adds a simple hasattr(tool, "func") guard to ensure compatibility with both FunctionTool and AgentTool types.

This change improves robustness without affecting functionality for tools that do include a func field.

@google-cla
Copy link

google-cla bot commented Apr 18, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@hangfei hangfei added the ready to pull [Status] This PR is ready to be importing back to Google label Apr 18, 2025
@hangfei hangfei merged commit daed456 into google:main Apr 18, 2025
4 checks passed
coder-aditi pushed a commit to coder-aditi/adk-python that referenced this pull request Jul 2, 2025
Co-authored-by: Hangfei Lin <hangfei@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready to pull [Status] This PR is ready to be importing back to Google

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants