فهرست منبع

Merge pull request #2316 from visuddhinanda/development

Development
visuddhinanda 9 ماه پیش
والد
کامیت
75df6e50ac

+ 3 - 5
ai-translate/ai_translate/service.py

@@ -175,14 +175,12 @@ class AiTranslateService:
 
             # 写入句子 discussion
             topic_children = []
-            # 提示词
-            topic_children.append(message.prompt)
             # 任务结果
             topic_children.append(response_llm['content'])
             # 推理过程写入discussion
             if response_llm.get('reasoningContent'):
                 topic_children.append(response_llm['reasoningContent'])
-            self._sentence_discussion(s_uid, topic_children)
+            self._sentence_discussion(s_uid, message.prompt, topic_children)
 
             # 修改task 完成度
             progress = self._set_task_progress(
@@ -222,12 +220,12 @@ class AiTranslateService:
         logger.info('ai translate task complete')
         return True
 
-    def _sentence_discussion(self, id, discussions):
+    def _sentence_discussion(self, id, prompt, discussions):
         topic_id = self._task_discussion(
             id,
             'sentence',
             self.task.title,
-            self.task.category,
+            prompt,
             None
         )
 

+ 3 - 3
ai-translate/ai_translate/worker.py

@@ -13,8 +13,8 @@ class TaskFailException(Exception):
         super().__init__(self.message)
 
 
-def handle_message(redis, ch, method, id, content_type, body, api_url, customer_timeout):
-    MaxRetry = 3
+def handle_message(redis, ch, method, id, content_type, body, api_url: str, customer_timeout: int):
+    MaxRetry: int = 3
     try:
         logger.info("process message start (%s) messages", len(body.payload))
         consumer = AiTranslateService(
@@ -28,7 +28,7 @@ def handle_message(redis, ch, method, id, content_type, body, api_url, customer_
     except Exception as e:
         # retry
         retryKey = f'{redis[1]}/message/retry/{id}'
-        retry = 0
+        retry: int = 0
         if redis[0].exists(retryKey):
             retry = redis[0].get(retryKey)
         if retry > MaxRetry:

+ 1 - 0
dashboard-v4/dashboard/src/components/discussion/DiscussionListCard.tsx

@@ -148,6 +148,7 @@ const DiscussionListCardWidget = ({
               return (
                 <div key={index}>
                   <Paragraph
+                    type="secondary"
                     ellipsis={{
                       rows: 2,
                       expandable: true,