Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -11,7 +11,7 @@ import toml
|
|
| 11 |
|
| 12 |
# Function to update config.toml file
|
| 13 |
def update_secrets_file(data):
|
| 14 |
-
secrets_file_path = ".streamlit/
|
| 15 |
secrets_data = {}
|
| 16 |
|
| 17 |
# Load existing data from secrets.toml
|
|
@@ -23,13 +23,13 @@ def update_secrets_file(data):
|
|
| 23 |
secrets_data.update(data)
|
| 24 |
|
| 25 |
# Write updated data back to secrets.toml
|
| 26 |
-
with open(secrets_file_path, "
|
| 27 |
toml.dump(secrets_data, file)
|
| 28 |
|
| 29 |
|
| 30 |
# Initialize database connections
|
| 31 |
def init_databases():
|
| 32 |
-
secrets_file_path = ".streamlit/
|
| 33 |
secrets_data = {}
|
| 34 |
if os.path.exists(secrets_file_path):
|
| 35 |
with open(secrets_file_path, "r") as file:
|
|
@@ -253,4 +253,4 @@ if user_query is not None and user_query.strip() != "":
|
|
| 253 |
response = get_response(user_query, st.session_state.dbs, st.session_state.chat_history, st.session_state.llm)
|
| 254 |
st.markdown(response)
|
| 255 |
|
| 256 |
-
st.session_state.chat_history.append(AIMessage(content=response))
|
|
|
|
| 11 |
|
| 12 |
# Function to update config.toml file
|
| 13 |
def update_secrets_file(data):
|
| 14 |
+
secrets_file_path = ".streamlit/config.toml"
|
| 15 |
secrets_data = {}
|
| 16 |
|
| 17 |
# Load existing data from secrets.toml
|
|
|
|
| 23 |
secrets_data.update(data)
|
| 24 |
|
| 25 |
# Write updated data back to secrets.toml
|
| 26 |
+
with open(secrets_file_path, "a") as file:
|
| 27 |
toml.dump(secrets_data, file)
|
| 28 |
|
| 29 |
|
| 30 |
# Initialize database connections
|
| 31 |
def init_databases():
|
| 32 |
+
secrets_file_path = ".streamlit/config.toml"
|
| 33 |
secrets_data = {}
|
| 34 |
if os.path.exists(secrets_file_path):
|
| 35 |
with open(secrets_file_path, "r") as file:
|
|
|
|
| 253 |
response = get_response(user_query, st.session_state.dbs, st.session_state.chat_history, st.session_state.llm)
|
| 254 |
st.markdown(response)
|
| 255 |
|
| 256 |
+
st.session_state.chat_history.append(AIMessage(content=response))
|