From 18c1674f5d3d86c0e33358007c4fa2e20c51d011 Mon Sep 17 00:00:00 2001 From: H Vs Date: Fri, 25 Apr 2025 10:35:48 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E5=A5=BD=E5=8F=8B=E6=B6=88=E6=81=AF?= =?UTF-8?q?=EF=BC=8C=E4=B8=8D=E5=9B=9E=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/endpoints/pipeline_endpoint.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/endpoints/pipeline_endpoint.py b/app/endpoints/pipeline_endpoint.py index 9d4d7f0..e59b22a 100644 --- a/app/endpoints/pipeline_endpoint.py +++ b/app/endpoints/pipeline_endpoint.py @@ -1266,9 +1266,17 @@ async def handle_add_friend_notice_async(request: Request,token_id,app_id, wxid, #保存好友信息 await request.app.state.gewe_service.save_contacts_brief_to_cache_async(token_id,app_id, wxid,[to_contact_wxid]) - + + if reply_content == '不回复': + logger.warning(f"加好友消息,AI回答<不回复>,跳过微信加好友打招呼消息回复") + await request.app.state.gewe_service.save_session_messages_to_cache_async(hash_key, {"role": "assistant", "content": reply_content}) + return + # 保存到缓存 await request.app.state.gewe_service.save_session_messages_to_cache_async(hash_key, {"role": "assistant", "content": reply_content}) + + + # 发送信息 await request.app.state.gewe_service.post_text_async(token_id,app_id, to_contact_wxid,reply_content)