ソースを参照

语音不回复处理

develop
H Vs 3日前
コミット
1e7b609b7c
1個のファイルの変更6行の追加0行の削除
  1. +6
    -0
      app/endpoints/pipeline_endpoint.py

+ 6
- 0
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)


読み込み中…
キャンセル
保存