diff --git a/agent/agent.go b/agent/agent.go index d86d279..117b41d 100644 --- a/agent/agent.go +++ b/agent/agent.go @@ -30,7 +30,7 @@ type Agent struct { currentReasoning string currentState *action.StateResult nextAction Action - currentConversation []openai.ChatCompletionMessage + currentConversation Messages selfEvaluationInProgress bool newConversations chan openai.ChatCompletionMessage @@ -392,7 +392,7 @@ func (a *Agent) consumeJob(job *Job, role string) { job.Result.Finish(fmt.Errorf("error renderTemplate: %w", err)) return } - if !Messages(a.currentConversation).Exist(prompt) { + if !a.currentConversation.Exist(prompt) { a.currentConversation = append([]openai.ChatCompletionMessage{ { Role: "system", diff --git a/example/webui/elements.go b/example/webui/elements.go index df2b2a0..a3a1bd2 100644 --- a/example/webui/elements.go +++ b/example/webui/elements.go @@ -3,5 +3,17 @@ package main import "fmt" func chatDiv(content string, color string) string { - return fmt.Sprintf(`