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

33 lines
480 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 enum import Enum
from strenum import StrEnum
class FileType(StrEnum):
FOLDER = "folder"
PDF = "pdf"
WORD = "word"
EXCEL = "excel"
PPT = "ppt"
VISUAL = "visual"
TEXT = "txt"
HTML = "html"
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