Skip to content

tool call parsing broken when arguments precede function name #11505

@ghost

Description

What is the issue?

Until this change in v0.9.6, tool call parsing would parse arguments that came before the function name (like: {"arguments": {"arg1": "1"}, "name": "my_function"}).

Some models like granite3.2:8b and granite3.3:8b tend to call tools in this format. This is an unexpected change since it was previously working in v0.9.2.

Relevant log output

Here's a tool call from granite3.3:8b that previously worked but is now causing the issue:

"<|tool_call|>[{\"arguments\": {\"md\": \"| Month    | Savings   |\\n|----------|------------|\\n| January  | $250       |\\n| February | $80        |\\n| March    | $420       |\"}, \"name\": \"from_markdown\"}]"

OS

macOS

GPU

No response

CPU

Intel

Ollama version

tested with v0.9.6 and v0.9.2

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions