Add comment to grading of writing.

This commit is contained in:
Cristiano Ferreira
2024-07-16 21:35:36 +01:00
parent afca610c09
commit b4dc6be927
2 changed files with 145 additions and 41 deletions

View File

@@ -238,6 +238,27 @@ def build_write_blanks_solutions_listening(words: [], start_id):
)
return solutions
def get_perfect_answer(question: str, size: int):
messages = [
{
"role": "system",
"content": (
'You are a helpful assistant designed to output JSON on this format: '
'{"perfect_answer": "perfect answer for the question"}')
},
{
"role": "user",
"content": ('Write a perfect answer for this writing exercise of a IELTS exam. Question: ' + question)
},
{
"role": "user",
"content": ('The answer must have at least ' + str(size) + ' words')
}
]
token_count = count_total_tokens(messages)
return make_openai_call(GPT_4_O, messages, token_count, GEN_TEXT_FIELDS, GEN_QUESTION_TEMPERATURE)
def generate_reading_passage(type: QuestionType, topic: str):
messages = [