refactor: remove MemoryBlockWithVisibility

This commit is contained in:
Stream 2025-09-22 18:16:37 +08:00
parent a8c2a300f6
commit 7c35aaa99d
No known key found for this signature in database
GPG Key ID: 033728094B100D70
2 changed files with 0 additions and 37 deletions

View File

@ -70,15 +70,6 @@ class MemoryBlock(BaseModel):
node_id: Optional[str] = None
class MemoryBlockWithVisibility(BaseModel):
id: str
name: str
value: str
version: int
end_user_visible: bool
end_user_editable: bool
class MemoryValueData(BaseModel):
value: str

View File

@ -11,7 +11,6 @@ from core.llm_generator.llm_generator import LLMGenerator
from core.memory.entities import (
MemoryBlock,
MemoryBlockSpec,
MemoryBlockWithVisibility,
MemoryScheduleMode,
MemoryScope,
MemoryTerm,
@ -376,33 +375,6 @@ class ChatflowMemoryService:
)
return results
@staticmethod
def _with_visibility(
app: App,
raw_results: Sequence[ChatflowMemoryVariable]
) -> Sequence[MemoryBlockWithVisibility]:
workflow = WorkflowService().get_published_workflow(app)
if not workflow:
return []
results = []
for chatflow_memory_variable in raw_results:
spec = next(
(spec for spec in workflow.memory_blocks if spec.id == chatflow_memory_variable.memory_id),
None
)
if spec:
results.append(
MemoryBlockWithVisibility(
id=chatflow_memory_variable.memory_id,
name=chatflow_memory_variable.name,
value=MemoryValueData.model_validate_json(chatflow_memory_variable.value).value,
end_user_editable=spec.end_user_editable,
end_user_visible=spec.end_user_visible,
version=chatflow_memory_variable.version
)
)
return results
@staticmethod
def _should_update_memory(
memory_block: MemoryBlock,