server: skip parsing initial <think> if provided in the prompt for /api/generate (#12289)

This commit is contained in:
frob 2025-09-18 01:39:04 +02:00 committed by GitHub
parent 8b894933a7
commit 9b8187b487
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 0 deletions

View File

@ -429,6 +429,9 @@ func (s *Server) GenerateHandler(c *gin.Context) {
OpeningTag: openingTag,
ClosingTag: closingTag,
}
if strings.HasSuffix(strings.TrimSpace(prompt), openingTag) {
thinkingState.AddContent(openingTag)
}
}
}