From 39bade10a3d7bc89fa5f37c9a0130ac7d5051719 Mon Sep 17 00:00:00 2001 From: zhaoqingang <zhaoqg0118@163.com> Date: 星期四, 13 二月 2025 13:54:09 +0800 Subject: [PATCH] Merge branch 'master' of http://192.168.5.5:10010/r/rag-gateway into develop_2.1 --- app/task/fetch_agent.py | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/task/fetch_agent.py b/app/task/fetch_agent.py index f394dc2..bee4790 100644 --- a/app/task/fetch_agent.py +++ b/app/task/fetch_agent.py @@ -8,7 +8,7 @@ from sqlalchemy.orm import sessionmaker, Session from app.config.config import settings -from app.config.const import RAGFLOW, BISHENG, DIFY, ENV_CONF_PATH +from app.config.const import RAGFLOW, BISHENG, DIFY, ENV_CONF_PATH, Dialog_STATSU_DELETE, Dialog_STATSU_ON from app.models import KnowledgeModel from app.models.dialog_model import DialogModel from app.models.user_model import UserAppModel @@ -296,6 +296,10 @@ existing_agent.name = row["name"] existing_agent.description = row["description"] existing_agent.mode = row["mode"] + if existing_agent.status == Dialog_STATSU_DELETE: + existing_agent.status = Dialog_STATSU_ON + if row["parameters"]: + existing_agent.parameters = json.dumps(row["parameters"]) else: existing = DialogModel(id=row["id"], status=row["status"], name=row["name"], description=row["description"], @@ -306,7 +310,7 @@ for dialog in db.query(DialogModel).filter_by(dialog_type=dialog_type).all(): if dialog.id not in agent_id_list: # print(dialog.id) - db.query(DialogModel).filter_by(id=dialog.id).update({"status": "2"}) + db.query(DialogModel).filter_by(id=dialog.id).update({"status": Dialog_STATSU_DELETE}) db.commit() except IntegrityError: db.rollback() -- Gitblit v1.8.0