Fix LongCat tool call parsing for tool_choice='auto'#1
Open
fstandhartinger wants to merge 1 commit intochutesai:chutesfrom
Open
Fix LongCat tool call parsing for tool_choice='auto'#1fstandhartinger wants to merge 1 commit intochutesai:chutesfrom
fstandhartinger wants to merge 1 commit intochutesai:chutesfrom
Conversation
LongCat models were not properly constrained for tool calls when tool_choice='auto' (default), only working with tool_choice='required'. This caused tool calls to be generated but not parsed correctly. The fix ensures LongCat models get EBNF constraints even for 'auto' mode, eliminating the need to manually set tool_choice='required'.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
LongCat models were not properly constrained for tool calls when
tool_choice='auto'(default), only working withtool_choice='required'. This caused tool calls to be generated but not parsed correctly.Solution
Modified the constraint logic in
function_call_parser.pyto ensure LongCat models get EBNF constraints even fortool_choice='auto', eliminating the need to manually settool_choice='required'.Changes
self.tool_call_parserinstance variable to track parser typeget_structure_constraint()to include LongCat + 'auto' in EBNF eligibilityget_ebnf()methodTesting
The fix ensures LongCat models work correctly with default settings.