2026-03-12 15:19:26 +08:00
|
|
|
|
from pydantic import BaseModel, Field, confloat
|
|
|
|
|
|
from typing import Optional, List, Dict, Any
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class AgentConfig(BaseModel):
|
|
|
|
|
|
type: str = Field(..., description="家具类型,如:沙发、餐桌")
|
|
|
|
|
|
region: str = Field(..., description="地区/空间,如:客厅、卧室、户外")
|
|
|
|
|
|
style: str = Field(..., description="设计风格,如:极简、工业风、中式")
|
|
|
|
|
|
temperature: confloat(ge=0, le=2.0) = Field(default=0.7, description="模型温度")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class DeepAgentChatRequest(BaseModel):
|
|
|
|
|
|
message: str = Field(..., description="用户的输入指令")
|
2026-03-23 16:52:11 +08:00
|
|
|
|
enable_thinking: Optional[bool] = Field(default=False, description="是否开启思考模式")
|
2026-03-20 17:22:22 +08:00
|
|
|
|
quote_image_path: Optional[str] = Field(None, description="引用图片地址") # ✅ 新增
|
2026-03-20 17:39:51 +08:00
|
|
|
|
input_image_paths: Optional[list[str]] = Field(None, description="上传图片地址集合") # ✅ 新增
|
2026-03-12 15:19:26 +08:00
|
|
|
|
thread_id: Optional[str] = Field(None, description="会话线程ID,不传则开启新会话")
|
|
|
|
|
|
checkpoint_id: Optional[str] = Field(None, description="回溯点的ID,用于从历史点开启新对话")
|
|
|
|
|
|
config_params: Optional[AgentConfig] = None
|
|
|
|
|
|
need_suggestion: float = 0
|
|
|
|
|
|
use_report: bool = False # ← 新增:是否使用深度报告
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
|