Skip to content

Conversation

@Mishusha
Copy link

This PR adds a tool parser for parsing the function calls made by the Gigachat 3 models.
Models can generate only one function call using format:

{text}<|message_sep|>\n\nfunction call<|role_sep|>\n{json}
Where <|message_sep|>\n\n and <|role_sep|>\n are special tokens.

@aldehir
Copy link
Collaborator

aldehir commented Dec 12, 2025

We should start transitioning to the PEG parser approach. This one looks very similar to the new mistral-3 series, there is already a parser out there to reference. The difference is you'll need to match the name within the JSON instead of outside of it, but it should be easy with the schema(), json() and json_member() helpers.

Copy link
Collaborator

@pwilkin pwilkin left a comment

Choose a reason for hiding this comment

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

Like @aldehir mentioned, please use the PEG parser for the implementation, we are phasing out the old parser. If you need an example, check out the Ministral 3 template.

@Mishusha
Copy link
Author

Got it, thanks, I took it to work)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testing Everything test related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants