replyflow-rag / api /schemas.py
Qurrah's picture
REFINE: update mime field in IngestDocumentRequest to use Field for validation
662d8a9
Raw History Blame Contribute Delete
1.16 kB
from typing import Literal, Optional
from pydantic import BaseModel, Field
class IngestDocumentRequest(BaseModel):
workspace_slug: str = Field(..., min_length=1)
document_id: str = Field(..., min_length=1)
source_url: str = Field(..., min_length=1)
mime: str = Field(..., min_length=1) # validated in the route via validate_supported_mime()
title: str = Field(..., min_length=1)
class QueryRequest(BaseModel):
query: str = Field(..., min_length=1)
channel: Literal["instagram", "facebook", "test"]
channel_identifier: str = Field(..., min_length=1)
external_id: Optional[str] = None
commenter_handle: Optional[str] = None
post_caption: Optional[str] = None
class QueryResponse(BaseModel):
answer: str
query: str
route: Optional[str] = None
class OnboardRequest(BaseModel):
shop_domain: str = Field(..., min_length=1)
access_token: str = Field(..., min_length=1)
class IngestRequest(BaseModel):
brand_slug: str = Field(..., min_length=1)
class IngestResponse(BaseModel):
status: Literal["ok", "error", "ingesting"]
brand_slug: str
indexed: Optional[dict] = None