Skip to content

Commit 4d875e9

Browse files
authored
fix: gen memory actions only in DynamicPromptMemory (#259)
Signed-off-by: Ettore Di Giacinto <[email protected]>
1 parent 79b72ec commit 4d875e9

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

services/prompts.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,6 @@ func DynamicPrompts(dynamicConfig map[string]string) func(*state.AgentConfig) fu
3636

3737
memoryFilePath := memoryPath(a.Name, dynamicConfig)
3838
promptblocks := []agent.DynamicPrompt{}
39-
_, memory, err := actions.NewMemoryActions(memoryFilePath, dynamicConfig)
40-
if err != nil {
41-
xlog.Error("Error creating memory actions", "error", err)
42-
return promptblocks
43-
}
4439

4540
for _, c := range a.DynamicPrompts {
4641
var config map[string]string
@@ -57,6 +52,8 @@ func DynamicPrompts(dynamicConfig map[string]string) func(*state.AgentConfig) fu
5752
}
5853
promptblocks = append(promptblocks, prompt)
5954
case DynamicPromptMemory:
55+
_, memory, _ := actions.NewMemoryActions(memoryFilePath, dynamicConfig)
56+
6057
promptblocks = append(promptblocks,
6158
prompts.NewMemoryPrompt(config, memory),
6259
)

0 commit comments

Comments
 (0)