import gradio as gr import random from llm import get_prompt, get_responce def generate_questions(question_type): prompt, seed = get_prompt(question_type) questions = get_responce(prompt) return questions, seed def process_question_type(question_type): questions, seed = generate_questions(question_type) formatted_questions = [] for question in questions: question_text = question["question"] options = question.get("options", {}) answer = question["answer"] correction = question.get("correction", "") question_display = { "Question": question_text, "Answer": answer, "Correction": correction, "Options": options if options else None, } formatted_questions.append(question_display) return formatted_questions, seed def main(): question_types = [ "Choose the correct meaning of the word", "Personal response", "Give reasons", "Fill in the blanks", "True or False", ] # Create a Gradio interface with gr.Blocks() as demo: gr.Markdown("