|
1 | 1 | import streamlit as st |
2 | 2 | import yaml |
3 | | -from utils import load_yaml_file, load_yaml_file_with_db_prompts |
| 3 | +from utils import load_yaml_file, load_yaml_file_with_db_prompts, get_prompt_from_file |
4 | 4 | from database import create_connection, create_prompts_table, save_prompt, get_prompt |
5 | 5 | from menu import menu_with_redirect |
6 | 6 |
|
@@ -31,8 +31,8 @@ def load_default_prompts(): |
31 | 31 | try: |
32 | 32 | config_data = load_yaml_file("config.yaml") |
33 | 33 | return { |
34 | | - "system_prompt": config_data.get("system_prompt", ""), |
35 | | - "query_rewriting_prompt": config_data.get("query_rewriting_prompt", "") |
| 34 | + "system_prompt": get_prompt_from_file(config_data.get("system_prompt", "")), |
| 35 | + "query_rewriting_prompt": get_prompt_from_file(config_data.get("query_rewriting_prompt", "")) |
36 | 36 | } |
37 | 37 | except Exception as e: |
38 | 38 | st.error(f"Error loading config file: {e}") |
@@ -90,8 +90,8 @@ def load_prompts_from_db(): |
90 | 90 | # Use the utility function that loads from database with config fallback |
91 | 91 | config_data = load_yaml_file_with_db_prompts("config.yaml") |
92 | 92 | st.session_state.current_prompts = { |
93 | | - "system_prompt": config_data.get("system_prompt", ""), |
94 | | - "query_rewriting_prompt": config_data.get("query_rewriting_prompt", "") |
| 93 | + "system_prompt": get_prompt_from_file(config_data.get("system_prompt", "")), |
| 94 | + "query_rewriting_prompt": get_prompt_from_file(config_data.get("query_rewriting_prompt", "")) |
95 | 95 | } |
96 | 96 |
|
97 | 97 | # Create columns for better layout |
|
0 commit comments