Fix thinking formatting
This commit is contained in:
@@ -123,18 +123,24 @@ func (m *Model) renderMessage(i int) string {
|
|||||||
hasReasoning := msg.ReasoningContent != ""
|
hasReasoning := msg.ReasoningContent != ""
|
||||||
|
|
||||||
if hasReasoning {
|
if hasReasoning {
|
||||||
_ = m.App.Ctx.Chroma.Highlight(sb, "<thinking>\n")
|
_ = m.App.Ctx.Chroma.Highlight(sb, "<thinking>")
|
||||||
|
sb.WriteString("\n")
|
||||||
|
var reasoningContent string
|
||||||
if m.showDetails {
|
if m.showDetails {
|
||||||
//_ = m.App.Ctx.Chroma.Highlight(sb, msg.ReasoningContent)
|
//_ = m.App.Ctx.Chroma.Highlight(sb, msg.ReasoningContent)
|
||||||
sb.WriteString(faintStyle.Render(msg.ReasoningContent))
|
reasoningContent = msg.ReasoningContent
|
||||||
} else {
|
} else {
|
||||||
sb.WriteString(faintStyle.Render("..."))
|
reasoningContent = "..."
|
||||||
}
|
}
|
||||||
if m.state == pendingResponse && isLast && isAssistant && msg.Content == "" {
|
if m.state == pendingResponse && isLast && isAssistant && msg.Content == "" {
|
||||||
// Show the assistant's cursor
|
// Show the assistant's cursor
|
||||||
sb.WriteString(m.replyCursor.View())
|
reasoningContent = reasoningContent + m.replyCursor.View()
|
||||||
}
|
}
|
||||||
_ = m.App.Ctx.Chroma.Highlight(sb, "\n</thinking>")
|
sb.WriteString(faintStyle.Render(reasoningContent))
|
||||||
|
if reasoningContent[len(reasoningContent)-1] != '\n' {
|
||||||
|
sb.WriteString("\n")
|
||||||
|
}
|
||||||
|
_ = m.App.Ctx.Chroma.Highlight(sb, "</thinking>")
|
||||||
}
|
}
|
||||||
|
|
||||||
if msg.Content != "" {
|
if msg.Content != "" {
|
||||||
|
|||||||
Reference in New Issue
Block a user