Darpan07 commited on
Commit
1e8e9b1
1 Parent(s): c49c76a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -8
app.py CHANGED
@@ -45,17 +45,16 @@ def generate_question_with_chatgpt(context, topic):
45
  'correct_answer': "Unknown"
46
  }
47
 
48
- data = {
49
- "model": "gpt-3.5-turbo",
50
- "temperature": 0.7,
51
- "max_tokens": 1024,
52
- "messages": [
53
  {"role": "system", "content": "You are a helpful assistant."},
54
  {"role": "user", "content": f"What is the question on {topic} for the following? {context}"},
55
- ],
56
- }
57
 
58
- response = client.chat.completions.create(data)
59
  result = response.json()
60
 
61
  print("API Response:", result) # Add this line for debugging
 
45
  'correct_answer': "Unknown"
46
  }
47
 
48
+ response = client.chat.completions.create(
49
+ model="gpt-3.5-turbo",
50
+ max_tokens=1024,
51
+ temperature = 0.7,
52
+ messages = [
53
  {"role": "system", "content": "You are a helpful assistant."},
54
  {"role": "user", "content": f"What is the question on {topic} for the following? {context}"},
55
+ ]
 
56
 
57
+ )
58
  result = response.json()
59
 
60
  print("API Response:", result) # Add this line for debugging