refactor: refactor from ChatflowHistoryService and ChatflowMemoryService

This commit is contained in:
Stream
2025-08-22 17:44:27 +08:00
parent 4d2fc66a8d
commit 8b68020453
5 changed files with 310 additions and 511 deletions

View File

@ -761,9 +761,9 @@ def _fetch_memory_blocks(workflow: Workflow, conversation_id: str, is_draft: boo
is_draft=is_draft,
)
for memory in memories:
if memory.scope == MemoryScope.APP:
memory_blocks[memory.memory_id] = memory.value
if memory.spec.scope == MemoryScope.APP:
memory_blocks[memory.spec.id] = memory.value
else: # NODE scope
memory_blocks[f"{memory.node_id}.{memory.memory_id}"] = memory.value
memory_blocks[f"{memory.node_id}.{memory.spec.id}"] = memory.value
return memory_blocks