Enha: handle $rightarrow$
This commit is contained in:
4
bot.go
4
bot.go
@@ -125,8 +125,6 @@ var (
|
|||||||
orModelsData *models.ORModels
|
orModelsData *models.ORModels
|
||||||
)
|
)
|
||||||
|
|
||||||
var thinkBlockRE = regexp.MustCompile(`(?s)<think>.*?</think>`)
|
|
||||||
|
|
||||||
// parseKnownToTag extracts known_to list from content using configured tag.
|
// parseKnownToTag extracts known_to list from content using configured tag.
|
||||||
// Returns cleaned content and list of character names.
|
// Returns cleaned content and list of character names.
|
||||||
func parseKnownToTag(content string) []string {
|
func parseKnownToTag(content string) []string {
|
||||||
@@ -1101,7 +1099,7 @@ out:
|
|||||||
logger.Warn("failed to update storage", "error", err, "name", activeChatName)
|
logger.Warn("failed to update storage", "error", err, "name", activeChatName)
|
||||||
}
|
}
|
||||||
// Strip think blocks before parsing for tool calls
|
// Strip think blocks before parsing for tool calls
|
||||||
respTextNoThink := thinkBlockRE.ReplaceAllString(respText.String(), "")
|
respTextNoThink := models.ThinkRE.ReplaceAllString(respText.String(), "")
|
||||||
if interruptResp.Load() {
|
if interruptResp.Load() {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -178,6 +178,7 @@ func colorText() {
|
|||||||
for i, tb := range thinkBlocks {
|
for i, tb := range thinkBlocks {
|
||||||
text = strings.Replace(text, fmt.Sprintf(placeholderThink, i), tb, 1)
|
text = strings.Replace(text, fmt.Sprintf(placeholderThink, i), tb, 1)
|
||||||
}
|
}
|
||||||
|
text = strings.ReplaceAll(text, `$\rightarrow$`, "->")
|
||||||
textView.SetText(text)
|
textView.SetText(text)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user