[PR #6188] [CLOSED] Allow singular array for CompletionRequest prompt field #74342

Closed
opened 2026-05-05 06:23:02 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/6188
Author: @igor-drozdov
Created: 8/5/2024
Status: Closed

Base: mainHead: id-allow-list-for-prompt


📝 Commits (1)

  • 1477d62 Allow singular array for CompletionRequest prompt field

📊 Changes

2 files changed (+90 additions, -2 deletions)

View changed files

📝 openai/openai.go (+20 -2)
📝 openai/openai_test.go (+70 -0)

📄 Description

Overview

OpenAI v1/completions to handle []string, []int and [][]int, in addition to just a string according to https://platform.openai.com/docs/api-reference/completions/create#completions-create-prompt

Also some aggregators (like litellm) send a list of prompts as a prompt: https://github.com/ollama/ollama/issues/5259#issuecomment-2242611375

This PR allows sending singular arrays as the prompt field.


🔄 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/6188 **Author:** [@igor-drozdov](https://github.com/igor-drozdov) **Created:** 8/5/2024 **Status:** ❌ Closed **Base:** `main` ← **Head:** `id-allow-list-for-prompt` --- ### 📝 Commits (1) - [`1477d62`](https://github.com/ollama/ollama/commit/1477d629e932ab0629a9051294cbc8ce8d1af2c3) Allow singular array for CompletionRequest prompt field ### 📊 Changes **2 files changed** (+90 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `openai/openai.go` (+20 -2) 📝 `openai/openai_test.go` (+70 -0) </details> ### 📄 Description ## Overview OpenAI `v1/completions` to handle `[]string`, `[]int` and `[][]int`, in addition to just a `string` according to https://platform.openai.com/docs/api-reference/completions/create#completions-create-prompt Also some aggregators (like litellm) send a list of prompts as a prompt: https://github.com/ollama/ollama/issues/5259#issuecomment-2242611375 This PR allows sending singular arrays as the `prompt` field. --- <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 06:23: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#74342