dify/api/core/file/constants.py
2025-05-23 10:24:00 +08:00

22 lines
623 B
Python

from typing import Any
FILE_MODEL_IDENTITY = "__dify__file__"
# DUMMY_OUTPUT_IDENTITY is a placeholder output for workflow nodes.
# Its sole possible value is `None`.
#
# This is used to signal the execution of a workflow node when it has no other outputs.
_DUMMY_OUTPUT_IDENTITY = "__dummy__"
_DUMMY_OUTPUT_VALUE: None = None
def add_dummy_output(original: dict[str, Any] | None) -> dict[str, Any]:
if original is None:
original = {}
original[_DUMMY_OUTPUT_IDENTITY] = _DUMMY_OUTPUT_VALUE
return original
def is_dummy_output_variable(name: str) -> bool:
return name == _DUMMY_OUTPUT_IDENTITY