Add long term memory
This commit is contained in:
@@ -68,6 +68,7 @@ func (a *Agent) decision(
|
||||
Tools: tools,
|
||||
ToolChoice: toolchoice,
|
||||
}
|
||||
|
||||
resp, err := a.client.CreateChatCompletion(ctx, decision)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -96,6 +97,14 @@ func (m Messages) ToOpenAI() []openai.ChatCompletionMessage {
|
||||
return []openai.ChatCompletionMessage(m)
|
||||
}
|
||||
|
||||
func (m Messages) String() string {
|
||||
s := ""
|
||||
for _, cc := range m {
|
||||
s += cc.Role + ": " + cc.Content + "\n"
|
||||
}
|
||||
return s
|
||||
}
|
||||
|
||||
func (m Messages) Exist(content string) bool {
|
||||
for _, cc := range m {
|
||||
if cc.Content == content {
|
||||
|
||||
Reference in New Issue
Block a user