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)