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

Bugfix: Web surfer creating incomplete copy of messages #4050

Open
wants to merge 3 commits into
base: 0.2
Choose a base branch
from

Conversation

Hedrekao
Copy link

@Hedrekao Hedrekao commented Nov 4, 2024

Why are these changes needed?

Previously, generate_surfer_reply would create not a full copy of messages, it would not include the last one. This is behaviour would result in openai.BadRequestError exception, if the last message was a tool message.

image

The openAI client expects that for each assistant message with tool_call, a tool message with corresponding tool_call_id has to exist in passed messages. In the edge case where tool call response was the last message in history, web surfer agent was excluding it, which lead to showcased exception.

Once the slice operates on entire list, the issue disappears.

Related issue number

N/A

Checks

@ekzhu ekzhu requested a review from afourney November 4, 2024 15:20
@ekzhu ekzhu added the 0.2 Issues which were filed before re-arch to 0.4 label Nov 4, 2024
@ekzhu
Copy link
Collaborator

ekzhu commented Nov 12, 2024

@afourney Do you remember why we don't include the last message?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.2 Issues which were filed before re-arch to 0.4
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants