|
@@ -1,7 +1,7 @@
|
|
|
#! /usr/bin/env python
|
|
|
# -*- coding: utf-8 -*-
|
|
|
# vim:fenc=utf-8
|
|
|
-import time
|
|
|
+
|
|
|
import logging
|
|
|
import werkzeug.exceptions
|
|
|
from flask import Flask, request, jsonify
|
|
@@ -12,7 +12,7 @@ from pqai_agent import configs
|
|
|
from pqai_agent import logging_service, chat_service, prompt_templates
|
|
|
from pqai_agent.history_dialogue_service import HistoryDialogueService
|
|
|
from pqai_agent.user_manager import MySQLUserManager, MySQLUserRelationManager
|
|
|
-from pqai_agent_server.utils import wrap_response
|
|
|
+from pqai_agent_server.utils import wrap_response, quit_human_intervention_status
|
|
|
from pqai_agent_server.utils import (
|
|
|
run_extractor_prompt,
|
|
|
run_chat_prompt,
|
|
@@ -232,13 +232,22 @@ def get_conversation_list():
|
|
|
return wrap_response(200, data=response)
|
|
|
|
|
|
|
|
|
-@app.route("/api/quitHumanConversationStatus", methods=["POST"])
|
|
|
-def quit_human_conversation_status():
|
|
|
+@app.route("/api/quitHumanInterventionStatus", methods=["POST"])
|
|
|
+def quit_human_intervention_status():
|
|
|
"""
|
|
|
退出人工介入状态
|
|
|
:return:
|
|
|
"""
|
|
|
- return wrap_response(200, msg="OK")
|
|
|
+ data = request.get_json()
|
|
|
+ user_id = data["user_id"]
|
|
|
+ staff_id = data["staff_id"]
|
|
|
+ # 测试环境: staff_id 强制等于1688854492669990
|
|
|
+ staff_id = 1688854492669990
|
|
|
+ if not user_id or not staff_id:
|
|
|
+ return wrap_response(404, msg="user_id and staff_id are required")
|
|
|
+ response = quit_human_intervention_status(user_id, staff_id)
|
|
|
+
|
|
|
+ return wrap_response(200, data=response)
|
|
|
|
|
|
|
|
|
@app.route("/api/sendMessage", methods=["POST"])
|