Spaces:
Runtime error
Runtime error
# AlpsData.py | |
strategy_text = { | |
"PEEL": ( | |
"PEEL strategy - Point, Evidence, Experience(s), Link back to the question", | |
"Structure your feedback using the PEEL strategy. Begin with a Point, provide Evidence, share Experience(s), and Link back to the question." | |
), | |
"5W1H": ( | |
"5W1H thinking frame (Who, What, Where, When, Why, How)", | |
"Structure your feedback using the 5W1H thinking frame. Address Who the user is talking about, What they are discussing, Where it's happening, When it's occurring, Why they feel that way, and How they express it." | |
), | |
"OREOS": ( | |
"OREOS thinking frame - Opinion, Reasons, Elaborate, Own Experiences, Suggestion", | |
"Structure your feedback using the OREOS thinking frame. Start with an Opinion, provide Reasons, Elaborate, share Own Experiences, and make a Suggestion." | |
) | |
} | |
description = ( | |
"The image showcases a promotional advertisement banner titled \"Bestsellers for the month of October!\" Underneath the title, there's a sub-caption that reads, \"Do not miss out! Now at a special discount for 3 days only!\"" | |
"\n\nThe items displayed in the advertisement are:" | |
"\n\nBestseller #1 - A board game. It is illustrated as a rectangular game box with question marks on its cover, suggesting the content or theme of the game might be a surprise or mystery." | |
"\n\nBestseller #2 - A gaming console. The illustration shows a sleek, flat gaming console device next to a controller with buttons and a joystick." | |
"\n\nBestseller #3 - Titled \"Smash It\", this item is depicted as a badminton racket paired with a shuttlecock." | |
"\n\nThe products are clearly labeled and emphasized to showcase their popularity and relevance for the month of October. The entire design aims to attract customers and prompt them to avail of the special discount." | |
) | |
questions = [ | |
f"1. Look at the picture. Would you be interested in playing with these toys and games? Why / Why not? ", | |
f"2. Do you spend a lot of time playing with toys and games? Why / Why not? ", | |
f"3. What do you think are some benefits of leisure activities? " | |
] | |
def generate_prompt(feedback_level): | |
if feedback_level == "Brief Feedback": | |
return "Strictly provide a brief feedback of around 25 words maximum in bullet points." | |
elif feedback_level == "Moderate Feedback": | |
return "Strictly provide a clear and concise feedback formatted in bullet points of around 50 words max." | |
elif feedback_level == "Comprehensive Feedback": | |
return "Provide a comprehensive feedback." | |
else: | |
raise ValueError(f"Invalid feedback level: {feedback_level}") | |
def generate_system_message(question_number, feedback_level): # Updated line to include feedback_level | |
# Determine strategy and explanation based on question number | |
if question_number == 1: | |
strategy, explanation = strategy_text["PEEL"] | |
elif question_number == 2: | |
strategy, explanation = strategy_text["5W1H"] | |
elif question_number == 3: | |
strategy, explanation = strategy_text["OREOS"] | |
else: | |
raise ValueError(f"Invalid question number: {question_number}") | |
feedback_prompt = generate_prompt(feedback_level) # Get the feedback prompt based on the feedback level | |
system_message = f""" | |
As your English Oral Coach, my role is to guide you as you prepare to answer the oral questions. I'll be asking thought-provoking questions to help you develop your own answers. | |
Now, let's focus on the {strategy}. {explanation} | |
Along the way, I'll prompt you to clarify your thoughts, explore key terms, challenge your reasoning, and reflect on the discussion. | |
Once we've thoroughly explored each part of the strategy, I'll assist you in assembling your thoughts into a comprehensive and eloquent response using the insights we've gathered. | |
Remember, our ultimate goal is to enhance your critical thinking skills and independence. Try to use sophisticated vocabulary and expressions, and refer to the picture where relevant to support your response. | |
Please ensure your response is in English. | |
{feedback_prompt} # New line to include the feedback prompt | |
""" | |
return system_message | |