|
14 | 14 |
|
15 | 15 | # generated by datamodel-codegen: |
16 | 16 | # filename: openapi.merged.yaml |
17 | | -# timestamp: 2026-03-04T08:41:38+00:00 |
| 17 | +# timestamp: 2026-03-09T07:45:40+00:00 |
18 | 18 |
|
19 | 19 | from __future__ import annotations |
20 | 20 |
|
21 | 21 | from datetime import datetime |
22 | 22 | from typing import Any, Literal, Optional, Union |
23 | 23 |
|
24 | | -from pydantic import BaseModel, ConfigDict, EmailStr, Field, RootModel, confloat, conint |
| 24 | +from pydantic import ( |
| 25 | + AnyUrl, |
| 26 | + BaseModel, |
| 27 | + ConfigDict, |
| 28 | + EmailStr, |
| 29 | + Field, |
| 30 | + RootModel, |
| 31 | + confloat, |
| 32 | + conint, |
| 33 | +) |
25 | 34 |
|
26 | 35 |
|
27 | 36 | class ModelSpec(BaseModel): |
@@ -874,6 +883,51 @@ class ConfirmDocumentsResponse(BaseModel): |
874 | 883 | ) |
875 | 884 |
|
876 | 885 |
|
| 886 | +class FetchUrlRequest(BaseModel): |
| 887 | + urls: list[AnyUrl] = Field( |
| 888 | + ..., |
| 889 | + description='List of URLs to fetch and import (max 10)', |
| 890 | + examples=[['https://example.com/article1', 'https://example.com/article2']], |
| 891 | + ) |
| 892 | + |
| 893 | + |
| 894 | +class FetchUrlResultItem(BaseModel): |
| 895 | + url: str = Field(..., description='The source URL') |
| 896 | + fetch_status: Literal['success', 'error'] = Field( |
| 897 | + ..., description='Whether the URL was fetched successfully' |
| 898 | + ) |
| 899 | + document_id: Optional[str] = Field( |
| 900 | + None, description='ID of the created document (only present on success)' |
| 901 | + ) |
| 902 | + filename: Optional[str] = Field( |
| 903 | + None, description='Filename of the created document (only present on success)' |
| 904 | + ) |
| 905 | + size: Optional[int] = Field( |
| 906 | + None, |
| 907 | + description='Size of the created document in bytes (only present on success)', |
| 908 | + ) |
| 909 | + status: Optional[str] = Field( |
| 910 | + None, description='Document status (only present on success)' |
| 911 | + ) |
| 912 | + error: Optional[str] = Field( |
| 913 | + None, description='Error message (only present on failure)' |
| 914 | + ) |
| 915 | + |
| 916 | + |
| 917 | +class FetchUrlResponse(BaseModel): |
| 918 | + results: list[FetchUrlResultItem] = Field(..., description='Results for each URL') |
| 919 | + total: int = Field(..., description='Total number of URLs processed') |
| 920 | + succeeded: int = Field(..., description='Number of URLs successfully fetched') |
| 921 | + failed: int = Field(..., description='Number of URLs that failed') |
| 922 | + |
| 923 | + |
| 924 | +class StagedDocumentsResponse(BaseModel): |
| 925 | + documents: list[UploadDocumentResponse] = Field( |
| 926 | + ..., description='List of staged (UPLOADED) documents awaiting confirmation' |
| 927 | + ) |
| 928 | + total: int = Field(..., description='Total number of staged documents') |
| 929 | + |
| 930 | + |
877 | 931 | class VectorSearchParams(BaseModel): |
878 | 932 | topk: Optional[int] = Field(None, description='Top K results') |
879 | 933 | similarity: Optional[confloat(ge=0.0, le=1.0)] = Field( |
|
0 commit comments