Formatted_Text_Retrieval / pydantic_models.py
viboognesh's picture
Upload folder using huggingface_hub
40d6ead verified
raw
history blame contribute delete
649 Bytes
from pydantic import BaseModel
from typing import List, Optional
# ConGPT Models
class VectorStoreDocumentItem(BaseModel):
page_content: str
filename: str
heading: str
relevance_score: float
class ChatHistoryItem(BaseModel):
user_message: str
assistant_message: str
class RequestModel(BaseModel):
user_question: str
chat_history: Optional[List[ChatHistoryItem]] = []
use_tool: Optional[bool] = False
class ResponseModel(BaseModel):
answer: Optional[str] = ""
sources_documents: Optional[List[VectorStoreDocumentItem]] = []
chat_history: List[ChatHistoryItem]
search_phrase: Optional[str] = ""