[PR #11759] [MERGED] openai: allow for content _and_ tool calls in the same message #60315

Closed
opened 2026-04-29 15:14:32 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/11759
Author: @drifkin
Created: 8/6/2025
Status: Merged
Merged: 8/6/2025
Merged by: @drifkin

Base: mainHead: drifkin/oai-tool-calling


📝 Commits (1)

  • 203c137 openai: allow for content and tool calls in the same message

📊 Changes

2 files changed (+67 additions, -1 deletions)

View changed files

📝 openai/openai.go (+28 -1)
📝 openai/openai_test.go (+39 -0)

📄 Description

Previously our OpenAI chat completions compat layer assumed that tool calls and content would never be provided together, but this is not a correct assumption. Content is only optional when tool calls are present, but tool calls and content can be provided together

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


🔄 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/11759 **Author:** [@drifkin](https://github.com/drifkin) **Created:** 8/6/2025 **Status:** ✅ Merged **Merged:** 8/6/2025 **Merged by:** [@drifkin](https://github.com/drifkin) **Base:** `main` ← **Head:** `drifkin/oai-tool-calling` --- ### 📝 Commits (1) - [`203c137`](https://github.com/ollama/ollama/commit/203c137810846865f6358b25c8937bc4b55dfda4) openai: allow for content _and_ tool calls in the same message ### 📊 Changes **2 files changed** (+67 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `openai/openai.go` (+28 -1) 📝 `openai/openai_test.go` (+39 -0) </details> ### 📄 Description Previously our OpenAI chat completions compat layer assumed that tool calls and content would never be provided together, but this is not a correct assumption. Content is only optional when tool calls are present, but tool calls and content can be provided together Fixes: https://github.com/ollama/ollama/issues/11704 --- <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-29 15:14:32 -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#60315