[PR #15105] [MERGED] anthropic: fix empty inputs in content blocks #20298

Closed
opened 2026-04-16 07:32:35 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

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

Base: mainHead: drifkin/empty-input


📝 Commits (2)

  • 7798dff anthropic: fix empty inputs in content blocks
  • 3a212e9 use omitzero instead

📊 Changes

2 files changed (+114 additions, -4 deletions)

View changed files

📝 anthropic/anthropic.go (+2 -3)
📝 anthropic/anthropic_test.go (+112 -1)

📄 Description

When we switched to api.ToolCallFunctionArguments, omitempty stopped doing what we were relying on it for before. This would cause non-tool content blocks to have an "input": {} field, which doesn't match our old behavior.


🔄 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/15105 **Author:** [@drifkin](https://github.com/drifkin) **Created:** 3/27/2026 **Status:** ✅ Merged **Merged:** 3/27/2026 **Merged by:** [@drifkin](https://github.com/drifkin) **Base:** `main` ← **Head:** `drifkin/empty-input` --- ### 📝 Commits (2) - [`7798dff`](https://github.com/ollama/ollama/commit/7798dffffcab19700a19d91df3051401155bf882) anthropic: fix empty inputs in content blocks - [`3a212e9`](https://github.com/ollama/ollama/commit/3a212e9bc9158ce8f5294ef544ec12fadd734619) use omitzero instead ### 📊 Changes **2 files changed** (+114 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `anthropic/anthropic.go` (+2 -3) 📝 `anthropic/anthropic_test.go` (+112 -1) </details> ### 📄 Description When we switched to `api.ToolCallFunctionArguments`, `omitempty` stopped doing what we were relying on it for before. This would cause non-tool content blocks to have an `"input": {}` field, which doesn't match our old behavior. --- <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 07:32:35 -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#20298