Spaces:
Sleeping
Sleeping
File size: 442 Bytes
07a91a1 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | """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
|