Spaces:
Sleeping
Sleeping
Download src/apis/interfaces/file_processing_interface.py from ABAO77/custom-gpt: direct link, hf CLI and curl.
- Browser
- Download file 1.1 kB
-
https://huggingface.co/spaces/ABAO77/custom-gpt/resolve/main/src/apis/interfaces/file_processing_interface.py
- Command line
-
hf download hf://spaces/ABAO77/custom-gpt/src/apis/interfaces/file_processing_interface.py
-
curl -L -o file_processing_interface.py https://huggingface.co/spaces/ABAO77/custom-gpt/resolve/main/src/apis/interfaces/file_processing_interface.py
1.1 kB
| from pydantic import BaseModel, Field | |
| class FileProcessingBody(BaseModel): | |
| bot_id: str = Field(..., title="Bot ID associated with the file") | |
| model_config = { | |
| "json_schema_extra": { | |
| "example": { | |
| "bot_id": "bot123" | |
| } | |
| } | |
| } | |
| class FileAnalysisResponse(BaseModel): | |
| bot_id: str = Field(..., title="Bot ID associated with the file") | |
| file_path: str = Field(..., title="Path to the processed file") | |
| word_count: int = Field(..., title="Number of words in the file") | |
| image_count: int = Field(..., title="Number of images in the file") | |
| file_type: str = Field(..., title="Type of the file (PDF, DOCX, etc.)") | |
| class FileIngressResponse(BaseModel): | |
| bot_id: str = Field(..., title="Bot ID associated with the file") | |
| file_path: str = Field(..., title="Path to the processed file") | |
| chunks_count: int = Field(..., title="Number of chunks created") | |
| success: bool = Field(..., title="Whether the ingestion was successful") | |
| message: str = Field("File processed and indexed successfully", title="Status message") | |