RAGflow/management/server/services/files/utils.py

28 lines
475 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import uuid
from strenum import StrEnum
from enum import Enum
# 参考api.db
class FileType(StrEnum):
FOLDER = "folder"
PDF = "pdf"
WORD = "word"
EXCEL = "excel"
PPT = "ppt"
VISUAL = "visual"
TEXT = "txt"
OTHER = "other"
class FileSource(StrEnum):
LOCAL = ""
KNOWLEDGEBASE = "knowledgebase"
S3 = "s3"
class StatusEnum(Enum):
VALID = "1"
INVALID = "0"
# 参考api.utils
def get_uuid():
return uuid.uuid1().hex