awacke1 commited on
Commit
d4e9457
β€’
1 Parent(s): 264f77f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +48 -40
app.py CHANGED
@@ -42,11 +42,6 @@ st.set_page_config(
42
  }
43
  )
44
 
45
- # Prompts for App, for App Product, and App Product Code
46
- PromptPrefix = 'Create a graphic novel story with streamlit markdown outlines and tables with appropriate emojis for graphic novel rules defining the method steps of play. Use story structure architect rules using plan, structure and top three dramatic situations matching the theme for topic of '
47
- PromptPrefix2 = 'Create a streamlit python user app with full code listing to create a UI implementing the usable choose your own adventure graphic novel rules and story using streamlit, session_state, file_uploader, camera_input, on_change = funcction callbacks, randomness and dice rolls using emojis and st.markdown, st.expander, st.columns and other UI controls in streamlit as a game interface and create inline data tables for entities implemented as variables with python list dictionaries for the game rule entities and stats. Design it as a fun data driven app and show full python code listing for this ruleset and thematic story plot line: '
48
- PromptPrefix3 = 'Create a HTML5 aframe and javascript app. Show full code listing. Add a list of new random entities say 3 of a few different types or classes like profession or class or modern character type. Use appropriate emojis in labels. Create a UI implementing storytelling, features using use three emoji appropriate text detailed plot twists and recurring interesting named characters with genius traits and file IO, randomness, ten point choice lists, math distribution tradeoffs, witty humorous dilemnas with emoji , rewards, variables, reusable functions with parameters, and data driven app with python libraries and streamlit components for Javascript and HTML5. Use appropriate emojis for labels to summarize and list parts, function, conditions for topic:'
49
-
50
  # Title and Help/About
51
  st.markdown('''### πŸ“–βœ¨πŸ” GraphicNovelAI ''')
52
 
@@ -166,6 +161,54 @@ roleplaying_glossary = {
166
  # Set initial page and app configs ------------------------------------------
167
 
168
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
169
  # HTML5 based Speech Synthesis (Text to Speech in Browser)
170
  @st.cache_resource
171
  def SpeechSynthesis(result):
@@ -443,42 +486,7 @@ def display_glossary(glossary, area):
443
  st.write(f"{idx}. {term}")
444
 
445
 
446
- # Function to display the entire glossary in a grid format with links
447
- def display_glossary_grid(roleplaying_glossary):
448
- search_urls = {
449
- "πŸ“–": lambda k: f"https://en.wikipedia.org/wiki/{quote(k)}",
450
- "πŸ”": lambda k: f"https://www.google.com/search?q={quote(k)}",
451
- "▢️": lambda k: f"https://www.youtube.com/results?search_query={quote(k)}",
452
- "πŸ”Ž": lambda k: f"https://www.bing.com/search?q={quote(k)}",
453
- "🎲": lambda k: f"https://huggingface.co/spaces/awacke1/GraphicAINovel?q={quote(k)}", # this url plus query!
454
- "πŸƒ": lambda k: f"https://huggingface.co/spaces/awacke1/GraphicAINovel?q={quote(PromptPrefix)}{quote(k)}", # this url plus query!
455
- "πŸ“š": lambda k: f"https://huggingface.co/spaces/awacke1/GraphicAINovel?q={quote(PromptPrefix2)}{quote(k)}", # this url plus query!
456
- "πŸ“š": lambda k: f"https://huggingface.co/spaces/awacke1/GraphicAINovel?q={quote(PromptPrefix3)}{quote(k)}", # this url plus query!
457
- }
458
 
459
- for category, details in roleplaying_glossary.items():
460
- st.write(f"### {category}")
461
- cols = st.columns(len(details)) # Create dynamic columns based on the number of games
462
- for idx, (game, terms) in enumerate(details.items()):
463
- with cols[idx]:
464
- st.markdown(f"#### {game}")
465
- for term in terms:
466
- links_md = ' '.join([f"[{emoji}]({url(term)})" for emoji, url in search_urls.items()])
467
- st.markdown(f"{term} {links_md}", unsafe_allow_html=True)
468
-
469
- def display_glossary_entity(k):
470
- search_urls = {
471
- "πŸ“–": lambda k: f"https://en.wikipedia.org/wiki/{quote(k)}",
472
- "πŸ”": lambda k: f"https://www.google.com/search?q={quote(k)}",
473
- "▢️": lambda k: f"https://www.youtube.com/results?search_query={quote(k)}",
474
- "πŸ”Ž": lambda k: f"https://www.bing.com/search?q={quote(k)}",
475
- "🎲": lambda k: f"https://huggingface.co/spaces/awacke1/GraphicAINovel?q={quote(k)}", # this url plus query!
476
- "πŸƒ": lambda k: f"https://huggingface.co/spaces/awacke1/GraphicAINovel?q={quote(PromptPrefix)}{quote(k)}", # this url plus query!
477
- "πŸ“š": lambda k: f"https://huggingface.co/spaces/awacke1/GraphicAINovel?q={quote(PromptPrefix2)}{quote(k)}", # this url plus query!
478
- "πŸ“š": lambda k: f"https://huggingface.co/spaces/awacke1/GraphicAINovel?q={quote(PromptPrefix3)}{quote(k)}", # this url plus query!
479
- }
480
- links_md = ' '.join([f"[{emoji}]({url(k)})" for emoji, url in search_urls.items()])
481
- st.markdown(f"{k} {links_md}", unsafe_allow_html=True)
482
 
483
 
484
  game_emojis = {
 
42
  }
43
  )
44
 
 
 
 
 
 
45
  # Title and Help/About
46
  st.markdown('''### πŸ“–βœ¨πŸ” GraphicNovelAI ''')
47
 
 
161
  # Set initial page and app configs ------------------------------------------
162
 
163
 
164
+ # Prompts for App, for App Product, and App Product Code
165
+ PromptPrefix = 'Create a graphic novel story with streamlit markdown outlines and tables with appropriate emojis for graphic novel rules defining the method steps of play. Use story structure architect rules using plan, structure and top three dramatic situations matching the theme for topic of '
166
+ PromptPrefix2 = 'Create a streamlit python user app with full code listing to create a UI implementing the usable choose your own adventure graphic novel rules and story using streamlit, session_state, file_uploader, camera_input, on_change = funcction callbacks, randomness and dice rolls using emojis and st.markdown, st.expander, st.columns and other UI controls in streamlit as a game interface and create inline data tables for entities implemented as variables with python list dictionaries for the game rule entities and stats. Design it as a fun data driven app and show full python code listing for this ruleset and thematic story plot line: '
167
+ PromptPrefix3 = 'Create a HTML5 aframe and javascript app. Show full code listing. Add a list of new random entities say 3 of a few different types or classes like profession or class or modern character type. Use appropriate emojis in labels. Create a UI implementing storytelling, features using use three emoji appropriate text detailed plot twists and recurring interesting named characters with genius traits and file IO, randomness, ten point choice lists, math distribution tradeoffs, witty humorous dilemnas with emoji , rewards, variables, reusable functions with parameters, and data driven app with python libraries and streamlit components for Javascript and HTML5. Use appropriate emojis for labels to summarize and list parts, function, conditions for topic:'
168
+
169
+
170
+ # Function to display the entire glossary in a grid format with links
171
+ def display_glossary_grid(roleplaying_glossary):
172
+ search_urls = {
173
+ "πŸ“–": lambda k: f"https://en.wikipedia.org/wiki/{quote(k)}",
174
+ "πŸ”": lambda k: f"https://www.google.com/search?q={quote(k)}",
175
+ "▢️": lambda k: f"https://www.youtube.com/results?search_query={quote(k)}",
176
+ "πŸ”Ž": lambda k: f"https://www.bing.com/search?q={quote(k)}",
177
+ "🐦": lambda k: f"https://twitter.com/search?q={quote(k)}",
178
+ "🎲": lambda k: f"https://huggingface.co/spaces/awacke1/GraphicAINovel?q={quote(k)}", # this url plus query!
179
+ "πŸƒ": lambda k: f"https://huggingface.co/spaces/awacke1/GraphicAINovel?q={quote(PromptPrefix)}{quote(k)}", # this url plus query!
180
+ "πŸ“š": lambda k: f"https://huggingface.co/spaces/awacke1/GraphicAINovel?q={quote(PromptPrefix2)}{quote(k)}", # this url plus query!
181
+ "πŸ“š": lambda k: f"https://huggingface.co/spaces/awacke1/GraphicAINovel?q={quote(PromptPrefix3)}{quote(k)}", # this url plus query!
182
+ }
183
+
184
+ for category, details in roleplaying_glossary.items():
185
+ st.write(f"### {category}")
186
+ cols = st.columns(len(details)) # Create dynamic columns based on the number of games
187
+ for idx, (game, terms) in enumerate(details.items()):
188
+ with cols[idx]:
189
+ st.markdown(f"#### {game}")
190
+ for term in terms:
191
+ links_md = ' '.join([f"[{emoji}]({url(term)})" for emoji, url in search_urls.items()])
192
+ st.markdown(f"{term} {links_md}", unsafe_allow_html=True)
193
+
194
+ def display_glossary_entity(k):
195
+ search_urls = {
196
+ "πŸ“–": lambda k: f"https://en.wikipedia.org/wiki/{quote(k)}",
197
+ "πŸ”": lambda k: f"https://www.google.com/search?q={quote(k)}",
198
+ "▢️": lambda k: f"https://www.youtube.com/results?search_query={quote(k)}",
199
+ "πŸ”Ž": lambda k: f"https://www.bing.com/search?q={quote(k)}",
200
+ "🐦": lambda k: f"https://twitter.com/search?q={quote(k)}",
201
+ "🎲": lambda k: f"https://huggingface.co/spaces/awacke1/GraphicAINovel?q={quote(k)}", # this url plus query!
202
+ "πŸƒ": lambda k: f"https://huggingface.co/spaces/awacke1/GraphicAINovel?q={quote(PromptPrefix)}{quote(k)}", # this url plus query!
203
+ "πŸ“š": lambda k: f"https://huggingface.co/spaces/awacke1/GraphicAINovel?q={quote(PromptPrefix2)}{quote(k)}", # this url plus query!
204
+ "πŸ“š": lambda k: f"https://huggingface.co/spaces/awacke1/GraphicAINovel?q={quote(PromptPrefix3)}{quote(k)}", # this url plus query!
205
+ }
206
+ links_md = ' '.join([f"[{emoji}]({url(k)})" for emoji, url in search_urls.items()])
207
+ st.markdown(f"{k} {links_md}", unsafe_allow_html=True)
208
+
209
+
210
+
211
+
212
  # HTML5 based Speech Synthesis (Text to Speech in Browser)
213
  @st.cache_resource
214
  def SpeechSynthesis(result):
 
486
  st.write(f"{idx}. {term}")
487
 
488
 
 
 
 
 
 
 
 
 
 
 
 
 
489
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
490
 
491
 
492
  game_emojis = {