You've already forked DataMate
- 后端实现知识条目文件预览接口,支持多种文件类型在线预览 - 后端实现知识条目文件替换功能,保留原有文件管理逻辑 - 前端新增文件预览模态框组件,支持文本、图片、音视频预览 - 前端知识条目编辑器添加文件替换上传功能 - 前端优化文件内容截断预览逻辑,统一使用工具函数处理 - 前端修复 PUT 请求中 FormData 处理问题,确保文件上传正常工作 - 新增文件预览相关工具函数和常量配置
22 lines
937 B
Python
22 lines
937 B
Python
from pydantic import BaseModel, Field
|
|
|
|
|
|
class PdfTextExtractRequest(BaseModel):
|
|
dataset_id: str = Field(..., alias="datasetId", description="Dataset ID")
|
|
file_id: str = Field(..., alias="fileId", description="PDF file ID")
|
|
|
|
class Config:
|
|
populate_by_name = True
|
|
|
|
|
|
class PdfTextExtractResponse(BaseModel):
|
|
dataset_id: str = Field(..., alias="datasetId", description="Dataset ID")
|
|
source_file_id: str = Field(..., alias="sourceFileId", description="Source PDF file ID")
|
|
text_file_id: str = Field(..., alias="textFileId", description="Generated text file ID")
|
|
text_file_name: str = Field(..., alias="textFileName", description="Generated text file name")
|
|
text_file_path: str = Field(..., alias="textFilePath", description="Generated text file path")
|
|
text_file_size: int = Field(..., alias="textFileSize", description="Generated text file size")
|
|
|
|
class Config:
|
|
populate_by_name = True
|