From 572f0529fb04e0dcda10e2572324c33fb344d032 Mon Sep 17 00:00:00 2001 From: zhiqui Date: Sun, 15 Nov 2026 16:55:07 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BE=A4=E8=81=8A=E5=9B=9E=E5=A4=8D=E5=89=A5?= =?UTF-8?q?=E7=A6=BB=E3=80=90=E8=A7=92=E8=89=B2=E5=90=8D=E3=80=91=E5=AD=A6?= =?UTF-8?q?=E8=88=8C=E5=89=8D=E7=BC=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/routers/extra.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/api/routers/extra.py b/app/api/routers/extra.py index a13dcf7b..c07cb23b 100644 --- a/app/api/routers/extra.py +++ b/app/api/routers/extra.py @@ -102,6 +102,8 @@ async def send_group(sid: int, body: dict, user: User = Depends(current_user), reply = await client.chat(models.get("narrative") or "step-3.5-flash", [{"role": "system", "content": sysmsg}] + msgs, temperature=0.95) + import re as _re + reply = _re.sub(r"^【[^】]*】\s*", "", reply) # 剥掉模型学舌的【角色名】前缀 m = Message(session_id=sid, user_id=user.id, role="assistant", speaker=c.name, content_enc=_enc(user, reply), swipes_enc=_enc(user, json.dumps([reply])))