34 lines
1.0 KiB
Python
34 lines
1.0 KiB
Python
from typing import Literal
|
|
|
|
from pydantic import BaseModel, Field
|
|
|
|
|
|
class ChatRequest(BaseModel):
|
|
"""Request model for the /chat endpoint."""
|
|
|
|
message: str = Field(..., description="The user's message")
|
|
conversation_id: str | None = Field(
|
|
default=None, description="Optional conversation ID for continuity"
|
|
)
|
|
|
|
|
|
class ChatResponse(BaseModel):
|
|
"""Response model for the /chat endpoint."""
|
|
|
|
conversation_id: str = Field(..., description="Conversation ID (generated if not provided)")
|
|
response: str = Field(..., description="The LLM's response")
|
|
mode: Literal["local", "remote"] = Field(..., description="Which adapter was used")
|
|
sources: list = Field(default_factory=list, description="Source references (empty for now)")
|
|
|
|
|
|
class HealthResponse(BaseModel):
|
|
"""Response model for the /health endpoint."""
|
|
|
|
status: str = Field(default="ok")
|
|
|
|
|
|
class ErrorResponse(BaseModel):
|
|
"""Standard error response model."""
|
|
|
|
detail: str = Field(..., description="Error description")
|