awacke1 commited on
Commit
7f54190
β€’
1 Parent(s): cd65b46

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -122
app.py CHANGED
@@ -240,9 +240,7 @@ def display_images_and_wikipedia_summaries():
240
  for image_file in image_files:
241
  image = Image.open(image_file)
242
  st.image(image, caption=image_file, use_column_width=True)
243
-
244
- keyword = image_file.split('.')[0] # Assumes keyword is the file name without extension
245
-
246
  # Display Wikipedia and Google search links
247
  wikipedia_url = create_search_url_wikipedia(keyword)
248
  google_url = create_search_url_google(keyword)
@@ -255,7 +253,11 @@ def display_images_and_wikipedia_summaries():
255
  [YouTube]({youtube_url}) |
256
  [Bing]({bing_url})
257
  """
258
- st.markdown(links_md)
 
 
 
 
259
 
260
 
261
  def get_all_query_params(key):
@@ -398,52 +400,6 @@ key = os.getenv('OPENAI_API_KEY')
398
  prompt = f"Write instructions to teach discharge planning along with guidelines and patient education. List entities, features and relationships to CCDA and FHIR objects in boldface."
399
  should_save = st.sidebar.checkbox("πŸ’Ύ Save", value=True, help="Save your session data.")
400
 
401
- # 2. Prompt label button demo for LLM
402
- def add_witty_humor_buttons():
403
- with st.expander("Wit and Humor 🀣", expanded=True):
404
- # Tip about the Dromedary family
405
- st.markdown("πŸ”¬ **Fun Fact**: Dromedaries, part of the camel family, have a single hump and are adapted to arid environments. Their 'superpowers' include the ability to survive without water for up to 7 days, thanks to their specialized blood cells and water storage in their hump.")
406
-
407
- # Define button descriptions
408
- descriptions = {
409
- "Generate Limericks πŸ˜‚": "Write ten random adult limericks based on quotes that are tweet length and make you laugh 🎭",
410
- "Wise Quotes πŸ§™": "Generate ten wise quotes that are tweet length πŸ¦‰",
411
- "Funny Rhymes 🎀": "Create ten funny rhymes that are tweet length 🎢",
412
- "Medical Jokes πŸ’‰": "Create ten medical jokes that are tweet length πŸ₯",
413
- "Minnesota Humor ❄️": "Create ten jokes about Minnesota that are tweet length 🌨️",
414
- "Top Funny Stories πŸ“–": "Create ten funny stories that are tweet length πŸ“š",
415
- "More Funny Rhymes πŸŽ™οΈ": "Create ten more funny rhymes that are tweet length 🎡"
416
- }
417
-
418
- # Create columns
419
- col1, col2, col3 = st.columns([1, 1, 1], gap="small")
420
-
421
- # Add buttons to columns
422
- if col1.button("Wise Limericks πŸ˜‚"):
423
- StreamLLMChatResponse(descriptions["Generate Limericks πŸ˜‚"])
424
-
425
- if col2.button("Wise Quotes πŸ§™"):
426
- StreamLLMChatResponse(descriptions["Wise Quotes πŸ§™"])
427
-
428
- #if col3.button("Funny Rhymes 🎀"):
429
- # StreamLLMChatResponse(descriptions["Funny Rhymes 🎀"])
430
-
431
- col4, col5, col6 = st.columns([1, 1, 1], gap="small")
432
-
433
- if col4.button("Top Ten Funniest Clean Jokes πŸ’‰"):
434
- StreamLLMChatResponse(descriptions["Top Ten Funniest Clean Jokes πŸ’‰"])
435
-
436
- if col5.button("Minnesota Humor ❄️"):
437
- StreamLLMChatResponse(descriptions["Minnesota Humor ❄️"])
438
-
439
- if col6.button("Origins of Medical Science True Stories"):
440
- StreamLLMChatResponse(descriptions["Origins of Medical Science True Stories"])
441
-
442
- col7 = st.columns(1, gap="small")
443
-
444
- if col7[0].button("Top Ten Best Write a streamlit python program prompts to build AI programs. πŸŽ™οΈ"):
445
- StreamLLMChatResponse(descriptions["Top Ten Best Write a streamlit python program prompts to build AI programs. πŸŽ™οΈ"])
446
-
447
  def SpeechSynthesis(result):
448
  documentHTML5='''
449
  <!DOCTYPE html>
@@ -905,76 +861,6 @@ def StreamMedChatResponse(topic):
905
 
906
 
907
 
908
- def add_medical_exam_buttons():
909
- # Medical exam terminology descriptions
910
- descriptions = {
911
- "White Blood Cells 🌊": "3 Q&A with emojis about types, facts, function, inputs and outputs of white blood cells πŸŽ₯",
912
- "CT Imaging🦠": "3 Q&A with emojis on CT Imaging post surgery, how to, what to look for πŸ’Š",
913
- "Hematoma πŸ’‰": "3 Q&A with emojis about hematoma and infection care and study including bacteria cultures and tests or labsπŸ’ͺ",
914
- "Post Surgery Wound Care 🍌": "3 Q&A with emojis on wound care, and good bedside manner 🩸",
915
- "Healing and humor πŸ’Š": "3 Q&A with emojis on stories and humor about healing and caregiving πŸš‘",
916
- "Psychology of bedside manner 🧬": "3 Q&A with emojis on bedside manner and how to make patients feel at easeπŸ› ",
917
- "CT scan πŸ’Š": "3 Q&A with analysis on infection using CT scan and packing for skin, cellulitus and fascia 🩺"
918
- }
919
-
920
- # Expander for medical topics
921
- with st.expander("Medical Licensing Exam Topics πŸ“š", expanded=False):
922
- st.markdown("🩺 **Important**: Variety of topics for medical licensing exams.")
923
-
924
- # Create buttons for each description with unique keys
925
- for idx, (label, content) in enumerate(descriptions.items()):
926
- button_key = f"button_{idx}"
927
- if st.button(label, key=button_key):
928
- st.write(f"Running {label}")
929
- input='Create markdown outline for definition of topic ' + label + ' also short quiz with appropriate emojis and definitions for: ' + content
930
- response=StreamLLMChatResponse(input)
931
- filename = generate_filename(response, 'txt')
932
- create_file(filename, input, response, should_save)
933
-
934
- def add_medical_exam_buttons2():
935
- with st.expander("Medical Licensing Exam Topics πŸ“š", expanded=False):
936
- st.markdown("🩺 **Important**: This section provides a variety of medical topics that are often encountered in medical licensing exams.")
937
-
938
- # Define medical exam terminology descriptions
939
- descriptions = {
940
- "White Blood Cells 🌊": "3 Questions and Answers with emojis about white blood cells πŸŽ₯",
941
- "CT Imaging🦠": "3 Questions and Answers with emojis about CT Imaging of post surgery abscess, hematoma, and cerosanguiness fluid πŸ’Š",
942
- "Hematoma πŸ’‰": "3 Questions and Answers with emojis about hematoma and infection and how heat helps white blood cells πŸ’ͺ",
943
- "Post Surgery Wound Care 🍌": "3 Questions and Answers with emojis about wound care and how to help as a caregiver🩸",
944
- "Healing and humor πŸ’Š": "3 Questions and Answers with emojis on the use of stories and humor to help patients and family πŸš‘",
945
- "Psychology of bedside manner 🧬": "3 Questions and Answers with emojis about good bedside manner πŸ› ",
946
- "CT scan πŸ’Š": "3 Questions and Answers with analysis of bacteria and understanding infection using cultures and CT scan 🩺"
947
- }
948
-
949
- # Create columns
950
- col1, col2, col3, col4 = st.columns([1, 1, 1, 1], gap="small")
951
-
952
- # Add buttons to columns
953
- if col1.button("Ultrasound with Doppler 🌊"):
954
- StreamLLMChatResponse(descriptions["Ultrasound with Doppler 🌊"])
955
-
956
- if col2.button("Oseltamivir 🦠"):
957
- StreamLLMChatResponse(descriptions["Oseltamivir 🦠"])
958
-
959
- if col3.button("IM Epinephrine πŸ’‰"):
960
- StreamLLMChatResponse(descriptions["IM Epinephrine πŸ’‰"])
961
-
962
- if col4.button("Hypokalemia 🍌"):
963
- StreamLLMChatResponse(descriptions["Hypokalemia 🍌"])
964
-
965
- col5, col6, col7, col8 = st.columns([1, 1, 1, 1], gap="small")
966
-
967
- if col5.button("Succinylcholine πŸ’Š"):
968
- StreamLLMChatResponse(descriptions["Succinylcholine πŸ’Š"])
969
-
970
- if col6.button("Phosphoinositol System 🧬"):
971
- StreamLLMChatResponse(descriptions["Phosphoinositol System 🧬"])
972
-
973
- if col7.button("Ramipril πŸ’Š"):
974
- StreamLLMChatResponse(descriptions["Ramipril πŸ’Š"])
975
-
976
-
977
-
978
  # 17. Main
979
  def main():
980
  prompt = f"Write ten funny jokes that are tweet length stories that make you laugh. Show as markdown outline with emojis for each."
@@ -1242,15 +1128,19 @@ def main():
1242
  st.markdown('No glossary lookup')
1243
 
1244
  # Display the glossary grid
 
 
 
 
 
1245
  st.title("Card Games Glossary 🎲")
1246
  display_glossary_grid(roleplaying_glossary)
 
1247
  st.title("πŸŽ²πŸ—ΊοΈ Card Game Universe")
1248
  st.markdown("## Explore the vast universes of Dungeons and Dragons, Call of Cthulhu, GURPS, and more through interactive storytelling and encyclopedic knowledge.🌠")
1249
 
1250
  display_buttons_with_scores()
1251
 
1252
- display_images_and_wikipedia_summaries()
1253
-
1254
  # Assuming the transhuman_glossary and other setup code remains the same
1255
  #st.write("Current Query Parameters:", st.query_params)
1256
  #st.markdown("### Query Parameters - These Deep Link Map to Remixable Methods, Navigate or Trigger Functionalities")
 
240
  for image_file in image_files:
241
  image = Image.open(image_file)
242
  st.image(image, caption=image_file, use_column_width=True)
243
+
 
 
244
  # Display Wikipedia and Google search links
245
  wikipedia_url = create_search_url_wikipedia(keyword)
246
  google_url = create_search_url_google(keyword)
 
253
  [YouTube]({youtube_url}) |
254
  [Bing]({bing_url})
255
  """
256
+ st.markdown("# " + links_md)
257
+
258
+ keyword = image_file.split('.')[0] # Assumes keyword is the file name without extension
259
+
260
+
261
 
262
 
263
  def get_all_query_params(key):
 
400
  prompt = f"Write instructions to teach discharge planning along with guidelines and patient education. List entities, features and relationships to CCDA and FHIR objects in boldface."
401
  should_save = st.sidebar.checkbox("πŸ’Ύ Save", value=True, help="Save your session data.")
402
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
403
  def SpeechSynthesis(result):
404
  documentHTML5='''
405
  <!DOCTYPE html>
 
861
 
862
 
863
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
864
  # 17. Main
865
  def main():
866
  prompt = f"Write ten funny jokes that are tweet length stories that make you laugh. Show as markdown outline with emojis for each."
 
1128
  st.markdown('No glossary lookup')
1129
 
1130
  # Display the glossary grid
1131
+
1132
+
1133
+
1134
+ display_images_and_wikipedia_summaries()
1135
+
1136
  st.title("Card Games Glossary 🎲")
1137
  display_glossary_grid(roleplaying_glossary)
1138
+
1139
  st.title("πŸŽ²πŸ—ΊοΈ Card Game Universe")
1140
  st.markdown("## Explore the vast universes of Dungeons and Dragons, Call of Cthulhu, GURPS, and more through interactive storytelling and encyclopedic knowledge.🌠")
1141
 
1142
  display_buttons_with_scores()
1143
 
 
 
1144
  # Assuming the transhuman_glossary and other setup code remains the same
1145
  #st.write("Current Query Parameters:", st.query_params)
1146
  #st.markdown("### Query Parameters - These Deep Link Map to Remixable Methods, Navigate or Trigger Functionalities")