Improve prompts and add suffix to speaking 2.
This commit is contained in:
43
app.py
43
app.py
@@ -789,28 +789,43 @@ def grade_speaking_task_2():
|
||||
def get_speaking_task_2_question():
|
||||
difficulty = request.args.get("difficulty", default=random.choice(difficulties))
|
||||
topic = request.args.get("topic", default=random.choice(mti_topics))
|
||||
|
||||
json_format = {
|
||||
"topic": "topic",
|
||||
"question": "question",
|
||||
"prompts": [
|
||||
"prompt_1",
|
||||
"prompt_2",
|
||||
"prompt_3"
|
||||
],
|
||||
"suffix": "And explain why..."
|
||||
}
|
||||
|
||||
try:
|
||||
messages = [
|
||||
{
|
||||
"role": "system",
|
||||
"content": (
|
||||
'You are a helpful assistant designed to output JSON on this format: '
|
||||
'{"topic": "topic", "question": "question", "prompts": ["prompt_1", "prompt_2", "prompt_3"]}')
|
||||
"content": 'You are a helpful assistant designed to output JSON on this format: ' + str(json_format)
|
||||
},
|
||||
{
|
||||
"role": "user",
|
||||
"content": (
|
||||
'Create a question of ' + difficulty + ' difficulty for IELTS Speaking Part 2 '
|
||||
'that encourages candidates to narrate a '
|
||||
'personal experience or story related to the topic '
|
||||
'of "' + topic + '". Include 3 prompts that '
|
||||
'guide the candidate to describe '
|
||||
'specific aspects of the experience, '
|
||||
'such as details about the situation, '
|
||||
'their actions, and the reasons it left a '
|
||||
'lasting impression. Make sure that the '
|
||||
'generated question does not contain '
|
||||
'forbidden subjects in muslim countries.')
|
||||
'Create a question of medium difficulty for IELTS Speaking Part 2 '
|
||||
'that encourages candidates to narrate a '
|
||||
'personal experience or story related to the topic '
|
||||
'of "' + random.choice(mti_topics) + '". Include 3 prompts that '
|
||||
'guide the candidate to describe '
|
||||
'specific aspects of the experience, '
|
||||
'such as details about the situation, '
|
||||
'their actions, and the reasons it left a '
|
||||
'lasting impression. Make sure that the '
|
||||
'generated question does not contain '
|
||||
'forbidden subjects in muslim countries.')
|
||||
},
|
||||
{
|
||||
"role": "user",
|
||||
"content": 'The prompts must not be questions. Also include a suffix like the ones in the IELTS exams '
|
||||
'that start with "And explain why".'
|
||||
}
|
||||
]
|
||||
token_count = count_total_tokens(messages)
|
||||
|
||||
Reference in New Issue
Block a user