21 lines
427 B
Python
21 lines
427 B
Python
from typing import Literal
|
|
from uuid import UUID
|
|
|
|
from pydantic import BaseModel, Field
|
|
|
|
|
|
class ChatRequest(BaseModel):
|
|
question: str = Field(min_length=1, max_length=2000)
|
|
|
|
|
|
class SourcePreview(BaseModel):
|
|
title: str
|
|
source_url: str | None = None
|
|
|
|
|
|
class ChatResponse(BaseModel):
|
|
answer: str
|
|
status: Literal["retrieval_only", "no_evidence"]
|
|
sources: list[SourcePreview] = []
|
|
retrieval_run_id: UUID
|