[PR #11509] [MERGED] tools: loosen tool argument parsing #18832

Closed
opened 2026-04-16 06:48:24 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/11509
Author: @jmorganca
Created: 7/23/2025
Status: Merged
Merged: 7/24/2025
Merged by: @jmorganca

Base: mainHead: jmorganca/tool-fixes


📝 Commits (1)

  • 5d8d9e8 tools: support arguments before tools, loosten argument requirements

📊 Changes

2 files changed (+78 additions, -244 deletions)

View changed files

📝 tools/tools.go (+50 -75)
📝 tools/tools_test.go (+28 -169)

📄 Description

This PR loosens tool call parsing in two ways:

  1. Allows for arguments ahead of function names
  2. No longer checks required fields, leaving it up to the caller

It tightens parsing in one way: tool calls without arguments such as {"name": "say_hello"} will no longer be parsed. This should be a non use case

Fixes https://github.com/ollama/ollama/issues/11505


🔄 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/11509 **Author:** [@jmorganca](https://github.com/jmorganca) **Created:** 7/23/2025 **Status:** ✅ Merged **Merged:** 7/24/2025 **Merged by:** [@jmorganca](https://github.com/jmorganca) **Base:** `main` ← **Head:** `jmorganca/tool-fixes` --- ### 📝 Commits (1) - [`5d8d9e8`](https://github.com/ollama/ollama/commit/5d8d9e8dfd879b7b06cb611b76cddf3a88bfe8d7) tools: support arguments before tools, loosten argument requirements ### 📊 Changes **2 files changed** (+78 additions, -244 deletions) <details> <summary>View changed files</summary> 📝 `tools/tools.go` (+50 -75) 📝 `tools/tools_test.go` (+28 -169) </details> ### 📄 Description This PR loosens tool call parsing in two ways: 1. Allows for arguments ahead of function names 2. No longer checks required fields, leaving it up to the caller It tightens parsing in one way: tool calls without arguments such as `{"name": "say_hello"}` will no longer be parsed. This should be a non use case Fixes https://github.com/ollama/ollama/issues/11505 --- <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-16 06:48:24 -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#18832