Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -228,30 +228,6 @@ def display_glossary_grid(roleplaying_glossary):
|
|
228 |
|
229 |
|
230 |
|
231 |
-
def display_buttons_with_scores_old():
|
232 |
-
# Assuming generate_key, load_score, update_score, and search_glossary are defined elsewhere
|
233 |
-
for category, games in roleplaying_glossary.items():
|
234 |
-
st.markdown(f"## {category}")
|
235 |
-
for game, terms in games.items():
|
236 |
-
for term in terms:
|
237 |
-
# Construct a unique key for each term. This replaces the previous use of .index()
|
238 |
-
# The key now includes both the category and the game for uniqueness
|
239 |
-
key = f"{category}_{game}_{term}".replace(' ', '_').lower()
|
240 |
-
score = load_score(key) # Load the score based on the generated key
|
241 |
-
|
242 |
-
# Display a button for each term with its score
|
243 |
-
if st.button(f"{term} {score}🚀", key=key):
|
244 |
-
# If button is pressed, update score and possibly rerun the search or action
|
245 |
-
update_score(key)
|
246 |
-
# Adjust the search_glossary call as needed to match the function's signature
|
247 |
-
# -------------------------- Call LLMs with the button content:
|
248 |
-
|
249 |
-
response = search_glossary('Create a three-level markdown outline with 3 subpoints each where each line defines and writes out the descriptions with appropriate emojis for the glossary term: ' + term, roleplaying_glossary)
|
250 |
-
|
251 |
-
|
252 |
-
#st.experimental_rerun()
|
253 |
-
|
254 |
-
|
255 |
game_emojis = {
|
256 |
"Dungeons and Dragons": "🐉",
|
257 |
"Call of Cthulhu": "🐙",
|
|
|
228 |
|
229 |
|
230 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
231 |
game_emojis = {
|
232 |
"Dungeons and Dragons": "🐉",
|
233 |
"Call of Cthulhu": "🐙",
|