LiamKhoaLe commited on
Commit
94759d3
·
1 Parent(s): ff86b84

Finetune prompt

Browse files
Files changed (1) hide show
  1. app.py +10 -5
app.py CHANGED
@@ -154,12 +154,17 @@ async def image_question(file: UploadFile = File(...)):
154
  "data": b64
155
  }
156
  }]
157
- # Ask Gemini to return JSON so we can split Q & A
158
  prompt = (
159
- "From the screenshot extract the interview question(s) (English). "
160
- "There could be more than 1 questions, each questions and answer are split each by a semicolon ';'. \n"
161
- "Answer concisely (≤200 words). "
162
- "Return pure JSON: {\"question\":\"...\",\"answer\":\"...\"}"
 
 
 
 
 
163
  )
164
  # Send prompt and image
165
  text = call_gemini(prompt, vision_part)
 
154
  "data": b64
155
  }
156
  }]
157
+ # Ask Gemini to return JSON splitting Q&A
158
  prompt = (
159
+ "From the screenshot, extract all English interview question(s). "
160
+ "There may be multiple questions. For each, provide a concise answer (≤200 words).\n\n"
161
+ "Return only valid JSON as a list of objects:\n"
162
+ "[\n"
163
+ " {\"question\": \"...\", \"answer\": \"...\"},\n"
164
+ " {\"question\": \"...\", \"answer\": \"...\"},\n"
165
+ " ...\n"
166
+ "]\n\n"
167
+ "Do not include explanations or additional formatting — only output raw JSON."
168
  )
169
  # Send prompt and image
170
  text = call_gemini(prompt, vision_part)