瀏覽代碼

加好友消息,不回复

develop
H Vs 1 天之前
父節點
當前提交
18c1674f5d
共有 1 個檔案被更改,包括 9 行新增1 行删除
  1. +9
    -1
      app/endpoints/pipeline_endpoint.py

+ 9
- 1
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)


Loading…
取消
儲存