13 lines
347 B
Python
13 lines
347 B
Python
from pydantic import BaseModel, ConfigDict, Field
|
|
|
|
|
|
class AIChatRequest(BaseModel):
|
|
model_config = ConfigDict(extra="forbid", str_strip_whitespace=True)
|
|
question: str = Field(min_length=1, max_length=2000)
|
|
|
|
|
|
class AIChatResponse(BaseModel):
|
|
answer: str
|
|
sources: list[str] = Field(default_factory=list)
|
|
data: dict | None = None
|