first commit
This commit is contained in:
0
src/schemas/__init__.py
Normal file
0
src/schemas/__init__.py
Normal file
26
src/schemas/chat.py
Normal file
26
src/schemas/chat.py
Normal file
@@ -0,0 +1,26 @@
|
||||
from pydantic import BaseModel, Field
|
||||
from typing import Optional, List, Dict, Any
|
||||
|
||||
|
||||
class ChatRequest(BaseModel):
|
||||
message: str = Field(..., description="用户的输入指令")
|
||||
thread_id: Optional[str] = Field(None, description="会话线程ID,不传则开启新会话")
|
||||
checkpoint_id: Optional[str] = Field(None, description="回溯点的ID,用于从历史点开启新对话")
|
||||
|
||||
|
||||
class HistoryItem(BaseModel):
|
||||
checkpoint_id: str
|
||||
last_message: str
|
||||
node: Optional[str]
|
||||
timestamp: Any
|
||||
|
||||
|
||||
class HistoryResponse(BaseModel):
|
||||
thread_id: str
|
||||
history: List[HistoryItem]
|
||||
|
||||
|
||||
class StreamChunk(BaseModel):
|
||||
node: str
|
||||
content: str
|
||||
checkpoint_id: str
|
||||
Reference in New Issue
Block a user