-
Notifications
You must be signed in to change notification settings - Fork 310
Expand file tree
/
Copy pathresponses.py
More file actions
153 lines (97 loc) · 3.74 KB
/
Copy pathresponses.py
File metadata and controls
153 lines (97 loc) · 3.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
from typing import Any, Dict, List, Literal, Optional
from pydantic import BaseModel, Field
from core.models.documents import Document
from core.models.folders import Folder
class HealthCheckResponse(BaseModel):
"""Response for health check endpoint"""
status: str
message: str
class ServiceStatus(BaseModel):
"""Status of an individual service"""
name: str
status: str # "healthy", "unhealthy", "degraded"
message: Optional[str] = None
response_time_ms: Optional[float] = None
class DetailedHealthCheckResponse(BaseModel):
"""Response for detailed health check endpoint"""
status: str # "healthy", "unhealthy", "degraded"
services: List[ServiceStatus]
timestamp: str
class ModelsResponse(BaseModel):
"""Response for available models endpoint"""
chat_models: List[Dict[str, Any]]
embedding_models: List[Dict[str, Any]]
default_models: Dict[str, Optional[str]]
providers: List[str]
class FolderDeleteResponse(BaseModel):
"""Response for folder deletion endpoint"""
status: str
message: str
class DocumentPagesResponse(BaseModel):
"""Response for document pages extraction endpoint"""
document_id: str
pages: List[str] # Base64-encoded images or download URLs
start_page: int
end_page: int
total_pages: int
class DocumentAddToFolderResponse(BaseModel):
"""Response for adding document to folder endpoint"""
status: str
message: str
class DocumentDeleteResponse(BaseModel):
"""Response for document deletion endpoint"""
status: str
message: str
class DocumentDownloadUrlResponse(BaseModel):
"""Response for document download URL endpoint"""
download_url: str
expires_in: int
class MigrationIngestResponse(BaseModel):
"""Response for a migration document ingest request."""
status: Literal["created", "skipped"]
document: Document
class ChatTitleResponse(BaseModel):
"""Response for chat title update endpoint"""
status: str
message: str
title: str
class FolderCount(BaseModel):
"""Count of documents grouped by folder name."""
folder: Optional[str]
count: int
class ListDocsResponse(BaseModel):
"""Flexible response for listing documents with aggregates."""
documents: List[Any] = Field(default_factory=list)
skip: int
limit: int
returned_count: int
total_count: Optional[int] = None
has_more: bool = False
next_skip: Optional[int] = None
status_counts: Optional[Dict[str, int]] = None
folder_counts: Optional[List[FolderCount]] = None
class FolderDocumentInfo(BaseModel):
"""Document summary for a folder."""
documents: List[Any] = Field(default_factory=list)
document_count: Optional[int] = None
status_counts: Optional[Dict[str, int]] = None
skip: int = 0
limit: int = 0
returned_count: int = 0
has_more: bool = False
next_skip: Optional[int] = None
class FolderDetails(BaseModel):
"""Folder details with optional document summary."""
folder: Folder
document_info: Optional[FolderDocumentInfo] = None
class FolderDetailsResponse(BaseModel):
"""Response wrapping folder detail entries."""
folders: List[FolderDetails]
class RequeueIngestionResult(BaseModel):
"""Result information for an individual requeued ingestion job."""
external_id: str = Field(..., description="Document external identifier")
status: str = Field(..., description="Outcome status for this job")
message: Optional[str] = Field(default=None, description="Optional human-readable message describing the outcome")
class RequeueIngestionResponse(BaseModel):
"""Response payload for requeueing ingestion jobs."""
results: List[RequeueIngestionResult] = Field(..., description="Per-document outcomes")