From 1918bf4308d22adba7dc575b4dc9664b79318c80 Mon Sep 17 00:00:00 2001
From: xuyonghao <898441624@qq.com>
Date: 星期二, 12 十一月 2024 15:50:04 +0800
Subject: [PATCH] 知识问答,文档智能,智能问答。对话历史记录获取

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

diff --git a/app/task/fetch_agent.py b/app/task/fetch_agent.py
index be0e07c..b6852c0 100644
--- a/app/task/fetch_agent.py
+++ b/app/task/fetch_agent.py
@@ -106,6 +106,9 @@
 def initialize_agents():
     db = SessionLocal()
     try:
+        count = db.query(AgentModel).count()
+        if count > 0:
+            return
         initial_agents = [
             ('80ee430a-e396-48c4-a12c-7c7cdf5eda51', 1, '鎶ュ憡鐢熸垚', 'BISHENG', 'report'),
             ('basic_excel_merge', 2, '鎶ヨ〃鍚堝苟', 'BASIC', 'excelMerge'),

--
Gitblit v1.8.0