您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

1234567891011
  1. from typing import Any
  2. # TODO(QuantumGhost): Refactor variable type identification. Instead of directly
  3. # comparing `dify_model_identity` with constants throughout the codebase, extract
  4. # this logic into a dedicated function. This would encapsulate the implementation
  5. # details of how different variable types are identified.
  6. FILE_MODEL_IDENTITY = "__dify__file__"
  7. def maybe_file_object(o: Any) -> bool:
  8. return isinstance(o, dict) and o.get("dify_model_identity") == FILE_MODEL_IDENTITY