vgecbot / app /api /schemas /tests.py
harsh-dev's picture
docker deployment
4225666
from pydantic import BaseModel, Field
from typing import List
class Test(BaseModel):
question: str = Field(min_length=1, max_length=100, description="Question you want to test")
document: str = Field(min_length=1, description="Document name")
chunk_index: int = Field(default=0, min=0, description="Chunk index")
class TestRequestSchema(BaseModel):
tests: List[Test] = Field(min_length=1, description="give tests to evalute")
k: int = Field(default=5, min=0, max=20, description="maximum number of results")
threshold: float = Field(default= 0.4, min=0.0, max=1.0, description="Threshold for reference")
class TestResponse(BaseModel):
tests: Test
answer: bool
class TestResponseSchema(BaseModel):
tests: List[TestResponse] = Field(min_length=1, description="test results")
class TestClassifier(BaseModel):
question: str = Field(min_length=1, description="Question you want to test")
type: str = Field(min_length=1, description="Type to be predicted")
category: str = Field(min_length=1, description="Category to be predicted")
topic: str = Field(min_length=1, description="Topic to be predicted")
intent: str = Field(min_length=1, description="Intent to be predicted")
class TestClassifierReqSchema(BaseModel):
tests: List[TestClassifier] = Field(min_length=1, description="give tests to evalute")