|
@@ -11,7 +11,18 @@ def wrap_response(code, msg=None, data=None):
|
|
return jsonify(resp)
|
|
return jsonify(resp)
|
|
|
|
|
|
|
|
|
|
-def quit_human_intervention_status(user_id, staff_id):
|
|
|
|
|
|
+def quit_human_intervention(user_id, staff_id) -> bool:
|
|
url = f"http://ai-wechat-hook-internal.piaoquantv.com/manage/insertEvent?sender={user_id}&receiver={staff_id}&type=103&content=SYSTEM"
|
|
url = f"http://ai-wechat-hook-internal.piaoquantv.com/manage/insertEvent?sender={user_id}&receiver={staff_id}&type=103&content=SYSTEM"
|
|
response = requests.post(url, timeout=20)
|
|
response = requests.post(url, timeout=20)
|
|
- return response.json()
|
|
|
|
|
|
+ if response.status_code == 200 and response.json().get("code") == 0:
|
|
|
|
+ return True
|
|
|
|
+ else:
|
|
|
|
+ return False
|
|
|
|
+
|
|
|
|
+def enter_human_intervention(user_id, staff_id) -> bool:
|
|
|
|
+ url = f"http://ai-wechat-hook-internal.piaoquantv.com/manage/insertEvent?sender={user_id}&receiver={staff_id}&type=104&content=SYSTEM"
|
|
|
|
+ response = requests.post(url, timeout=20)
|
|
|
|
+ if response.status_code == 200 and response.json().get("code") == 0:
|
|
|
|
+ return True
|
|
|
|
+ else:
|
|
|
|
+ return False
|