Enha: handle $rightarrow$

This commit is contained in:
Grail Finder
2026-04-11 11:06:38 +03:00
parent cdc237c81c
commit 556eab9d89
2 changed files with 2 additions and 3 deletions

4
bot.go
View File

@@ -125,8 +125,6 @@ var (
orModelsData *models.ORModels
)
var thinkBlockRE = regexp.MustCompile(`(?s)<think>.*?</think>`)
// parseKnownToTag extracts known_to list from content using configured tag.
// Returns cleaned content and list of character names.
func parseKnownToTag(content string) []string {
@@ -1101,7 +1099,7 @@ out:
logger.Warn("failed to update storage", "error", err, "name", activeChatName)
}
// Strip think blocks before parsing for tool calls
respTextNoThink := thinkBlockRE.ReplaceAllString(respText.String(), "")
respTextNoThink := models.ThinkRE.ReplaceAllString(respText.String(), "")
if interruptResp.Load() {
return nil
}

View File

@@ -178,6 +178,7 @@ func colorText() {
for i, tb := range thinkBlocks {
text = strings.Replace(text, fmt.Sprintf(placeholderThink, i), tb, 1)
}
text = strings.ReplaceAll(text, `$\rightarrow$`, "->")
textView.SetText(text)
}