From 3854d78c9c77364a371c5f8751a5904affae1ca6 Mon Sep 17 00:00:00 2001 From: hubian <908234780@qq.com> Date: Sun, 12 Apr 2026 16:43:39 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=BD=91=E9=A1=B5=E7=AB=AFAgent?= =?UTF-8?q?=E5=88=87=E6=8D=A2=20+=20=E5=BF=AB=E6=8D=B7=E8=AF=AD=E5=8F=A5?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main_v2.py | 7 + templates/admin_v2/index.html | 1005 +++++++-------------------------- templates/index.html | 829 +++++++++++++-------------- 3 files changed, 600 insertions(+), 1241 deletions(-) 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