File size: 411 Bytes
e425487
cd4408f
e425487
 
 
 
 
cd4408f
e425487
 
 
 
cd4408f
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
from pydantic import BaseModel
from typing import List, Optional, Dict, Any

class ChatRequest(BaseModel):
    message: str
    session_id: Optional[str] = None
    history: Optional[List[List[str]]] = []
    persona_key: Optional[str] = None  # 新增:接收前端传来的persona

class ChatResponse(BaseModel):
    reply: str
    session_id: str
    status_info: Dict[str, Any]
    history: List[List[str]]