File size: 496 Bytes
6fce4ec
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from __future__ import annotations

from pydantic import BaseModel, Field

__all__ = ["ChatRequest", "ChatResponse", "ResetRequest", "ResetResponse"]

class ChatRequest(BaseModel):
    user: str = Field(..., example="default")
    session: str = Field(..., example="default")
    prompt: str = Field(..., min_length=1, example="Hello")

class ChatResponse(BaseModel):
    reply: str

class ResetRequest(BaseModel):
    user: str
    session: str

class ResetResponse(BaseModel):
    removed: int