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