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: Check that content is not None before setting to internal_monologue #1813

Merged
merged 2 commits into from
Oct 1, 2024

Conversation

mattzh72
Copy link
Collaborator

@mattzh72 mattzh72 commented Oct 1, 2024

Check that content is not None before setting to internal_monologue. This is causing intermittent errors sometimes with our testing, where sometimes the model does not use the content field:

=========================== short test summary info ============================
FAILED tests/test_tools.py::test_create_agent_tool[client0] - ValueError: Failed to send message: {"detail":"1 validation error for InternalMonologue\ninternal_monologue\n  Input should be a valid string [type=string_type, input_value=None, input_type=NoneType]\n    For further information visit https://errors.pydantic.dev/2.9/v/string_type"}
================== 1 failed, 2 passed, 36 warnings in 16.10s ===================

Additionally, we also search for inner_thoughts in the function args - community members noted that inner thoughts can sometimes appear in function args instead of the content field for function calls.

@mattzh72 mattzh72 requested a review from cpacker October 1, 2024 22:10
Copy link
Collaborator

@cpacker cpacker left a comment

Choose a reason for hiding this comment

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

@mattzh72 can you revise to basically just add a conditional? So remove the added code, and modify the delete code to just be wrapped by a conditional

letta/agent.py Show resolved Hide resolved
letta/agent.py Outdated Show resolved Hide resolved
@mattzh72 mattzh72 requested a review from cpacker October 1, 2024 22:51
Copy link
Collaborator

@cpacker cpacker left a comment

Choose a reason for hiding this comment

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

LGTM!

@cpacker cpacker merged commit 42dbae6 into main Oct 1, 2024
11 checks passed
@cpacker cpacker deleted the matt-fix-bug-content-inner-monologue branch October 1, 2024 23:32
mattzh72 added a commit that referenced this pull request Oct 9, 2024
…gue (#1813)

Co-authored-by: Matt Zhou <mattzhou@Matts-MacBook-Pro.local>
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