Skip to content

Fix Bug: stop filtering events that contain function responses #2152

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

alimosaed
Copy link

What is the problem?
As part of the preparation for an LLM call, the ADK will look through the session’s event list to create the LLM message history. As part of this, it filters out all events that don’t have any content or roles. Additionally, it will filter out any events that don’t have any text. Unfortunately, there are cases where there are events that just contain the function_response. These events are filtered mistakenly as well.

How did we fix this problem?
We've updated the event filtering condition to cover events that contain function_response.

How to reproduce this problem?
A sample script has been attached. It creates a user, llm and tool event. The tool is a simple function call that returns only the function_response. This event is filtered via ADK.

Reproduce the bug

Copy link

google-cla bot commented Jul 24, 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.

@ankursharmas
Copy link
Collaborator

This is an intentional choice to filter out function calls and responses of previous events. But this doesn't mean that the function responses were never provided to the model. For a function call triggered by the model, the response was provided to it, only for previous events these get hidden.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants