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] = ""