dielz commited on
Commit
8878677
·
verified ·
1 Parent(s): babeef6

update prompt

Browse files
Files changed (1) hide show
  1. app.py +17 -12
app.py CHANGED
@@ -17,18 +17,23 @@ genai.configure(api_key=api_key)
17
  labels = ['cataract', 'diabetic_retinopathy', 'glaucoma', 'normal']
18
 
19
  def get_disease_detail(disease_name):
20
- if disease_name == "normal":
21
- prompt = (
22
- "Create a text that congratulates having healthy eyes and gives bullet point tips to keep eyes healthy."
23
- )
24
- else:
25
- prompt = (
26
- f"Diagnosis: {disease_name}\n\n"
27
- "What is it?\n(Description about {disease_name})\n\n"
28
- "What causes it?\n(Explain what causes {disease_name})\n\n"
29
- "Suggestion\n(Suggestion to user)\n\n"
30
- "Reminder: Always seek professional help, such as a doctor."
31
- )
 
 
 
 
 
32
  try:
33
  response = genai.GenerativeModel("gemini-1.5-flash").generate_content(prompt)
34
  return markdown2.markdown(response.text.strip())
 
17
  labels = ['cataract', 'diabetic_retinopathy', 'glaucoma', 'normal']
18
 
19
  def get_disease_detail(disease_name):
20
+ # if disease_name == "normal":
21
+ # prompt = (
22
+ # "Create a text that congratulates having healthy eyes and gives bullet point tips to keep eyes healthy."
23
+ # )
24
+ # else:
25
+ prompt = (
26
+ "You are an Ophthalmologist with over 25 years of experience,
27
+ you have treated thousands of patients with various eye diseases including cataracts,
28
+ diabetic retinopathy and glaucoma. The entire medical process from disease identification
29
+ to patient management is second nature to you and you are used to it.
30
+ Your job is to critically and comprehensively make recommendations based on the diagnosis,
31
+ the recommendations contain actions that can be taken on the patient, no need to re-explain
32
+ the disease. In every recommendation you must remind the patient to always see the Ophthalmologist
33
+ to validate the diagnosis and recommendation.\n"
34
+
35
+ f"The diagnosis is {disease_name}, what are your recommendations?"
36
+ )
37
  try:
38
  response = genai.GenerativeModel("gemini-1.5-flash").generate_content(prompt)
39
  return markdown2.markdown(response.text.strip())