diff --git a/main_v2.py b/main_v2.py index c21e5f4..60bb908 100644 --- a/main_v2.py +++ b/main_v2.py @@ -567,6 +567,13 @@ async def websocket_endpoint(websocket: WebSocket, user_id: str, db: Session = D message = data.get("message", "") conversation_id = data.get("conversation_id") enable_thinking = data.get("enable_thinking", True) # 可临时关闭思考 + agent_id_override = data.get("agent_id") # 前端可以指定agent + + # 如果前端指定了agent,使用它 + if agent_id_override: + agent = agent_service.get_agent(agent_id_override) + if agent and agent.is_active: + current_agent_id = agent_id_override if not message.strip(): continue diff --git a/templates/admin_v2/index.html b/templates/admin_v2/index.html index f62d87a..04bc535 100644 --- a/templates/admin_v2/index.html +++ b/templates/admin_v2/index.html @@ -7,612 +7,185 @@ - -
- +
- +
大模型提供商列表 - +
- - - - - - - - - - - - - + +
名称API地址默认模型思考支持状态操作
加载中...
名称API地址默认模型思考支持状态操作
加载中...
- +
- +
Agent列表 - +
- - - - - - - - - - - - - - + +
名称显示名大模型池思考功能默认状态操作
加载中...
名称显示名大模型池思考默认状态操作
加载中...
- +
- +
-
- 网页端渠道 -
-
- 加载中... -
+
网页端渠道
+
加载中...
-
- Matrix渠道 -
-
- 加载中... -
+
Matrix渠道
+
加载中...
-
- 渠道-Agent绑定关系 -
+
渠道-Agent绑定关系
- - - - - - - - - - - - - + +
渠道绑定Agent优先级模式条件操作
加载中...
渠道绑定Agent优先级模式条件操作
加载中...
- +
- +
-
-
-
- -

-

-

用户数

-
-
-
-
-
-
- -

-

-

对话数

-
-
-
-
-
-
- -

-

-

消息数

-
-
-
-
-
-
- -

-

-

Agent数

-
-
-
-
-
- - -
- -
-
-

系统级别的通用配置...

-
+

-

用户数

+

-

对话数

+

-

消息数

+

-

Agent数

- - + + - - + + - - + + - - + + \ No newline at end of file diff --git a/templates/index.html b/templates/index.html index 85f1fe4..5c18947 100644 --- a/templates/index.html +++ b/templates/index.html @@ -3,375 +3,322 @@ - AI 对话系统 + AI 对话系统 v2.0
-

AI 对话

-
用户: 加载中...
+

AI 对话 v2.0

+
+
+ + +
+
+ 主用户 +
+

👋 欢迎使用 AI 对话系统

-

开始一段新对话吧

+

选择Agent,开始对话吧

- +
+ + +
+
+ 快捷语句 + +
+
+
+
+
+ + +
+
+

添加快捷语句

+ +
+ + +
\ No newline at end of file