mohammed3536 commited on
Commit
3b56ba3
1 Parent(s): 93a5e08

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -33,6 +33,7 @@ def generate_mcqs_on_topic(text, topic, num_mcqs=5):
33
  return mcqs
34
 
35
  def generate_question_with_chatgpt(context, topic):
 
36
  # Initializing the default value
37
  generated_question = {
38
  'content': "Unable to generate a question..",
@@ -50,7 +51,7 @@ def generate_question_with_chatgpt(context, topic):
50
  ],
51
  }
52
 
53
- response = openai.chat.completions.create(data)
54
  result = response.json()
55
 
56
  print("API Response:", result) # Add this line for debugging
 
33
  return mcqs
34
 
35
  def generate_question_with_chatgpt(context, topic):
36
+ client = OpenAI()
37
  # Initializing the default value
38
  generated_question = {
39
  'content': "Unable to generate a question..",
 
51
  ],
52
  }
53
 
54
+ response = client.chat.completions.create(data)
55
  result = response.json()
56
 
57
  print("API Response:", result) # Add this line for debugging