新对话重置系统提示词为文件内容

This commit is contained in:
2026-08-14 20:37:51 +08:00
parent dfc649f08e
commit 358299a5cc
2 changed files with 6 additions and 2 deletions
+4 -1
View File
@@ -139,9 +139,12 @@ func (b *Bot) Tools() []string {
return b.toolRegistry.List()
}
// ClearHistory 清空内存中的会话历史,开启新对话系统提示词保留)
// ClearHistory 清空内存中的会话历史,开启新对话系统提示词重置为配置加载的文件内容
func (b *Bot) ClearHistory() {
b.history = nil
if b.cfg != nil {
b.systemPrompt = b.cfg.SystemPrompt
}
}
func (b *Bot) ContextWindow() int64 {