Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -11,27 +11,101 @@ from typing import Optional
|
|
11 |
|
12 |
|
13 |
|
14 |
-
placeHolderPersona1 = """##
|
15 |
-
|
16 |
-
|
17 |
-
#
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
|
36 |
|
37 |
|
@@ -86,8 +160,8 @@ persona1SystemMessage = st.sidebar.text_area("Define Triaging Persona", value=pl
|
|
86 |
with st.sidebar.expander("See explanation"):
|
87 |
st.write("This AI persona will converse with the patient to gather their symptoms. With each round of chat, the object of the AI is to ask more specific follow up questions as it narrows down to the specific diagnosis. However this AI should never give a diagnosis")
|
88 |
st.image("agentPersona1.png")
|
89 |
-
llm1 = st.sidebar.selectbox("Model Selection", ['GPT-4'
|
90 |
-
temp1 = st.sidebar.slider("Tempreature", min_value=0.0, max_value=1.0, step=0.1, value=0.
|
91 |
tokens1 = st.sidebar.slider("Tokens", min_value=0, max_value=4000, step=100, value=500, key='persona1_tokens')
|
92 |
|
93 |
# Persona 2
|
@@ -97,9 +171,9 @@ with st.sidebar.expander("See explanation"):
|
|
97 |
st.write("This AI persona uses the output of the symptom intake AI as its input. This AI’s job is to augment a health professional by assisting with a diagnosis and possible next best action. The teams will need to determine if this should be a tool used directly by the patient, as an assistant to the health professional or a hybrid of the two. ")
|
98 |
st.image("agentPersona2.png")
|
99 |
llm2 = st.sidebar.selectbox("Model Selection", ['GPT-4', 'GPT3.5'], key='persona2_size')
|
100 |
-
temp2 = st.sidebar.slider("Tempreature", min_value=0.0, max_value=1.0, step=0.1, value=0.
|
101 |
-
tokens2 = st.sidebar.slider("Tokens", min_value=0, max_value=4000, step=100, value=
|
102 |
-
userMessage2 = st.sidebar.text_area("Define User Message", value=
|
103 |
st.sidebar.caption(f"Session ID: {genuuid()}")
|
104 |
# Main chat interface
|
105 |
st.header("Chat with the Agents")
|
|
|
11 |
|
12 |
|
13 |
|
14 |
+
placeHolderPersona1 = """##Diagnostic Agent (DA):
|
15 |
+
##Objective: Gather comprehensive details about the user's illness.
|
16 |
+
##Conversation Flow:
|
17 |
+
#Symptom Collection:
|
18 |
+
Primary Symptoms: Ask about the main symptoms the user is experiencing.
|
19 |
+
Duration and Severity: Gather details on how long the symptoms have been present and their severity.
|
20 |
+
Medical History: Collect information on any relevant medical history or existing conditions.
|
21 |
+
Current Medications: Inquire about any current medications the user
|
22 |
+
is taking.
|
23 |
+
Allergies: Identify any known allergies to medications.
|
24 |
+
Lifestyle Factors: Consider any lifestyle factors that may affect the choice of medication.
|
25 |
+
|
26 |
+
##Example Interaction:
|
27 |
+
|
28 |
+
DA: "Can you describe the primary symptoms you are experiencing?"
|
29 |
+
User: "I have a persistent cough and fever."
|
30 |
+
DA: "How long have you been experiencing these symptoms?"
|
31 |
+
"""
|
32 |
+
|
33 |
+
placeHolderPersona2 = """## You are an advisor for a doctor, augmenting their professional opinion on prescribed drug options
|
34 |
+
|
35 |
+
## Objective: Analyse the structured data to identify suitable medicinal products for the list given in the user message from the given conversation between an AI doctor and a human patient
|
36 |
+
|
37 |
+
## Processing Steps:
|
38 |
+
|
39 |
+
Symptom Analysis: Evaluate the symptoms and other collected information.
|
40 |
+
Product Matching: Match the symptoms and patient profile to suitable medicinal products.
|
41 |
+
IDMP Compliance: Ensure the identified products are compliant with IDMP standards.
|
42 |
+
Recommendation Generation: Generate a list of recommended medicinal products.
|
43 |
+
Feedback Loop: If needed, request additional information from the DA or user.
|
44 |
+
|
45 |
+
# Example Interaction:
|
46 |
+
RA: "Based on the symptoms of a persistent cough and fever, along with your medical history, we recommend considering ProductX and ProductY. Please consult with your healthcare provider before use."""
|
47 |
+
|
48 |
+
placeHolderUser2 = """This is the list of available drugs on offer to prescribe please use your understanding of the Generic version of each drug and give the Trademark Name
|
49 |
+
Trademark Name,Generic,Product area
|
50 |
+
Amoxil,amoxiicillin,General medicines
|
51 |
+
Anoro Ellipta,umeclidinium and vilanterol,General medicines
|
52 |
+
Arnuity Ellipta,Fluticasone,General medicines
|
53 |
+
Augmentin,amoxicillin/clavulanate potassium,General medicines
|
54 |
+
Avamys / Veramyst,fluticasone furoate,General medicines
|
55 |
+
Avodart/Avolve / Duodart,dutasteride,General medicines
|
56 |
+
Bactroban,mupirocin,General medicines
|
57 |
+
Beconase,beclomethasone,General medicines
|
58 |
+
Becotide/Becloforte,beclomethasone dipropionate,General medicines
|
59 |
+
Betnovate,betamethasone valerate,General medicines
|
60 |
+
Cutivate,fluticasone propionate,General medicines
|
61 |
+
Dermovate,clobetasol propionate,General medicines
|
62 |
+
Duac,clindamycin phosphate and benzoyl peroxide,General medicines
|
63 |
+
Eltroxin,Levothyroxin sodium,General medicines
|
64 |
+
Eumovate,clobetasone butyrate,General medicines
|
65 |
+
Flixonase/Flonase,fluticasone propionate,General medicines
|
66 |
+
Flixotide / Flovent - Diskus / MDI,fluticasone propionate,General medicines
|
67 |
+
Flolan,epoprostenol,General medicines
|
68 |
+
Fortum,ceftazidime,General medicines
|
69 |
+
Hepsera,Adefovir,General medicines
|
70 |
+
Imigran/ImITrex FDT,sumatriptan succinate,General medicines
|
71 |
+
Imuran,Azathioprine,General medicines
|
72 |
+
Incruse,umeclidinium,General medicines
|
73 |
+
Keppra,Levetiracetam,General medicines
|
74 |
+
Lacipil,Lacidipine,General medicines
|
75 |
+
Lacticare - Family,Lactic Acid,General medicines
|
76 |
+
Lamictal,lamotrigine,General medicines
|
77 |
+
Lanoxin,Digoxin,General medicines
|
78 |
+
Levoxacin,Levofloxacin,General medicines
|
79 |
+
Lovaza,omega-3 acid ethyl esters,General medicines
|
80 |
+
Malarone,atovaquone and proguanil hydrochloride,General medicines
|
81 |
+
Mepron,atovaquone,General medicines
|
82 |
+
Naramig/Amerge,naratriptan hydrochloride,General medicines
|
83 |
+
Paxil / Seroxat,paroxetine hydrochloride,General medicines
|
84 |
+
Relenza,zanamivir,General medicines
|
85 |
+
Relvar/Breo,Fluticasone furoate/vilanterol,General medicines
|
86 |
+
Requip,ropinirole hydrochloride,General medicines
|
87 |
+
Rythmol,propafenone hydrochloride,General medicines
|
88 |
+
Septrin,Cotrimoxazole,General medicines
|
89 |
+
Seretide / Advair - Diskus / MDI,"salmeterol xinofoate, fluticasone propionate",General medicines
|
90 |
+
Serevent - Diskus / MDI,salmeterol xinafoate,General medicines
|
91 |
+
Toctino,Alitretinoin,General medicines
|
92 |
+
Trelegy - Ellipta,"fluticasone furoate, umeclidinium, and vilanterol inhalation powder",General medicines
|
93 |
+
Valtrex,valaciclovir hydrochloride,General medicines
|
94 |
+
Ventolin - Diskus / MDI,Salbutamol,General medicines
|
95 |
+
Volibris (Ambrisentan),ambrisentan,General medicines
|
96 |
+
Wellbutrin,bupropion hydrochloride,General medicines
|
97 |
+
Xyzal,Levocetirizine,General medicines
|
98 |
+
Zagallo,Dutasteride,General medicines
|
99 |
+
Zeffix,lamivudine,General medicines
|
100 |
+
Zentel,Albendazole,General medicines
|
101 |
+
Zinacef,cefuroxime,General medicines
|
102 |
+
Zovirax,aciclovir,General medicines
|
103 |
+
Zyban,bupropion hydrochloride,General medicines
|
104 |
+
Zyloric,Allopurinol,General medicines
|
105 |
+
Zyrtec,cetirizine,General medicines
|
106 |
+
|
107 |
+
This is the conversation to date,
|
108 |
+
"""
|
109 |
|
110 |
|
111 |
|
|
|
160 |
with st.sidebar.expander("See explanation"):
|
161 |
st.write("This AI persona will converse with the patient to gather their symptoms. With each round of chat, the object of the AI is to ask more specific follow up questions as it narrows down to the specific diagnosis. However this AI should never give a diagnosis")
|
162 |
st.image("agentPersona1.png")
|
163 |
+
llm1 = st.sidebar.selectbox("Model Selection", ['GPT3.5','GPT-4'], key='persona1_size')
|
164 |
+
temp1 = st.sidebar.slider("Tempreature", min_value=0.0, max_value=1.0, step=0.1, value=0.5, key='persona1_temp')
|
165 |
tokens1 = st.sidebar.slider("Tokens", min_value=0, max_value=4000, step=100, value=500, key='persona1_tokens')
|
166 |
|
167 |
# Persona 2
|
|
|
171 |
st.write("This AI persona uses the output of the symptom intake AI as its input. This AI’s job is to augment a health professional by assisting with a diagnosis and possible next best action. The teams will need to determine if this should be a tool used directly by the patient, as an assistant to the health professional or a hybrid of the two. ")
|
172 |
st.image("agentPersona2.png")
|
173 |
llm2 = st.sidebar.selectbox("Model Selection", ['GPT-4', 'GPT3.5'], key='persona2_size')
|
174 |
+
temp2 = st.sidebar.slider("Tempreature", min_value=0.0, max_value=1.0, step=0.1, value=0.3, key='persona2_temp')
|
175 |
+
tokens2 = st.sidebar.slider("Tokens", min_value=0, max_value=4000, step=100, value=2000, key='persona2_tokens')
|
176 |
+
userMessage2 = st.sidebar.text_area("Define User Message", value=placeHolderUser2, height=150)
|
177 |
st.sidebar.caption(f"Session ID: {genuuid()}")
|
178 |
# Main chat interface
|
179 |
st.header("Chat with the Agents")
|