[PR #1614] [MERGED] fix: set template without triple quotes #36500

Closed
opened 2026-04-22 21:07:50 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/1614
Author: @mxyng
Created: 12/19/2023
Status: Merged
Merged: 1/9/2024
Merged by: @mxyng

Base: mainHead: mxyng/fix-set-template


📝 Commits (1)

  • 5580ae2 fix: set template without triple quotes

📊 Changes

1 file changed (+67 additions, -55 deletions)

View changed files

📝 cmd/interactive.go (+67 -55)

📄 Description

this changes updates /set to better handle multiline strings. /set now correctly sets template or system without using triple quotes

>>> /set template {{ .Prompt }}
Set prompt template.

additionally, use a strings.Builder instead of concatenating string values for prompt building

>>> """hello
... world"""
>>> """
... hello
... world
... """
>>> /set system """
... you are a llama
... """
>>> /set template """
... {{.System}}
... User: {{.Prompt}}
... Assistant: {{.Response}}
... """

resolves #1609
resolves #1607


🔄 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/1614 **Author:** [@mxyng](https://github.com/mxyng) **Created:** 12/19/2023 **Status:** ✅ Merged **Merged:** 1/9/2024 **Merged by:** [@mxyng](https://github.com/mxyng) **Base:** `main` ← **Head:** `mxyng/fix-set-template` --- ### 📝 Commits (1) - [`5580ae2`](https://github.com/ollama/ollama/commit/5580ae2472f982db5c3aae1433a02a56e0b967ec) fix: set template without triple quotes ### 📊 Changes **1 file changed** (+67 additions, -55 deletions) <details> <summary>View changed files</summary> 📝 `cmd/interactive.go` (+67 -55) </details> ### 📄 Description this changes updates `/set` to better handle multiline strings. `/set` now correctly sets template or system without using triple quotes ``` >>> /set template {{ .Prompt }} Set prompt template. ``` additionally, use a strings.Builder instead of concatenating string values for prompt building ``` >>> """hello ... world""" ``` ``` >>> """ ... hello ... world ... """ ``` ``` >>> /set system """ ... you are a llama ... """ ``` ``` >>> /set template """ ... {{.System}} ... User: {{.Prompt}} ... Assistant: {{.Response}} ... """ ``` resolves #1609 resolves #1607 --- <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-22 21:07:50 -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#36500