mirror of
https://github.com/langgenius/dify.git
synced 2025-11-26 01:43:25 +00:00
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
16 lines
586 B
Python
16 lines
586 B
Python
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.
|
|
FILE_MODEL_IDENTITY = "__dify__file__"
|
|
|
|
|
|
def maybe_file_object(o: Any) -> bool:
|
|
return isinstance(o, dict) and o.get("dify_model_identity") == FILE_MODEL_IDENTITY
|
|
|
|
|
|
# The default user ID for service API calls.
|
|
DEFAULT_SERVICE_API_USER_ID = "DEFAULT-USER"
|