File size: 553 Bytes
5344861
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
from pydantic import BaseModel

class ChatRequest(BaseModel):
    message: str
    max_length: int = 100
    temperature: float = 0.7
    top_p: float = 0.9
    class Config:
        protected_namespaces = ()

class ChatResponse(BaseModel):
    response: str
    model_name: str
    response_time: float
    class Config:
        protected_namespaces = ()

class HealthResponse(BaseModel):
    status: str
    is_model_loaded: bool
    model_name: str
    cache_directory: str
    startup_time: float
    class Config:
        protected_namespaces = ()