Browse Source

删除还没有的状态

xueyiming 3 days ago
parent
commit
4935d1405b
2 changed files with 6 additions and 5 deletions
  1. 2 2
      pqai_agent_server/const/type_enum.py
  2. 4 3
      pqai_agent_server/task_server.py

+ 2 - 2
pqai_agent_server/const/type_enum.py

@@ -24,13 +24,13 @@ def get_dataset_type_desc(type_code):
 
 
 class EvaluateType(Enum):
-    REPLAY = 0
+    # REPLAY = 0
     PUSH = 1
 
     @property
     def description(self):
         descriptions = {
-            self.REPLAY: "回复",
+            # self.REPLAY: "回复",
             self.PUSH: "唤起"
         }
         return descriptions.get(self)

+ 4 - 3
pqai_agent_server/task_server.py

@@ -50,7 +50,7 @@ class TaskManager:
                     "id": agent_test_task.id,
                     "agentId": agent_configuration.id,
                     "agentName": agent_configuration.display_name,
-                    "moduleName":service_module.display_name,
+                    "moduleName": service_module.display_name,
                     "createUser": agent_test_task.create_user,
                     "updateUser": agent_test_task.update_user,
                     "status": agent_test_task.status,
@@ -510,14 +510,15 @@ class TaskManager:
                 task_conversation.id,
                 TestTaskConversationsStatus.SCORE_FAILED.value
             )
-            raise  # 重新抛出异常以便主线程捕获
 
     def _update_final_task_status(self, task_id):
         """更新任务的最终状态"""
         task_conversations = self.get_task_conversations(task_id)
         all_completed = all(
             conv.status in (TestTaskConversationsStatus.SUCCESS.value,
-                            TestTaskConversationsStatus.FAILED.value)
+                            TestTaskConversationsStatus.FAILED.value,
+                            TestTaskConversationsStatus.MESSAGE_FAILED.value,
+                            TestTaskConversationsStatus.SCORE_FAILED.value)
             for conv in task_conversations
         )