File size: 748 Bytes
76db545
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
"""Pydantic v2 request and response models for all API endpoints."""
from __future__ import annotations

from typing import Literal, Optional

from pydantic import BaseModel, Field


class TranscribeResponse(BaseModel):
    text: str
    language: str
    duration_s: float
    processing_time_ms: int
    confidence: Optional[float] = None


class IoTQueryResponse(BaseModel):
    transcription: str
    language: str
    intent: dict
    sensor_data: dict
    voice_response: str
    processing_time_ms: int


class HealthResponse(BaseModel):
    status: str
    model_loaded: bool
    active_adapter: Optional[str]
    adapters_available: list[str]
    adapters_loaded: list[str]


class ErrorResponse(BaseModel):
    error: str
    detail: str