Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
@@ -35,12 +35,12 @@ async def getQuestions(job_description: str, no_of_questions: int):
|
|
35 |
model="gpt-3.5-turbo-1106",
|
36 |
response_format={"type": "json_object"}, # To ENABLE JSON MODE
|
37 |
messages=[
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
)
|
45 |
result = response.choices[0].message.content
|
46 |
# Parse the JSON data
|
|
|
35 |
model="gpt-3.5-turbo-1106",
|
36 |
response_format={"type": "json_object"}, # To ENABLE JSON MODE
|
37 |
messages=[
|
38 |
+
{"role": "system",
|
39 |
+
"content": "You are a helpful assistant designed to output JSON in this format [question-text as key and its value as answer-text]"},
|
40 |
+
{"role": "user",
|
41 |
+
"content": f"Given the job description [{job_description}] create {no_of_questions} "
|
42 |
+
f"interview questions and their corresponding answers"}
|
43 |
+
]
|
44 |
)
|
45 |
result = response.choices[0].message.content
|
46 |
# Parse the JSON data
|