From 1e7b609b7c055348c7721830c5df624fc5412772 Mon Sep 17 00:00:00 2001 From: H Vs Date: Fri, 25 Apr 2025 10:22:13 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=AD=E9=9F=B3=E4=B8=8D=E5=9B=9E=E5=A4=8D?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/endpoints/pipeline_endpoint.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/endpoints/pipeline_endpoint.py b/app/endpoints/pipeline_endpoint.py index 56925a0..9d4d7f0 100644 --- a/app/endpoints/pipeline_endpoint.py +++ b/app/endpoints/pipeline_endpoint.py @@ -945,6 +945,12 @@ async def handle_voice_async(request: Request,token_id,app_id, wxid,msg_data,fro messages=await request.app.state.gewe_service.save_session_messages_to_cache_async(hash_key, {"role": "user", "content": react_voice_text}) ai_res=await gpt_client_async(request,messages,wxid,callback_to_user) ai_res_content=remove_markdown_symbol(ai_res["choices"][0]["message"]["content"]) + + if ai_res_content == '不回复': + logger.warning(f"语音消息,AI回答任务不回复,AI回答<不回复>,跳过微信语音回复") + await request.app.state.gewe_service.save_session_messages_to_cache_async(hash_key, {"role": "assistant", "content": ai_res_content}) + return + has_url=contains_url(ai_res_content) if not has_url: voice_during,voice_url=wx_voice(ai_res_content)