Rename embedchain to mem0 and open sourcing code for long term memory (#1474)
Co-authored-by: Deshraj Yadav <deshrajdry@gmail.com>
This commit is contained in:
14
mem0/memory/utils.py
Normal file
14
mem0/memory/utils.py
Normal file
@@ -0,0 +1,14 @@
|
||||
from mem0.configs.prompts import UPDATE_MEMORY_PROMPT
|
||||
|
||||
|
||||
def get_update_memory_prompt(existing_memories, memory, template=UPDATE_MEMORY_PROMPT):
|
||||
return template.format(existing_memories=existing_memories, memory=memory)
|
||||
|
||||
|
||||
def get_update_memory_messages(existing_memories, memory):
|
||||
return [
|
||||
{
|
||||
"role": "user",
|
||||
"content": get_update_memory_prompt(existing_memories, memory),
|
||||
},
|
||||
]
|
||||
Reference in New Issue
Block a user