update pay ui
This commit is contained in:
@@ -61,6 +61,11 @@ HTTP_CLIENT = httpx.AsyncClient(timeout=60.0)
|
||||
|
||||
# 模型配置字典(支持动态切换)
|
||||
MODEL_CONFIGS = {
|
||||
"deepseek": {
|
||||
"api_key": "sk-7363bdb28d7d4bf0aa68eb9449f8f063",
|
||||
"base_url": "https://api.deepseek.com",
|
||||
"model": "deepseek-chat", # 默认模型
|
||||
},
|
||||
"kimi-k2": {
|
||||
"api_key": "sk-TzB4VYJfCoXGcGrGMiewukVRzjuDsbVCkaZXi2LvkS8s60E5",
|
||||
"base_url": "https://api.moonshot.cn/v1",
|
||||
@@ -88,8 +93,8 @@ MODEL_CONFIGS = {
|
||||
},
|
||||
}
|
||||
|
||||
# 保持向后兼容的配置(默认使用 kimi-k2-thinking)
|
||||
KIMI_CONFIG = MODEL_CONFIGS["kimi-k2-thinking"]
|
||||
# 保持向后兼容的配置(默认使用 deepseek)
|
||||
KIMI_CONFIG = MODEL_CONFIGS["deepseek"]
|
||||
DEEPMONEY_CONFIG = MODEL_CONFIGS["deepmoney"]
|
||||
|
||||
# ==================== MCP协议数据模型 ====================
|
||||
@@ -166,7 +171,7 @@ class AgentChatRequest(BaseModel):
|
||||
user_avatar: Optional[str] = None # 用户头像URL
|
||||
subscription_type: Optional[str] = None # 用户订阅类型(free/pro/max)
|
||||
session_id: Optional[str] = None # 会话ID(如果为空则创建新会话)
|
||||
model: Optional[str] = "kimi-k2-thinking" # 选择的模型(kimi-k2, kimi-k2-thinking, glm-4.6, deepmoney, gemini-3)
|
||||
model: Optional[str] = "deepseek" # 选择的模型(deepseek, kimi-k2, kimi-k2-thinking, glm-4.6, deepmoney, gemini-3)
|
||||
tools: Optional[List[str]] = None # 选择的工具列表(工具名称数组,如果为None则使用全部工具)
|
||||
|
||||
# ==================== MCP工具定义 ====================
|
||||
@@ -3100,8 +3105,8 @@ async def agent_chat_stream(chat_request: AgentChatRequest, request: Request):
|
||||
logger.info(f"[工具过滤] 使用全部 {len(tools)} 个工具")
|
||||
|
||||
# ==================== 动态模型选择 ====================
|
||||
selected_model = chat_request.model or "kimi-k2-thinking"
|
||||
model_config = MODEL_CONFIGS.get(selected_model, MODEL_CONFIGS["kimi-k2-thinking"])
|
||||
selected_model = chat_request.model or "deepseek"
|
||||
model_config = MODEL_CONFIGS.get(selected_model, MODEL_CONFIGS["deepseek"])
|
||||
logger.info(f"[模型选择] 使用模型: {selected_model} ({model_config['model']})")
|
||||
|
||||
# 返回流式响应
|
||||
|
||||
Reference in New Issue
Block a user