Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 non-function calls messages #5026
Fix non-function calls messages #5026
Changes from all commits
da5fca6
ba1791a
4a31c6f
2ea1297
ffca2b4
f6e70f5
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will only be True for the selected set of model -- but we still send messages WITH tool_ids to the LLM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh so we need the part of the serializer that adds tool_call_id. OK, sure, I'll revert that. Sigh, this is messy. The attempt to separate things when function calling is native is because we need to send a single thing, not a list.
(I'll follow up on litellm too, they actually do this kind of conversion, so we don't have to play whack-a-mole anymore)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xingyaoww I actually restored this check, but it does send tool ids now. It just sends them as string, if non-native function calling, and as list if native. (because this applies now)
I started to work on refactoring the Message class. I think it needs to include tool calls/ids conversion part (at least as a single Message), do full serialization, and become closer to litellm's Message. I started to work on it on this branch, but in the meantime, I found out that people rely on this PR, and use it via docker because it solves what's broken with non-native function calling.
So I'll make another branch to work on the refactoring, and this PR is up for review again. If it's not too terrible, I'd say let's just fix the problems first, and refactor later.
(I'll clean up some leftover comment, too, but I prefer to do it if it's approved, because I think it would again break people's use via docker on the last commit.)