"""API schema definitions.""" from pydantic import BaseModel, Field class GenerateRequest(BaseModel): instruction: str = Field(..., min_length=1) input: str = Field("", description="Source code or problem context.") class GenerateResponse(BaseModel): code: str explanation: str confidence: float important_tokens: list[str] relevancy_score: float hallucination: bool latency_ms: int