Skip to content
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

fix: FunctionAgent and ReActAgent error out when LLM response contains no chat messages #17884

Merged
merged 2 commits into from
Feb 22, 2025

Conversation

masci
Copy link
Member

@masci masci commented Feb 21, 2025

Description

With this PR we handle the case when an LLM returns no chat messages in the response, propagating the right error and setting a fallback default value. Previously the agent would fail on something like this:

UnboundLocalError: cannot access local variable 'r' where it is not associated with a value

Type of Change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Your pull-request will likely not be merged unless it is covered by some form of impactful unit testing.

  • I added new unit tests to cover this change
  • I believe this change is already covered by existing unit tests

@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Feb 21, 2025
Copy link
Contributor

@seldo seldo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@masci masci merged commit b40f82a into main Feb 22, 2025
11 checks passed
@masci masci deleted the massi/take-step-fix branch February 22, 2025 08:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants