[PR #5824] [MERGED] server: collect nested tool call objects when parsing #11936

Closed
opened 2026-04-12 23:43:02 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/5824
Author: @jmorganca
Created: 7/21/2024
Status: Merged
Merged: 7/22/2024
Merged by: @jmorganca

Base: mainHead: jmorganca/collect-tools


📝 Commits (10+)

📊 Changes

5 files changed (+120 additions, -13 deletions)

View changed files

📝 server/model.go (+32 -11)
📝 server/model_test.go (+1 -0)
📝 server/routes.go (+2 -2)
server/testdata/tools/xlam.gotmpl (+45 -0)
server/testdata/tools/xlam.out (+40 -0)

📄 Description

This changes tool calling to handle the output format:

{
    "tool_calls": [
        {"name": "func_name1", "arguments": {"argument1": "value1", "argument2": "value2"}},
        ... (more tool calls as required)
    ]
}

To support

https://huggingface.co/Salesforce/xLAM-1b-fc-r
https://huggingface.co/Salesforce/xLAM-7b-fc-r

and future models that may have tool call objects nested in others


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama/pull/5824 **Author:** [@jmorganca](https://github.com/jmorganca) **Created:** 7/21/2024 **Status:** ✅ Merged **Merged:** 7/22/2024 **Merged by:** [@jmorganca](https://github.com/jmorganca) **Base:** `main` ← **Head:** `jmorganca/collect-tools` --- ### 📝 Commits (10+) - [`45417e4`](https://github.com/ollama/ollama/commit/45417e4b0e853c96cfbcf8377da620ab8225957c) server: collect nested tool call objects when parsing - [`72ba263`](https://github.com/ollama/ollama/commit/72ba263a4fc4865a9c931a6926592f64c0f7ea93) remove workaround - [`45c3963`](https://github.com/ollama/ollama/commit/45c396310d914de7971e6934bdb8537ecdb6972d) address comments - [`e8b3d3f`](https://github.com/ollama/ollama/commit/e8b3d3f432f6d7172b4a92beea41c01193e34dc8) fix tests - [`06587c9`](https://github.com/ollama/ollama/commit/06587c97a410a067c8924161559ecd5cd749c5e5) revert submodule change - [`063eaf8`](https://github.com/ollama/ollama/commit/063eaf8667de4f6635f183f96e35f6d086ccfd14) closer - [`94eef55`](https://github.com/ollama/ollama/commit/94eef552f30b32462b2a619227836cb492842472) better template - [`5dc5e40`](https://github.com/ollama/ollama/commit/5dc5e40de3fdc21e096f28ef2f2ea2f1c0c5e4b9) remove debug logs for now - [`f76f649`](https://github.com/ollama/ollama/commit/f76f64930155823ae7c217e9d5576ad9ef7723f7) condense var names - [`473b9ca`](https://github.com/ollama/ollama/commit/473b9cadb30c5bd96fbce6045f79d676f3b2ea01) remove `-` ### 📊 Changes **5 files changed** (+120 additions, -13 deletions) <details> <summary>View changed files</summary> 📝 `server/model.go` (+32 -11) 📝 `server/model_test.go` (+1 -0) 📝 `server/routes.go` (+2 -2) ➕ `server/testdata/tools/xlam.gotmpl` (+45 -0) ➕ `server/testdata/tools/xlam.out` (+40 -0) </details> ### 📄 Description This changes tool calling to handle the output format: ``` { "tool_calls": [ {"name": "func_name1", "arguments": {"argument1": "value1", "argument2": "value2"}}, ... (more tool calls as required) ] } ``` To support https://huggingface.co/Salesforce/xLAM-1b-fc-r https://huggingface.co/Salesforce/xLAM-7b-fc-r and future models that may have tool call objects nested in others --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-12 23:43:02 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#11936