From f2c43713b16e821f4a1ae97804c60f18734d5f6a Mon Sep 17 00:00:00 2001
From: zhaoqingang <zhaoqg0118@163.com>
Date: 星期五, 13 十二月 2024 17:25:12 +0800
Subject: [PATCH] 问题优化

---
 app/task/fetch_agent.py |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/app/task/fetch_agent.py b/app/task/fetch_agent.py
index 80ac763..991c0d0 100644
--- a/app/task/fetch_agent.py
+++ b/app/task/fetch_agent.py
@@ -108,7 +108,8 @@
     try:
         count = db.query(AgentModel).count()
         if count > 0:
-            return
+            result = db.query(AgentModel).delete()
+            db.commit()  # 鎻愪氦浜嬪姟
         initial_agents = [
             ('80ee430a-e396-48c4-a12c-7c7cdf5eda51', 1, '鎶ュ憡鐢熸垚', 'BISHENG', 'report'),
             ('basic_excel_merge', 2, '鎶ヨ〃鍚堝苟', 'BASIC', 'excelMerge'),
@@ -116,8 +117,10 @@
             ('da3451da89d911efb9490242ac190006', 3, '鐭ヨ瘑闂瓟', 'RAGFLOW', 'knowledgeQA'),
             ('e96eb7a589db11ef87d20242ac190006', 5, '鏅鸿兘闂瓟', 'RAGFLOW', 'chat'),
             ('basic_excel_talk', 6, '鏅鸿兘鏁版嵁', 'BASIC', 'excelTalk'),
-            ('basic_question_talk', 7, '鏂囨。鍑哄嵎', 'BASIC', 'questionTalk'),
-            ('9d75142a-66eb-4e23-b7d4-03efe4584915', 8, '灏忔暟缁樺浘', 'DIFY', 'imageTalk')
+            ('basic_question_talk', 7, '鍑洪缁勫嵎', 'BASIC', 'questionTalk'),
+            ('9d75142a-66eb-4e23-b7d4-03efe4584915', 8, '灏忔暟缁樺浘', 'DIFY', 'imageTalk'),
+            ('basic_paper_talk', 8, '鏂囨。鍑哄嵎', 'BASIC', 'paperTalk'),
+            ('basic_report_clean', 10, '鏂囨。鎶ュ憡', 'DIFY', 'reportWorkflow')
         ]
 
         for agent in initial_agents:
@@ -144,3 +147,7 @@
         print("Agents synchronized successfully")
     except Exception as e:
         print(f"Failed to sync agents: {str(e)}")
+
+
+
+

--
Gitblit v1.8.0