from pydantic import BaseModel
from typing import List,Optional,Any
from .request import TextData

class Response(BaseModel):
    status: str

################################################

class VectorData(BaseModel):
    text: str
    vector: List[float]
    
class EmbeddingResponse(Response):
    vectors: List[VectorData]
    
################################################

class SearchResult(BaseModel):
    id: str
    title: str
    author: str
    site_name: str
    site_domain: str
    pub_date: str
    article_text: str
    score: float
    url: str

class SearchResultMeta(BaseModel):
    id: str
    title: str
    pub_date: str
    url: str

class SearchResultContent(BaseModel):
    id: str
    title: str
    article_text: str

class SearchResponse(Response):
    results: List[SearchResult]
    
class SearchResponseV2(BaseModel):
    meta: List[SearchResultMeta]
    content: List[SearchResultContent]
    
################################################

    
class GetDocumentResponse(Response):
    title: str
    text: str
    url: Optional[str]
    
class GetMDocumentResponse(Response):
    results: List[GetDocumentResponse]
    
################################################
class StandardResponse(BaseModel):
    success: bool
    error_code: Optional[int] = None
    error_msg: Optional[str] = None
    records: Optional[Any] = None