mohammed3536 commited on
Commit
10f43f0
·
verified ·
1 Parent(s): 2e46dd2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -59,8 +59,8 @@ def generate_question_with_chatgpt(context):
59
  response = requests.post(CHATGPT_API_ENDPOINT, json=data, headers=headers)
60
  result = response.json()
61
 
62
- if 'choices' in result:
63
- # Extract the generated question from the response
64
  generated_question = {
65
  'content': result["choices"][0]["message"]["content"],
66
  'options': result["choices"][0]["message"].get("options", []),
@@ -98,3 +98,4 @@ if __name__ == "__main__":
98
  main()
99
 
100
 
 
 
59
  response = requests.post(CHATGPT_API_ENDPOINT, json=data, headers=headers)
60
  result = response.json()
61
 
62
+ if 'choices' in result:
63
+ # Extract the generated question, options, and correct answer from the response
64
  generated_question = {
65
  'content': result["choices"][0]["message"]["content"],
66
  'options': result["choices"][0]["message"].get("options", []),
 
98
  main()
99
 
100
 
101
+