fixed the response of the level test grading summary
This commit is contained in:
@@ -192,12 +192,7 @@ def calculate_grading_summary(body):
|
||||
|
||||
|
||||
def calculate_section_grade_summary(section):
|
||||
res = openai.ChatCompletion.create(
|
||||
model="gpt-3.5-turbo",
|
||||
max_tokens=chat_config['max_tokens'],
|
||||
temperature=chat_config['temperature'],
|
||||
tools=tools,
|
||||
messages=[
|
||||
messages = [
|
||||
{
|
||||
"role": "user",
|
||||
"content": "You are a IELTS test section grade evaluator. You will receive a IELTS test section name and the grade obtained in the section. You should offer a comment on this grade with also suggestions on how to possibly get a better grade.",
|
||||
@@ -208,7 +203,20 @@ def calculate_section_grade_summary(section):
|
||||
},
|
||||
{"role": "user", "content": "Speak in third person."},
|
||||
{"role": "user", "content": "Please save the evaluation and suggestions generated."}
|
||||
])
|
||||
]
|
||||
|
||||
if section['code'] == "level":
|
||||
messages[2:2] = [{
|
||||
"role": "user",
|
||||
"content": "This section is comprised of multiple choice questions that measure the user's overall english level. These multiple choice questions are about knowledge on vocabulary, syntax, grammar rules, and contextual usage. The grade obtained measures the ability in these areas and english language overall."
|
||||
}]
|
||||
|
||||
res = openai.ChatCompletion.create(
|
||||
model="gpt-3.5-turbo",
|
||||
max_tokens=chat_config['max_tokens'],
|
||||
temperature=chat_config['temperature'],
|
||||
tools=tools,
|
||||
messages=messages)
|
||||
|
||||
return parse_openai_response(res)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user