From e3386778969b2c6ad5e9134a199f8b15e9b59fca Mon Sep 17 00:00:00 2001 From: pablodanswer Date: Wed, 27 Nov 2024 12:16:42 -0800 Subject: [PATCH] order seeding --- backend/danswer/seeding/load_yamls.py | 1 + backend/danswer/setup.py | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/backend/danswer/seeding/load_yamls.py b/backend/danswer/seeding/load_yamls.py index 0046352679c..c93851dd5c0 100644 --- a/backend/danswer/seeding/load_yamls.py +++ b/backend/danswer/seeding/load_yamls.py @@ -81,6 +81,7 @@ def load_personas_from_yaml( p_id = persona.get("id") tool_ids = [] + if persona.get("image_generation"): image_gen_tool = ( db_session.query(ToolDBModel) diff --git a/backend/danswer/setup.py b/backend/danswer/setup.py index 99173821a45..f86d0f35414 100644 --- a/backend/danswer/setup.py +++ b/backend/danswer/setup.py @@ -254,13 +254,14 @@ def setup_postgres(db_session: Session) -> None: create_initial_public_credential(db_session) create_initial_default_connector(db_session) associate_default_cc_pair(db_session) - - logger.notice("Loading default Prompts and Personas") delete_old_default_personas(db_session) - load_chat_yamls(db_session) logger.notice("Loading built-in tools") load_builtin_tools(db_session) + + logger.notice("Loading default Prompts and Personas") + load_chat_yamls(db_session) + refresh_built_in_tools_cache(db_session) auto_add_search_tool_to_personas(db_session)