Ollama chat stream Newline #140

Open
opened 2026-02-15 16:28:15 -05:00 by yindo · 1 comment
Owner

Originally created by @kikoferrer on GitHub (Sep 9, 2024).

Hi guys,

I am wondering if the streaming of ollama.chat also produces newline? I created program that streams the message via api and received at the other end in javascript fetch. The problem is it is not formatting the response with newlines even if I ask it to seperate into paragraphs. I am wondering if ollama.chat(stream=True) does not produce newline characters.

Originally created by @kikoferrer on GitHub (Sep 9, 2024). Hi guys, I am wondering if the streaming of ollama.chat also produces newline? I created program that streams the message via api and received at the other end in javascript fetch. The problem is it is not formatting the response with newlines even if I ask it to seperate into paragraphs. I am wondering if ollama.chat(stream=True) does not produce newline characters.
Author
Owner

@ASKonovalov commented on GitHub (Dec 4, 2024):

Try for tag style='white-space: pre-wrap'

@ASKonovalov commented on GitHub (Dec 4, 2024): Try for tag style='white-space: pre-wrap'
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ollama/ollama-python#140