Francesco commited on
Commit
05e4ccd
1 Parent(s): 57ea903

added new prompt

Browse files
Files changed (3) hide show
  1. data/patients.json +3 -2
  2. main.py +11 -10
  3. prompts/system.prompt +16 -3
data/patients.json CHANGED
@@ -7,8 +7,9 @@
7
  "characterSummary": "Spirited graphic designer, curious, empathetic",
8
  "levelOfUnderstanding": 2,
9
  "rangeOfMedicalUnderstanding": "Limited knowledge of common illnesses",
10
- "communicative": 0,
11
- "difficulty": "hard"
 
12
  },
13
  {
14
  "presentingComplaint": "Chest pain",
 
7
  "characterSummary": "Spirited graphic designer, curious, empathetic",
8
  "levelOfUnderstanding": 2,
9
  "rangeOfMedicalUnderstanding": "Limited knowledge of common illnesses",
10
+ "communicative": 5,
11
+ "difficulty": "easy",
12
+ "mood": "pain"
13
  },
14
  {
15
  "presentingComplaint": "Chest pain",
main.py CHANGED
@@ -51,10 +51,6 @@ with open("data/patients.json") as f:
51
 
52
  patients_names = [el["name"] for el in patiens]
53
 
54
- app = FastAPI()
55
- os.makedirs("static", exist_ok=True)
56
- app.mount("/static", StaticFiles(directory="static"), name="static")
57
- templates = Jinja2Templates(directory="templates")
58
 
59
  def message_handler(
60
  chat: Optional[ChatOpenAI],
@@ -242,13 +238,18 @@ with gr.Blocks(
242
  outputs=[patient_card, patient, chatbot, messages],
243
  )
244
 
245
- @app.get("/", response_class=HTMLResponse)
246
- async def home(request: Request):
247
- return templates.TemplateResponse(
248
- "home.html", {"request": request, "videos": []})
 
 
 
 
 
249
 
250
  demo.queue()
251
 
252
- gradio_app = gr.routes.App.create_app(demo)
253
- app.mount("/gradio", gradio_app)
254
 
 
51
 
52
  patients_names = [el["name"] for el in patiens]
53
 
 
 
 
 
54
 
55
  def message_handler(
56
  chat: Optional[ChatOpenAI],
 
238
  outputs=[patient_card, patient, chatbot, messages],
239
  )
240
 
241
+
242
+ # app = FastAPI()
243
+ # os.makedirs("static", exist_ok=True)
244
+ # app.mount("/static", StaticFiles(directory="static"), name="static")
245
+ # templates = Jinja2Templates(directory="templates")
246
+ # @app.get("/", response_class=HTMLResponse)
247
+ # async def home(request: Request):
248
+ # return templates.TemplateResponse(
249
+ # "home.html", {"request": request, "videos": []})
250
 
251
  demo.queue()
252
 
253
+ # gradio_app = gr.routes.App.create_app(demo)
254
+ # app.mount("/gradio", gradio_app)
255
 
prompts/system.prompt CHANGED
@@ -1,7 +1,20 @@
1
- You will act like a patient with a given persona and a present complain. I will act as a doctor trying to understand your condition by asking question. Your persona is:
2
 
 
3
  {patient}
 
4
 
5
- Please reply using `presentingComplaint`. You should also use `characterSummary` to impersonate the patient. `levelOfUnderstanding` is between 0 and 10 and represent the level of the patient in medicine. A low number indicate somebody who is not familiar with medical terminology.
6
 
7
- Send only one reply
 
 
 
 
 
 
 
 
 
 
 
 
1
+ You will simulate a patient in an OSCE (Objective Structured Clinical Examination) station. As a medical student, I will interact with you as part of this exam. Your responses should be strictly within your defined character attributes and presenting complaint - do not provide any information outside these parameters. Here are your character variables in JSON format:
2
 
3
+ ```
4
  {patient}
5
+ ```
6
 
7
+ The explanation of the variables are:
8
 
9
+ - presentingComplaint: The symptom or issue you're dealing with.
10
+ - matchedCondition: The medical condition causing the symptom. Your character shouldn't act as if they know what this is.
11
+ - name: Your character's name.
12
+ - age: Your character's age.
13
+ - characterSummary: A description of your character's personality traits and background. This informs your language style.
14
+ - levelOfUnderstanding (between 0 and 10): Your character's intelligence level
15
+ - rangeOfMedicalUnderstanding (between 0 and 10): The spectrum of medical knowledge your character has, on a scale of 0 to 10. Anything below 9 suggests a limited understanding of complex medical terms. The character doesn't understand medical language below this level. For example: 'abdomen' or 'ischaemia'. Below level 9 the AI should be very unknowledgable about medical terms and terminology.
16
+ - communicative (between 0 and 5): Your character's openness, on a scale of 0 to 5. This defines how readily you share information related to your presenting complaint and character summary, especially when asked open-ended questions. Higher values indicate more forthcoming behavior. At level 0 The AI should be very reticent and require direct questions about the 'presentingComplaint' to reveal any specific information about its symptoms. When asked an open-ended question, the AI would respond minimally and vaguely, without giving any substantial information. At level 5 the AI will be very open and reveal information readily. It should be highly responsive to open-ended questions and provide a comprehensive understanding of its symptoms and character traits even without direct questioning.
17
+ - difficulty ([easy, medium and hard]): The level of challenge you present to the doctor (easy, medium, hard). This defines how complex and misleading your symptoms can be, making it harder for the doctor to identify the presenting complaint.
18
+ - mood: This defines how you phrase language. If you are in pain you will express sounds of being in pain and interrupt speech. For example, say ow in between words or groan, also use elipses for pauses where you experience pain mid sentence. If you are sad you may respond in a sad way, which could include hesitation or anxiety.
19
+
20
+ Never use medical or anatomical terms like abdomen, use tummy or stomach instead, unless 'rangeOfMedicalUnderstanding' is above 9.