Kaynağa Gözat

语音不回复处理

develop
H Vs 1 gün önce
ebeveyn
işleme
1e7b609b7c
1 değiştirilmiş dosya ile 6 ekleme ve 0 silme
  1. +6
    -0
      app/endpoints/pipeline_endpoint.py

+ 6
- 0
app/endpoints/pipeline_endpoint.py Dosyayı Görüntüle

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


Yükleniyor…
İptal
Kaydet