From 32197f248ac761a74e9a2384d008c184330b1bfc Mon Sep 17 00:00:00 2001 From: zhaoqingang <zhaoqg0118@163.com> Date: 星期三, 25 十二月 2024 18:10:53 +0800 Subject: [PATCH] Merge branch 'master' of http://192.168.5.5:10010/r/rag-gateway --- main.py | 11 ++++++----- 1 files changed, 6 insertions(+), 5 deletions(-) diff --git a/main.py b/main.py index 3a45216..86cb9f0 100644 --- a/main.py +++ b/main.py @@ -22,18 +22,19 @@ from app.api.user import user_router from app.api.group import group_router from app.api.role import role_router +from app.models.base_model import init_db # from app.models.base_model import init_db from app.task.fetch_agent import sync_agents, initialize_agents, sync_agents_v2, sync_knowledge from app.init_config.init_run_data import sync_default_data - +init_db() # 浣跨敤 Lifespan 浜嬩欢澶勭悊绋嬪簭 @asynccontextmanager async def lifespan(app: FastAPI): # 鍒濆鍖栦唬鐞� - initialize_agents() - # 鍦ㄥ簲鐢ㄥ惎鍔ㄦ椂鍚屾浠g悊 - sync_agents() + # initialize_agents() + # # 鍦ㄥ簲鐢ㄥ惎鍔ㄦ椂鍚屾浠g悊 + # sync_agents() await sync_default_data() sync_agents_v2() @@ -42,7 +43,7 @@ # 鍦ㄥ簲鐢ㄥ叧闂椂鎵ц娓呯悊鎿嶄綔锛堝鏋滈渶瑕侊級 pass -# init_db() + app = FastAPI( title="basic_rag_gateway", version="0.1", -- Gitblit v1.8.0