ollama/harmony
Jesse Gross a9d8953ab0 parsers: report the strings that end a response's thinking
A format on a thinking model has to leave the thinking free and constrain
only the content after it, so whatever enforces the format needs to know
where the thinking ends. Today the server guesses whether a parser's
response starts inside thinking from the think value alone, which is wrong
for parsers whose default differs, and it has no way to learn the closing
string at all.

Each parser now answers ThinkingClose after Init: the strings any of which
ends the thinking its response begins with, or none when the response
starts in content because thinking is off, an assistant prefill continues
content, or the parser suppresses thinking for tools. Parsers whose models
open a new message before content end the thinking at that message's
header. Nothing consumes the answer yet.
2026-09-22 11:24:11 -07:00
..
harmonyparser.go parsers: report the strings that end a response's thinking 2026-09-22 11:24:11 -07:00
harmonyparser_test.go fix(docs): correct typos found during code review (#17579) 2026-08-31 08:59:55 -07:00