[PR #15306] [MERGED] model/parsers: rework gemma4 tool call handling #77403

Closed
opened 2026-05-05 10:04:33 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/15306
Author: @drifkin
Created: 4/3/2026
Status: Merged
Merged: 4/3/2026
Merged by: @drifkin

Base: mainHead: drifkin/gemma4-tool-parsing


📝 Commits (1)

  • c6b78c7 model/parsers: rework gemma4 tool call handling

📊 Changes

2 files changed (+102 additions, -123 deletions)

View changed files

📝 model/parsers/gemma4.go (+20 -121)
📝 model/parsers/gemma4_test.go (+82 -2)

📄 Description

Replace the custom Gemma4 argument normalizer with a stricter reference-style conversion: preserve Gemma-quoted strings, quote bare keys, and then unmarshal the result as JSON.

This keeps quoted scalars as strings, preserves typed unquoted values, and adds test coverage for malformed raw-quoted inputs that the reference implementation rejects.


🔄 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/15306 **Author:** [@drifkin](https://github.com/drifkin) **Created:** 4/3/2026 **Status:** ✅ Merged **Merged:** 4/3/2026 **Merged by:** [@drifkin](https://github.com/drifkin) **Base:** `main` ← **Head:** `drifkin/gemma4-tool-parsing` --- ### 📝 Commits (1) - [`c6b78c7`](https://github.com/ollama/ollama/commit/c6b78c7984ae10e2dc609d916452e7bc834331d7) model/parsers: rework gemma4 tool call handling ### 📊 Changes **2 files changed** (+102 additions, -123 deletions) <details> <summary>View changed files</summary> 📝 `model/parsers/gemma4.go` (+20 -121) 📝 `model/parsers/gemma4_test.go` (+82 -2) </details> ### 📄 Description Replace the custom Gemma4 argument normalizer with a stricter reference-style conversion: preserve Gemma-quoted strings, quote bare keys, and then unmarshal the result as JSON. This keeps quoted scalars as strings, preserves typed unquoted values, and adds test coverage for malformed raw-quoted inputs that the reference implementation rejects. --- <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-05-05 10:04:33 -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#77403