[PR #13959] docs: add truncate parameter to generate and chat endpoints #76749

Open
opened 2026-05-05 09:24:29 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/13959
Author: @damz
Created: 1/28/2026
Status: 🔄 Open

Base: mainHead: pr/truncate-api-docs


📝 Commits (1)

  • f216ee3 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

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.

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


🔄 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/13959 **Author:** [@damz](https://github.com/damz) **Created:** 1/28/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `pr/truncate-api-docs` --- ### 📝 Commits (1) - [`f216ee3`](https://github.com/ollama/ollama/commit/f216ee35929eff8be4279d19a3b483180d02a744) 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 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. The parameter is already implemented in [`GenerateRequest`](https://github.com/ollama/ollama/blob/7b62c410605a915e68e44a696f0b2289d1da09eb/api/types.go#L111-L113) and [`ChatRequest`](https://github.com/ollama/ollama/blob/7b62c410605a915e68e44a696f0b2289d1da09eb/api/types.go#L175-L177), and used in the [generate](https://github.com/ollama/ollama/blob/7b62c410605a915e68e44a696f0b2289d1da09eb/server/routes.go#L530) and [chat](https://github.com/ollama/ollama/blob/7b62c410605a915e68e44a696f0b2289d1da09eb/server/routes.go#L2151) endpoints, but only documented for `/api/embed`. --- <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 09:24:29 -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#76749