Spaces:
Runtime error
Runtime error
| import streamlit as st | |
| import streamlit.components.v1 as components | |
| # Function to generate HTML with textarea | |
| def generate_html_with_textarea(text_to_speak): | |
| return f''' | |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Read It Aloud</title> | |
| <script type="text/javascript"> | |
| function readAloud() {{ | |
| const text = document.getElementById("textArea").value; | |
| const speech = new SpeechSynthesisUtterance(text); | |
| window.speechSynthesis.speak(speech); | |
| }} | |
| </script> | |
| </head> | |
| <body> | |
| <h1>π Read It Aloud</h1> | |
| <textarea id="textArea" rows="10" cols="80">{text_to_speak}</textarea> | |
| <br> | |
| <button onclick="readAloud()">π Read Aloud</button> | |
| </body> | |
| </html> | |
| ''' | |
| def triage_checkin(): | |
| st.write("### Triage and Check-in Expert π") | |
| for i in range(1, 4): | |
| st.text_input(f"Question {i} for Triage") | |
| #List 10 responsibilities with emojis for experience needed to do: Triage and Check-in Expert | |
| text_to_speak = """ | |
| As a triage and check-in expert, you will be responsible for ensuring that patients are properly assessed and checked in for their appointments. This involves a range of tasks, including: | |
| 1. π Assessing patient symptoms and medical history to determine the appropriate triage category (e.g. emergency, urgent, routine) and assigning a triage score. | |
| 2. π Entering patient information into the electronic medical record (EMR) and updating it as necessary. | |
| 3. π Verifying patient insurance information and ensuring that it is up-to-date. | |
| 4. π Contacting patients to confirm appointments and provide reminders. | |
| 5. π Securing patient information and maintaining confidentiality. | |
| 6. π Monitoring patient flow and identifying areas for improvement in the check-in process. | |
| 7. π‘ Providing excellent customer service and resolving any issues that may arise. | |
| 8. π Maintaining accurate and up-to-date records of patient encounters. | |
| 9. π Participating in quality improvement initiatives to improve the efficiency and effectiveness of the triage and check-in process. | |
| 10. π Collaborating with other healthcare professionals to ensure smooth patient flow and coordination of care. | |
| """ | |
| html5=generate_html_with_textarea(text_to_speak) | |
| components.html(html5, width=1280, height=1024) | |
| def lab_analyst(): | |
| st.write("### Lab Analyst π§ͺ") | |
| for i in range(1, 4): | |
| st.text_input(f"Question {i} for Lab Analysis") | |
| #List 10 responsibilities with emojis for experience needed to do: | |
| text_to_speak = """ | |
| Lab Analysts play a crucial role in the scientific analysis of samples. Responsibilities will include: | |
| 1. π¬ Conducting complex tests and experiments on various samples. | |
| 2. π Analyzing and interpreting data to make informed decisions. | |
| 3. π§ͺ Preparing reagents and samples for testing. | |
| 4. π» Utilizing specialized laboratory software for data entry and analysis. | |
| 5. π Keeping abreast of latest industry developments and scientific literature. | |
| 6. π Maintaining and calibrating lab equipment to ensure accuracy. | |
| 7. π Following stringent safety and quality control procedures. | |
| 8. π€ Collaborating with fellow scientists and researchers. | |
| 9. π Preparing detailed reports on findings and recommendations. | |
| 10. π Staying updated with continuing education in the field. | |
| """ | |
| html5=generate_html_with_textarea(text_to_speak) | |
| components.html(html5, width=1280, height=1024) | |
| def medicine_specialist(): | |
| st.write("### Medicine Specialist π") | |
| for i in range(1, 4): | |
| st.text_input(f"Question {i} for Medicine") | |
| #List 10 responsibilities with emojis for experience needed to do: | |
| text_to_speak = """ | |
| As a Medicine Specialist, your role is pivotal in providing expert medical care. Your responsibilities include: | |
| 1. π©Ί Diagnosing and treating complex medical conditions. | |
| 2. π§ββοΈ Providing specialized patient care and management. | |
| 3. π Prescribing medications and monitoring their effects. | |
| 4. π Conducting thorough patient assessments and medical histories. | |
| 5. π€ Collaborating with other healthcare professionals for comprehensive patient care. | |
| 6. π Keeping up-to-date with advancements in medical treatments and technologies. | |
| 7. π Developing treatment plans based on up-to-date medical knowledge. | |
| 8. π£οΈ Communicating effectively with patients and their families about medical conditions and treatment plans. | |
| 9. π Documenting all patient care and interactions accurately. | |
| 10. π§βπ« Educating patients about disease prevention and health maintenance. | |
| """ | |
| html5=generate_html_with_textarea(text_to_speak) | |
| components.html(html5, width=1280, height=1024) | |
| def service_expert(): | |
| st.write("### Service Expert π²") | |
| for i in range(1, 4): | |
| st.text_input(f"Question {i} for Service") | |
| #List 10 responsibilities with emojis for experience needed to do: | |
| text_to_speak = """ | |
| As a Service Expert π², your role is critical in ensuring customer satisfaction and maintaining service quality. Your responsibilities include: | |
| 1. π² Providing expert advice on products and services to customers. | |
| 2. π€ Building and maintaining strong customer relationships. | |
| 3. π Analyzing customer feedback to improve service quality. | |
| 4. π Developing strategies to increase customer satisfaction. | |
| 5. π Managing customer inquiries and resolving issues efficiently. | |
| 6. π Staying informed about new products and services. | |
| 7. πΌ Collaborating with the sales team to meet customer needs. | |
| 8. π οΈ Ensuring compliance with service standards and policies. | |
| 9. π Documenting customer interactions and transactions. | |
| 10. π Leading by example and setting high standards for customer service. | |
| """ | |
| html5=generate_html_with_textarea(text_to_speak) | |
| components.html(html5, width=1280, height=1024) | |
| def care_expert(): | |
| st.write("### Level of Care Expert π₯") | |
| for i in range(1, 4): | |
| st.text_input(f"Question {i} for Level of Care") | |
| #List 10 responsibilities with emojis for experience needed to do: | |
| text_to_speak = """ | |
| As a Level of Care Expert π₯, your role is essential in determining the appropriate level of care for patients. Your responsibilities include: | |
| 1. π₯ Evaluating patient conditions and needs to determine the suitable level of care. | |
| 2. π Developing and updating care plans in collaboration with healthcare teams. | |
| 3. π¬ Communicating effectively with patients and their families about care decisions. | |
| 4. π Analyzing patient data to ensure optimal care delivery. | |
| 5. π€ Coordinating with various healthcare professionals to provide integrated care. | |
| 6. π Staying informed about the latest healthcare policies and regulations. | |
| 7. π οΈ Identifying opportunities for improving care processes and patient outcomes. | |
| 8. π Monitoring and reporting on care quality metrics. | |
| 9. π Participating in educational programs to enhance professional knowledge. | |
| 10. π‘ Providing guidance and training to staff on care standards and practices. | |
| """ | |
| html5=generate_html_with_textarea(text_to_speak) | |
| components.html(html5, width=1280, height=1024) | |
| def terminology_expert(): | |
| st.write("### Terminology Expert π") | |
| for i in range(1, 4): | |
| st.text_input(f"Question {i} for Terminology") | |
| #List 10 responsibilities with emojis for experience needed to do: | |
| text_to_speak = """ | |
| As a Terminology Expert in Medical and Behavioral Health Care, your role involves a deep understanding of medical terminology and its application. Your responsibilities include: | |
| 1. π§ Mastering complex medical and behavioral health terminologies. | |
| 2. π Keeping up-to-date with the latest developments in medical language. | |
| 3. ποΈ Assisting in the creation and review of medical documentation for accuracy. | |
| 4. π€ Collaborating with healthcare professionals to ensure consistent use of terminology. | |
| 5. π‘ Providing training and support to staff on medical terminology. | |
| 6. π Analyzing and interpreting medical records for quality assurance. | |
| 7. π οΈ Developing resources and tools to aid in the understanding of medical terms. | |
| 8. π Standardizing terminology usage across various healthcare departments. | |
| 9. π Conducting research to expand the knowledge base of medical and behavioral health terms. | |
| 10. π£οΈ Acting as a consultant for terminology-related inquiries and issues. | |
| """ | |
| html5=generate_html_with_textarea(text_to_speak) | |
| components.html(html5, width=1280, height=1024) | |
| def cmo(): | |
| st.write("### Chief Medical Officer π©Ί") | |
| for i in range(1, 4): | |
| st.text_input(f"Question {i} for CMO") | |
| #List 10 responsibilities with emojis for experience needed to do: | |
| text_to_speak = """ | |
| As a Chief Medical Officer (CMO) π©Ί, you hold a crucial leadership position in the healthcare system. Your responsibilities include: | |
| 1. π©Ί Overseeing the delivery of medical care across the organization. | |
| 2. π Developing and implementing healthcare strategies and policies. | |
| 3. πΌ Leading clinical teams and ensuring the highest standards of patient care. | |
| 4. π€ Collaborating with other executives to align clinical and organizational goals. | |
| 5. π Staying informed about the latest healthcare trends and advancements. | |
| 6. π Ensuring compliance with healthcare laws, regulations, and standards. | |
| 7. π£οΈ Representing the medical staff in executive decision-making. | |
| 8. π Overseeing medical research and education programs. | |
| 9. π Monitoring and improving the quality of healthcare services. | |
| 10. π§ββοΈ Mentoring and developing healthcare professionals. | |
| """ | |
| html5=generate_html_with_textarea(text_to_speak) | |
| components.html(html5, width=1280, height=1024) | |
| def medical_director(): | |
| st.write("### Medical Director Team π’") | |
| for i in range(1, 4): | |
| st.text_input(f"Question {i} for Medical Director") | |
| #List 10 responsibilities with emojis for experience needed to do: | |
| text_to_speak = """ | |
| As part of the Medical Director Team π’, you play a pivotal role in shaping the healthcare services of the organization. Your responsibilities include: | |
| 1. π’ Leading and overseeing the medical department within the organization. | |
| 2. π Developing strategies to enhance patient care and healthcare services. | |
| 3. π€ Collaborating with other departments to integrate medical services with overall organizational goals. | |
| 4. πΌ Managing clinical staff, including hiring, training, and performance evaluations. | |
| 5. π Keeping abreast of the latest medical research and advancements to inform practice and policy. | |
| 6. π Monitoring and improving the quality and efficiency of medical services. | |
| 7. π£οΈ Acting as a liaison between the medical staff and executive management. | |
| 8. π Ensuring compliance with healthcare regulations and standards. | |
| 9. π Conducting regular reviews of clinical procedures and outcomes. | |
| 10. π§ββοΈ Providing mentorship and leadership to medical professionals within the team. | |
| """ | |
| html5=generate_html_with_textarea(text_to_speak) | |
| components.html(html5, width=1280, height=1024) | |
| def main(): | |
| st.title("10πMoEπMedical Mixture of Experts Model") | |
| st.write("Harness the power of AI with this specialized healthcare framework! π") | |
| st.write("#### In LLM Multi System Agents, we define a set of eight roles for achieving a mission, then benchmark performance across LLMs to find datasets with need alignment.") | |
| st.markdown("#### MTBench: https://huggingface.co/spaces/awacke1/MTBenchmarkForChatGPTMetricsScoring") | |
| role = st.selectbox("Select AI Role:", [ | |
| "Triage and Check-in Expert", | |
| "Lab Analyst", | |
| "Medicine Specialist", | |
| "Service Expert", | |
| "Level of Care Expert", | |
| "Terminology Expert", | |
| "Chief Medical Officer", | |
| "Medical Director Team" | |
| ]) | |
| if role == "Triage and Check-in Expert": | |
| triage_checkin() | |
| elif role == "Lab Analyst": | |
| lab_analyst() | |
| elif role == "Medicine Specialist": | |
| medicine_specialist() | |
| elif role == "Service Expert": | |
| service_expert() | |
| elif role == "Level of Care Expert": | |
| care_expert() | |
| elif role == "Terminology Expert": | |
| terminology_expert() | |
| elif role == "Chief Medical Officer": | |
| cmo() | |
| elif role == "Medical Director Team": | |
| medical_director() | |
| # Define Roles and their Descriptions | |
| roles = { | |
| "1. Coder": "π» Creates short python code functions to solve tasks.", | |
| "2. Humanities Expert": "π Focuses on arts, literature, history, and other humanities subjects.", | |
| "3. Analyst": "π€ Analyzes situations and provides logical solutions.", | |
| "4. Roleplay Expert": "π Specialized in mimicking behaviors or characters.", | |
| "5. Mathematician": "β Solves mathematical problems with precision.", | |
| "6. STEM Expert": "π¬ Specialized in Science, Technology, Engineering, and Mathematics tasks.", | |
| "7. Extraction Expert": "π Strictly sticks to facts and extracts concise information.", | |
| "8. Drafter": "π Exhibits expertise in generating textual content and narratives.", | |
| } | |
| # Streamlit UI | |
| st.title("AI Role Selector - CHARMSED π€β¨") | |
| st.markdown(""" | |
| ### Harness the power of AI with the CHARMSED framework. | |
| #### This suite of roles brings together a comprehensive set of AI capabilities, tailored for diverse tasks: | |
| - **C**oder π»: Craft pythonic solutions with precision. | |
| - **H**umanities Expert π: Dive deep into arts, literature, and history. | |
| - **A**nalyst π€: Derive insights through logical reasoning. | |
| - **R**oleplay Expert π: Mimic behaviors or adopt personas for engaging interactions. | |
| - **M**athematician β: Crunch numbers and solve mathematical enigmas. | |
| - **S**TEM Expert π¬: Navigate through the realms of Science, Technology, Engineering, and Mathematics. | |
| - **E**xtraction Expert π: Extract concise information with a laser-focus. | |
| - **D**rafter π: Generate textual content and narratives with flair. | |
| Empower your tasks with the perfect AI role and unleash the magic of CHARMSED! | |
| """) | |
| # Dropdown to select role | |
| selected_role = st.selectbox("Select AI Role:", list(roles.keys())) | |
| # Display the description of the selected role | |
| st.write(roles[selected_role]) | |
| # Switch to choose between two models | |
| model = st.radio("Choose Model:", ["model_1", "model_2"]) | |
| # Text area for user input | |
| user_input = st.text_area("Provide your task/question:") | |
| # Button to execute | |
| if st.button("Execute"): | |
| # Here, you would add code to get the AI response based on the selected role and model. | |
| # For now, just echoing the user input. | |
| st.write(f"You said: {user_input}") | |
| if __name__ == "__main__": | |
| main() | |