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])))