Do not summarize if nothing is in memory

This commit is contained in:
mudler
2024-12-17 19:55:21 +01:00
parent 1900915609
commit 0fc09b4f49

View File

@@ -181,7 +181,7 @@ func (a *Agent) ResetConversation() {
if a.options.enableLongTermMemory {
xlog.Info("Saving conversation", "agent", a.Character.Name, "conversation size", len(a.currentConversation))
if a.options.enableSummaryMemory {
if a.options.enableSummaryMemory && len(a.currentConversation) > 0 {
msg, err := a.askLLM(a.context.Context, []openai.ChatCompletionMessage{{
Role: "user",