File size: 835 Bytes
fd49a93 ae11f2d fd49a93 ae11f2d fd49a93 ae11f2d | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | from pydantic import BaseModel, HttpUrl, Field
from typing import List
class QueryRequest(BaseModel):
documents: HttpUrl
questions: List[str]
class QueryResponse(BaseModel):
answers: List[str]
class Question(BaseModel):
question: str
class FinalAnswer(BaseModel):
answer: str = Field(description="The complete and detailed answer to the user's question, based strictly on the provided context.")
class FinalAnswerList(BaseModel):
answers: List[FinalAnswer] = Field(description="A list of final answers for each corresponding input question.")
class GeneratedQueriesForEachQuestion(BaseModel):
queries: List[str] = Field(description="A list of 3 distinct, self-contained search queries based on the original question.")
class GeneratedQueries(BaseModel):
lst: List[GeneratedQueriesForEachQuestion] |