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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
import streamlit.components.v1 as components
|
3 |
+
|
4 |
+
|
5 |
+
# Function to generate HTML with textarea
|
6 |
+
def generate_html_with_textarea(text_to_speak):
|
7 |
+
return f'''
|
8 |
+
<!DOCTYPE html>
|
9 |
+
<html>
|
10 |
+
<head>
|
11 |
+
<title>Read It Aloud</title>
|
12 |
+
<script type="text/javascript">
|
13 |
+
function readAloud() {{
|
14 |
+
const text = document.getElementById("textArea").value;
|
15 |
+
const speech = new SpeechSynthesisUtterance(text);
|
16 |
+
window.speechSynthesis.speak(speech);
|
17 |
+
}}
|
18 |
+
</script>
|
19 |
+
</head>
|
20 |
+
<body>
|
21 |
+
<h1>π Read It Aloud</h1>
|
22 |
+
<textarea id="textArea" rows="10" cols="80">{text_to_speak}</textarea>
|
23 |
+
<br>
|
24 |
+
<button onclick="readAloud()">π Read Aloud</button>
|
25 |
+
</body>
|
26 |
+
</html>
|
27 |
+
'''
|
28 |
+
|
29 |
+
def triage_checkin():
|
30 |
+
st.write("### Triage and Check-in Expert π")
|
31 |
+
for i in range(1, 4):
|
32 |
+
st.text_input(f"Question {i} for Triage")
|
33 |
+
|
34 |
+
#List 10 responsibilities with emojis for experience needed to do: Triage and Check-in Expert
|
35 |
+
text_to_speak = """
|
36 |
+
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:
|
37 |
+
1. π Assessing patient symptoms and medical history to determine the appropriate triage category (e.g. emergency, urgent, routine) and assigning a triage score.
|
38 |
+
2. π Entering patient information into the electronic medical record (EMR) and updating it as necessary.
|
39 |
+
3. π Verifying patient insurance information and ensuring that it is up-to-date.
|
40 |
+
4. π Contacting patients to confirm appointments and provide reminders.
|
41 |
+
5. π Securing patient information and maintaining confidentiality.
|
42 |
+
6. π Monitoring patient flow and identifying areas for improvement in the check-in process.
|
43 |
+
7. π‘ Providing excellent customer service and resolving any issues that may arise.
|
44 |
+
8. π Maintaining accurate and up-to-date records of patient encounters.
|
45 |
+
9. π Participating in quality improvement initiatives to improve the efficiency and effectiveness of the triage and check-in process.
|
46 |
+
10. π Collaborating with other healthcare professionals to ensure smooth patient flow and coordination of care.
|
47 |
+
"""
|
48 |
+
html5=generate_html_with_textarea(text_to_speak)
|
49 |
+
components.html(html5, width=1280, height=1024)
|
50 |
+
|
51 |
+
def lab_analyst():
|
52 |
+
st.write("### Lab Analyst π§ͺ")
|
53 |
+
for i in range(1, 4):
|
54 |
+
st.text_input(f"Question {i} for Lab Analysis")
|
55 |
+
|
56 |
+
#List 10 responsibilities with emojis for experience needed to do:
|
57 |
+
text_to_speak = """
|
58 |
+
Lab Analysts play a crucial role in the scientific analysis of samples. Responsibilities will include:
|
59 |
+
1. π¬ Conducting complex tests and experiments on various samples.
|
60 |
+
2. π Analyzing and interpreting data to make informed decisions.
|
61 |
+
3. π§ͺ Preparing reagents and samples for testing.
|
62 |
+
4. π» Utilizing specialized laboratory software for data entry and analysis.
|
63 |
+
5. π Keeping abreast of latest industry developments and scientific literature.
|
64 |
+
6. π Maintaining and calibrating lab equipment to ensure accuracy.
|
65 |
+
7. π Following stringent safety and quality control procedures.
|
66 |
+
8. π€ Collaborating with fellow scientists and researchers.
|
67 |
+
9. π Preparing detailed reports on findings and recommendations.
|
68 |
+
10. π Staying updated with continuing education in the field.
|
69 |
+
"""
|
70 |
+
html5=generate_html_with_textarea(text_to_speak)
|
71 |
+
components.html(html5, width=1280, height=1024)
|
72 |
+
|
73 |
+
def medicine_specialist():
|
74 |
+
st.write("### Medicine Specialist π")
|
75 |
+
for i in range(1, 4):
|
76 |
+
st.text_input(f"Question {i} for Medicine")
|
77 |
+
|
78 |
+
|
79 |
+
#List 10 responsibilities with emojis for experience needed to do:
|
80 |
+
text_to_speak = """
|
81 |
+
As a Medicine Specialist, your role is pivotal in providing expert medical care. Your responsibilities include:
|
82 |
+
1. π©Ί Diagnosing and treating complex medical conditions.
|
83 |
+
2. π§ββοΈ Providing specialized patient care and management.
|
84 |
+
3. π Prescribing medications and monitoring their effects.
|
85 |
+
4. π Conducting thorough patient assessments and medical histories.
|
86 |
+
5. π€ Collaborating with other healthcare professionals for comprehensive patient care.
|
87 |
+
6. π Keeping up-to-date with advancements in medical treatments and technologies.
|
88 |
+
7. π Developing treatment plans based on up-to-date medical knowledge.
|
89 |
+
8. π£οΈ Communicating effectively with patients and their families about medical conditions and treatment plans.
|
90 |
+
9. π Documenting all patient care and interactions accurately.
|
91 |
+
10. π§βπ« Educating patients about disease prevention and health maintenance.
|
92 |
+
"""
|
93 |
+
html5=generate_html_with_textarea(text_to_speak)
|
94 |
+
components.html(html5, width=1280, height=1024)
|
95 |
+
|
96 |
+
def service_expert():
|
97 |
+
st.write("### Service Expert π²")
|
98 |
+
for i in range(1, 4):
|
99 |
+
st.text_input(f"Question {i} for Service")
|
100 |
+
|
101 |
+
|
102 |
+
#List 10 responsibilities with emojis for experience needed to do:
|
103 |
+
text_to_speak = """
|
104 |
+
As a Service Expert π², your role is critical in ensuring customer satisfaction and maintaining service quality. Your responsibilities include:
|
105 |
+
1. π² Providing expert advice on products and services to customers.
|
106 |
+
2. π€ Building and maintaining strong customer relationships.
|
107 |
+
3. π Analyzing customer feedback to improve service quality.
|
108 |
+
4. π Developing strategies to increase customer satisfaction.
|
109 |
+
5. π Managing customer inquiries and resolving issues efficiently.
|
110 |
+
6. π Staying informed about new products and services.
|
111 |
+
7. πΌ Collaborating with the sales team to meet customer needs.
|
112 |
+
8. π οΈ Ensuring compliance with service standards and policies.
|
113 |
+
9. π Documenting customer interactions and transactions.
|
114 |
+
10. π Leading by example and setting high standards for customer service.
|
115 |
+
"""
|
116 |
+
html5=generate_html_with_textarea(text_to_speak)
|
117 |
+
components.html(html5, width=1280, height=1024)
|
118 |
+
|
119 |
+
def care_expert():
|
120 |
+
st.write("### Level of Care Expert π₯")
|
121 |
+
for i in range(1, 4):
|
122 |
+
st.text_input(f"Question {i} for Level of Care")
|
123 |
+
|
124 |
+
|
125 |
+
#List 10 responsibilities with emojis for experience needed to do:
|
126 |
+
text_to_speak = """
|
127 |
+
As a Level of Care Expert π₯, your role is essential in determining the appropriate level of care for patients. Your responsibilities include:
|
128 |
+
1. π₯ Evaluating patient conditions and needs to determine the suitable level of care.
|
129 |
+
2. π Developing and updating care plans in collaboration with healthcare teams.
|
130 |
+
3. π¬ Communicating effectively with patients and their families about care decisions.
|
131 |
+
4. π Analyzing patient data to ensure optimal care delivery.
|
132 |
+
5. π€ Coordinating with various healthcare professionals to provide integrated care.
|
133 |
+
6. π Staying informed about the latest healthcare policies and regulations.
|
134 |
+
7. π οΈ Identifying opportunities for improving care processes and patient outcomes.
|
135 |
+
8. π Monitoring and reporting on care quality metrics.
|
136 |
+
9. π Participating in educational programs to enhance professional knowledge.
|
137 |
+
10. π‘ Providing guidance and training to staff on care standards and practices.
|
138 |
+
"""
|
139 |
+
html5=generate_html_with_textarea(text_to_speak)
|
140 |
+
components.html(html5, width=1280, height=1024)
|
141 |
+
|
142 |
+
def terminology_expert():
|
143 |
+
st.write("### Terminology Expert π")
|
144 |
+
for i in range(1, 4):
|
145 |
+
st.text_input(f"Question {i} for Terminology")
|
146 |
+
|
147 |
+
|
148 |
+
#List 10 responsibilities with emojis for experience needed to do:
|
149 |
+
text_to_speak = """
|
150 |
+
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:
|
151 |
+
1. π§ Mastering complex medical and behavioral health terminologies.
|
152 |
+
2. π Keeping up-to-date with the latest developments in medical language.
|
153 |
+
3. ποΈ Assisting in the creation and review of medical documentation for accuracy.
|
154 |
+
4. π€ Collaborating with healthcare professionals to ensure consistent use of terminology.
|
155 |
+
5. π‘ Providing training and support to staff on medical terminology.
|
156 |
+
6. π Analyzing and interpreting medical records for quality assurance.
|
157 |
+
7. π οΈ Developing resources and tools to aid in the understanding of medical terms.
|
158 |
+
8. π Standardizing terminology usage across various healthcare departments.
|
159 |
+
9. π Conducting research to expand the knowledge base of medical and behavioral health terms.
|
160 |
+
10. π£οΈ Acting as a consultant for terminology-related inquiries and issues.
|
161 |
+
"""
|
162 |
+
|
163 |
+
html5=generate_html_with_textarea(text_to_speak)
|
164 |
+
components.html(html5, width=1280, height=1024)
|
165 |
+
|
166 |
+
def cmo():
|
167 |
+
st.write("### Chief Medical Officer π©Ί")
|
168 |
+
for i in range(1, 4):
|
169 |
+
st.text_input(f"Question {i} for CMO")
|
170 |
+
|
171 |
+
|
172 |
+
#List 10 responsibilities with emojis for experience needed to do:
|
173 |
+
text_to_speak = """
|
174 |
+
As a Chief Medical Officer (CMO) π©Ί, you hold a crucial leadership position in the healthcare system. Your responsibilities include:
|
175 |
+
1. π©Ί Overseeing the delivery of medical care across the organization.
|
176 |
+
2. π Developing and implementing healthcare strategies and policies.
|
177 |
+
3. πΌ Leading clinical teams and ensuring the highest standards of patient care.
|
178 |
+
4. π€ Collaborating with other executives to align clinical and organizational goals.
|
179 |
+
5. π Staying informed about the latest healthcare trends and advancements.
|
180 |
+
6. π Ensuring compliance with healthcare laws, regulations, and standards.
|
181 |
+
7. π£οΈ Representing the medical staff in executive decision-making.
|
182 |
+
8. π Overseeing medical research and education programs.
|
183 |
+
9. π Monitoring and improving the quality of healthcare services.
|
184 |
+
10. π§ββοΈ Mentoring and developing healthcare professionals.
|
185 |
+
"""
|
186 |
+
html5=generate_html_with_textarea(text_to_speak)
|
187 |
+
components.html(html5, width=1280, height=1024)
|
188 |
+
|
189 |
+
def medical_director():
|
190 |
+
st.write("### Medical Director Team π’")
|
191 |
+
for i in range(1, 4):
|
192 |
+
st.text_input(f"Question {i} for Medical Director")
|
193 |
+
|
194 |
+
|
195 |
+
#List 10 responsibilities with emojis for experience needed to do:
|
196 |
+
text_to_speak = """
|
197 |
+
As part of the Medical Director Team π’, you play a pivotal role in shaping the healthcare services of the organization. Your responsibilities include:
|
198 |
+
1. π’ Leading and overseeing the medical department within the organization.
|
199 |
+
2. π Developing strategies to enhance patient care and healthcare services.
|
200 |
+
3. π€ Collaborating with other departments to integrate medical services with overall organizational goals.
|
201 |
+
4. πΌ Managing clinical staff, including hiring, training, and performance evaluations.
|
202 |
+
5. π Keeping abreast of the latest medical research and advancements to inform practice and policy.
|
203 |
+
6. π Monitoring and improving the quality and efficiency of medical services.
|
204 |
+
7. π£οΈ Acting as a liaison between the medical staff and executive management.
|
205 |
+
8. π Ensuring compliance with healthcare regulations and standards.
|
206 |
+
9. π Conducting regular reviews of clinical procedures and outcomes.
|
207 |
+
10. π§ββοΈ Providing mentorship and leadership to medical professionals within the team.
|
208 |
+
"""
|
209 |
+
html5=generate_html_with_textarea(text_to_speak)
|
210 |
+
components.html(html5, width=1280, height=1024)
|
211 |
+
|
212 |
+
def main():
|
213 |
+
st.title("10πMoEπMedical Mixture of Experts Model")
|
214 |
+
st.write("Harness the power of AI with this specialized healthcare framework! π")
|
215 |
+
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.")
|
216 |
+
st.markdown("#### MTBench: https://huggingface.co/spaces/awacke1/MTBenchmarkForChatGPTMetricsScoring")
|
217 |
+
|
218 |
+
role = st.selectbox("Select AI Role:", [
|
219 |
+
"Triage and Check-in Expert",
|
220 |
+
"Lab Analyst",
|
221 |
+
"Medicine Specialist",
|
222 |
+
"Service Expert",
|
223 |
+
"Level of Care Expert",
|
224 |
+
"Terminology Expert",
|
225 |
+
"Chief Medical Officer",
|
226 |
+
"Medical Director Team"
|
227 |
+
])
|
228 |
+
|
229 |
+
if role == "Triage and Check-in Expert":
|
230 |
+
triage_checkin()
|
231 |
+
elif role == "Lab Analyst":
|
232 |
+
lab_analyst()
|
233 |
+
elif role == "Medicine Specialist":
|
234 |
+
medicine_specialist()
|
235 |
+
elif role == "Service Expert":
|
236 |
+
service_expert()
|
237 |
+
elif role == "Level of Care Expert":
|
238 |
+
care_expert()
|
239 |
+
elif role == "Terminology Expert":
|
240 |
+
terminology_expert()
|
241 |
+
elif role == "Chief Medical Officer":
|
242 |
+
cmo()
|
243 |
+
elif role == "Medical Director Team":
|
244 |
+
medical_director()
|
245 |
+
|
246 |
+
# Define Roles and their Descriptions
|
247 |
+
roles = {
|
248 |
+
"1. Coder": "π» Creates short python code functions to solve tasks.",
|
249 |
+
"2. Humanities Expert": "π Focuses on arts, literature, history, and other humanities subjects.",
|
250 |
+
"3. Analyst": "π€ Analyzes situations and provides logical solutions.",
|
251 |
+
"4. Roleplay Expert": "π Specialized in mimicking behaviors or characters.",
|
252 |
+
"5. Mathematician": "β Solves mathematical problems with precision.",
|
253 |
+
"6. STEM Expert": "π¬ Specialized in Science, Technology, Engineering, and Mathematics tasks.",
|
254 |
+
"7. Extraction Expert": "π Strictly sticks to facts and extracts concise information.",
|
255 |
+
"8. Drafter": "π Exhibits expertise in generating textual content and narratives.",
|
256 |
+
}
|
257 |
+
|
258 |
+
# Streamlit UI
|
259 |
+
st.title("AI Role Selector - CHARMSED π€β¨")
|
260 |
+
st.markdown("""
|
261 |
+
### Harness the power of AI with the CHARMSED framework.
|
262 |
+
#### This suite of roles brings together a comprehensive set of AI capabilities, tailored for diverse tasks:
|
263 |
+
- **C**oder π»: Craft pythonic solutions with precision.
|
264 |
+
- **H**umanities Expert π: Dive deep into arts, literature, and history.
|
265 |
+
- **A**nalyst π€: Derive insights through logical reasoning.
|
266 |
+
- **R**oleplay Expert π: Mimic behaviors or adopt personas for engaging interactions.
|
267 |
+
- **M**athematician β: Crunch numbers and solve mathematical enigmas.
|
268 |
+
- **S**TEM Expert π¬: Navigate through the realms of Science, Technology, Engineering, and Mathematics.
|
269 |
+
- **E**xtraction Expert π: Extract concise information with a laser-focus.
|
270 |
+
- **D**rafter π: Generate textual content and narratives with flair.
|
271 |
+
Empower your tasks with the perfect AI role and unleash the magic of CHARMSED!
|
272 |
+
""")
|
273 |
+
|
274 |
+
# Dropdown to select role
|
275 |
+
selected_role = st.selectbox("Select AI Role:", list(roles.keys()))
|
276 |
+
|
277 |
+
# Display the description of the selected role
|
278 |
+
st.write(roles[selected_role])
|
279 |
+
|
280 |
+
# Switch to choose between two models
|
281 |
+
model = st.radio("Choose Model:", ["model_1", "model_2"])
|
282 |
+
|
283 |
+
# Text area for user input
|
284 |
+
user_input = st.text_area("Provide your task/question:")
|
285 |
+
|
286 |
+
# Button to execute
|
287 |
+
if st.button("Execute"):
|
288 |
+
# Here, you would add code to get the AI response based on the selected role and model.
|
289 |
+
# For now, just echoing the user input.
|
290 |
+
st.write(f"You said: {user_input}")
|
291 |
+
|
292 |
+
if __name__ == "__main__":
|
293 |
+
main()
|