diff --git a/api/controllers/web/chatflow_memory.py b/api/controllers/web/chatflow_memory.py index 5969d66bcf..276d6d3b83 100644 --- a/api/controllers/web/chatflow_memory.py +++ b/api/controllers/web/chatflow_memory.py @@ -20,7 +20,6 @@ class MemoryListApi(WebApiResource): memory_id = args.get("memory_id") version = args.get("version") - if conversation_id: result = ChatflowMemoryService.get_persistent_memories_with_conversation( app_model, diff --git a/api/core/memory/entities.py b/api/core/memory/entities.py index 88602142b3..3914be218d 100644 --- a/api/core/memory/entities.py +++ b/api/core/memory/entities.py @@ -103,7 +103,7 @@ class MemoryBlockWithConversation(MemoryBlock): cls, memory_block: MemoryBlock, conversation_metadata: ChatflowConversationMetadata - ) -> "MemoryBlockWithConversation": + ) -> MemoryBlockWithConversation: """Create MemoryBlockWithConversation from MemoryBlock""" return cls( spec=memory_block.spec, diff --git a/api/models/chatflow_memory.py b/api/models/chatflow_memory.py index b02b809cd7..92010aeba4 100644 --- a/api/models/chatflow_memory.py +++ b/api/models/chatflow_memory.py @@ -67,7 +67,7 @@ class ChatflowMessage(Base): id: Mapped[str] = mapped_column(StringUUID, primary_key=True, server_default=sa.text("uuid_generate_v4()")) conversation_id: Mapped[str] = mapped_column(StringUUID, nullable=False) - index: Mapped[int] = mapped_column(sa.Integer, nullable=False) # This index starts from 0 + index: Mapped[int] = mapped_column(sa.Integer, nullable=False) # This index starts from 0 version: Mapped[int] = mapped_column(sa.Integer, nullable=False) data: Mapped[str] = mapped_column(sa.Text, nullable=False) # Serialized PromptMessage JSON created_at: Mapped[datetime] = mapped_column(DateTime, nullable=False, server_default=func.current_timestamp())