Adr740 commited on
Commit
13cfff6
·
verified ·
1 Parent(s): e444f89

Update get_answer.py

Browse files
Files changed (1) hide show
  1. get_answer.py +6 -1
get_answer.py CHANGED
@@ -11,7 +11,12 @@ def encode_image(image_path):
11
 
12
 
13
  client = OpenAI(api_key=openai_api)
 
 
 
 
14
  def get_ai_response(prompt_content, prompt):
 
15
  response = client.chat.completions.create(
16
  model="gpt-4o",
17
  messages=[
@@ -20,7 +25,7 @@ def get_ai_response(prompt_content, prompt):
20
  "content": [
21
  {
22
  "type": "text",
23
- "text": prompt
24
  }
25
  ]
26
  },
 
11
 
12
 
13
  client = OpenAI(api_key=openai_api)
14
+
15
+
16
+ sys_prompt ="""Generate the most probable diagnosis with a likelihood percentage, followed by a comprehensive medical reasoning that justifies why this diagnosis is the most plausible. Use evidence from medical literature, guidelines from sources such as NIS, NRD, or NHANES, and incorporate socio-environmental factors as well as insights from past physician experiences (this aspect is critical). Additionally, cite all references, including papers from Randomized Phase III clinical trials, and provide accessible links to the sources. Ensure that the reasoning is detailed, with clear explanations for each point, following the structure outlined in the provided image. Use the following fake patient medical record as the basis for your analysis."""
17
+
18
  def get_ai_response(prompt_content, prompt):
19
+ global sys_prompt
20
  response = client.chat.completions.create(
21
  model="gpt-4o",
22
  messages=[
 
25
  "content": [
26
  {
27
  "type": "text",
28
+ "text": sys_prompt
29
  }
30
  ]
31
  },