[PR #13990] [CLOSED] docs: add truncate parameter to generate and chat endpoints #45714

Closed
opened 2026-04-25 01:22:28 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/13990
Author: @Sean-Kenneth-Doherty
Created: 1/31/2026
Status: Closed

Base: mainHead: docs/add-truncate-parameter


📝 Commits (1)

  • 4e5639e docs: add truncate parameter to generate and chat endpoints

📊 Changes

1 file changed (+2 additions, -0 deletions)

View changed files

📝 docs/api.md (+2 -0)

📄 Description

Description

Document the truncate parameter for /api/generate and /api/chat endpoints. This parameter controls whether the prompt/chat history is truncated when it exceeds the context length limit.

The parameter is already implemented in GenerateRequest and ChatRequest, and used in both endpoints, but was only documented for /api/embed.

Changes

  • Added truncate parameter documentation to the Generate endpoint's advanced parameters section
  • Added truncate parameter documentation to the Chat endpoint's advanced parameters section

Fixes #13959


🔄 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/13990 **Author:** [@Sean-Kenneth-Doherty](https://github.com/Sean-Kenneth-Doherty) **Created:** 1/31/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `docs/add-truncate-parameter` --- ### 📝 Commits (1) - [`4e5639e`](https://github.com/ollama/ollama/commit/4e5639e86f34e3a5847e59e238b4ede46535ba73) docs: add truncate parameter to generate and chat endpoints ### 📊 Changes **1 file changed** (+2 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `docs/api.md` (+2 -0) </details> ### 📄 Description ## Description Document the `truncate` parameter for `/api/generate` and `/api/chat` endpoints. This parameter controls whether the prompt/chat history is truncated when it exceeds the context length limit. The parameter is already implemented in [`GenerateRequest`](https://github.com/ollama/ollama/blob/main/api/types.go#L107-L113) and [`ChatRequest`](https://github.com/ollama/ollama/blob/main/api/types.go#L173-L177), and used in both endpoints, but was only documented for `/api/embed`. ## Changes - Added `truncate` parameter documentation to the Generate endpoint's advanced parameters section - Added `truncate` parameter documentation to the Chat endpoint's advanced parameters section Fixes #13959 --- <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-25 01:22:28 -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#45714