2025-06-24 09:05:29 +08:00
|
|
|
from typing import Any
|
|
|
|
|
|
|
|
# TODO(QuantumGhost): Refactor variable type identification. Instead of directly
|
|
|
|
# comparing `dify_model_identity` with constants throughout the codebase, extract
|
|
|
|
# this logic into a dedicated function. This would encapsulate the implementation
|
|
|
|
# details of how different variable types are identified.
|
2024-10-21 10:43:49 +08:00
|
|
|
FILE_MODEL_IDENTITY = "__dify__file__"
|
2025-06-24 09:05:29 +08:00
|
|
|
|
|
|
|
|
|
|
|
def maybe_file_object(o: Any) -> bool:
|
|
|
|
return isinstance(o, dict) and o.get("dify_model_identity") == FILE_MODEL_IDENTITY
|