Spaces:
Paused
Paused
File size: 509 Bytes
8d1819a |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
from python.helpers.memory import Memory
from python.helpers.tool import Tool, Response
class MemorySave(Tool):
async def execute(self, text="", area="", **kwargs):
if not area:
area = Memory.Area.MAIN.value
metadata = {"area": area, **kwargs}
db = await Memory.get(self.agent)
id = await db.insert_text(text, metadata)
result = self.agent.read_prompt("fw.memory_saved.md", memory_id=id)
return Response(message=result, break_loop=False)
|