Browse Source

加好友消息,不回复

develop
H Vs 1 day ago
parent
commit
18c1674f5d
1 changed files with 9 additions and 1 deletions
  1. +9
    -1
      app/endpoints/pipeline_endpoint.py

+ 9
- 1
app/endpoints/pipeline_endpoint.py View File

@@ -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…
Cancel
Save