Spaces:
Sleeping
Sleeping
mohammed3536
commited on
Commit
•
341d0da
1
Parent(s):
627ee82
Update app.py
Browse files
app.py
CHANGED
@@ -59,7 +59,7 @@ def generate_question_with_chatgpt(context, topic):
|
|
59 |
'correct_answer': "Unknown"
|
60 |
}
|
61 |
|
62 |
-
|
63 |
model="gpt-3.5-turbo",
|
64 |
max_tokens=1024,
|
65 |
temperature=0.7,
|
@@ -68,7 +68,6 @@ def generate_question_with_chatgpt(context, topic):
|
|
68 |
{"role": "user", "content": f"What is the question on {topic} for the following? {context}"},
|
69 |
]
|
70 |
)
|
71 |
-
result = response.json()
|
72 |
|
73 |
print("API Response:", result) # Print the API response for debugging
|
74 |
|
|
|
59 |
'correct_answer': "Unknown"
|
60 |
}
|
61 |
|
62 |
+
result = client.chat.completions.create(
|
63 |
model="gpt-3.5-turbo",
|
64 |
max_tokens=1024,
|
65 |
temperature=0.7,
|
|
|
68 |
{"role": "user", "content": f"What is the question on {topic} for the following? {context}"},
|
69 |
]
|
70 |
)
|
|
|
71 |
|
72 |
print("API Response:", result) # Print the API response for debugging
|
73 |
|