server: skip parsing initial <think> if provided in the prompt (#12024)

This commit is contained in:
Jeffrey Morgan
2025-08-22 12:00:16 -07:00
committed by GitHub
parent 109d4fc3b4
commit 4be4dc8717
2 changed files with 234 additions and 0 deletions

View File

@@ -1673,6 +1673,10 @@ func (s *Server) ChatHandler(c *gin.Context) {
OpeningTag: openingTag,
ClosingTag: closingTag,
}
if strings.HasSuffix(strings.TrimSpace(prompt), openingTag) {
thinkingState.AddContent(openingTag)
}
}
var toolParser *tools.Parser