mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-07-06 03:45:11 +08:00
22 lines
623 B
Python
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
|