Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,6 +5,10 @@ import requests
|
|
| 5 |
import os
|
| 6 |
from datetime import datetime
|
| 7 |
import json
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
# Function to load YAML files
|
| 10 |
def load_yaml_file(file_path):
|
|
@@ -126,7 +130,7 @@ with tabs[5]:
|
|
| 126 |
# Select and edit prompts
|
| 127 |
prompt_keys = list(chatbot_prompts.keys())
|
| 128 |
selected_prompt_key = st.selectbox("Select a prompt to edit", prompt_keys)
|
| 129 |
-
selected_prompt_text = st.text_area("Prompt Text", chatbot_prompts[selected_prompt_key], height=200)
|
| 130 |
|
| 131 |
# Save prompt button
|
| 132 |
if st.button("Save Prompt"):
|
|
|
|
| 5 |
import os
|
| 6 |
from datetime import datetime
|
| 7 |
import json
|
| 8 |
+
import secrets
|
| 9 |
+
|
| 10 |
+
def generate_random_key():
|
| 11 |
+
return secrets.token_hex(8) # Generates a 16-character hexadecimal string
|
| 12 |
|
| 13 |
# Function to load YAML files
|
| 14 |
def load_yaml_file(file_path):
|
|
|
|
| 130 |
# Select and edit prompts
|
| 131 |
prompt_keys = list(chatbot_prompts.keys())
|
| 132 |
selected_prompt_key = st.selectbox("Select a prompt to edit", prompt_keys)
|
| 133 |
+
selected_prompt_text = st.text_area("Prompt Text", chatbot_prompts[selected_prompt_key], height=200, key=generate_random_key())
|
| 134 |
|
| 135 |
# Save prompt button
|
| 136 |
if st.button("Save Prompt"):
|