coding-llm-space / src /schemas.py
girish00's picture
Upload folder using huggingface_hub
07a91a1 verified
raw
history blame contribute delete
442 Bytes
"""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