这是indexloc提供的服务,不要输入任何密码
Skip to content

tool calling issues #712

@jakobhoeg

Description

@jakobhoeg

Based on this list of tool-calling models, only the Hermes-2-Pro-Mistral-7B-q4f16_1-MLC model actually outputs proper JSON.
The other models always just output an empty array: []. This is also happening in your function calling example.

However, the "working" model ALWAYS outputs structured JSON (tries to call a tool) even if the user message doesn't explicitly prompts it to.
It also always disregards the tool_choice set. Also even if it is set to none, it will always output structured data.

To replicate this, you can run the function-calling-openai example. The specified model will always output []. Change it to Hermes-2-Pro-Mistral-7B-q4f16_1-MLC and it will always output structured data, even if the user message is changed to something like Hey and the tool_choice is set to none.

Maybe we could remove the manual checks and just allow tool calling for all models?
For instance reasoning models (such as Qwen3) are particularly good at executing tool calls, and it's a shame that we don't allow using those models for it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions