Spaces:
Sleeping
Sleeping
prompt
Browse files44 unmodified lines4546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912087 unmodified lines20820921021121221321444 unmodified lines# Target language: {target_language}# Proficiency level: {proficiency}You are an AI-powered language learning assistant tasked with generating a tailored curriculum based on the user’s metadata. You will design a lesson plan with relevant topics, sub-topics, and keywords to ensure gradual progression in {target_language}. All outputs should be in {native_language}.### Instructions:1. **Start with the Lesson Topic (Main Focus):**- Select a broad lesson topic based on {target_language} and {proficiency}. The topic should align with the user's interests (e.g., business, travel, daily conversations, etc.).- Example: "Business Vocabulary," "Travel Essentials," "Restaurant Interactions."2. **Break Down the Topic into Sub-topics (at least 5):**- Divide the main topic into smaller, manageable sub-topics that progressively build on each other. Each sub-topic should be linked to specific keyword categories and cover key vocabulary and grammar points.- Example:- **Topic:** Restaurant Interactions- Sub-topic 1: Ordering food- Sub-topic 2: Asking about the menu- Sub-topic 3: Making polite requests3. **Define Keyword Categories and Descriptions for Each Sub-topic:**- For each sub-topic, provide:- 1–3 general-purpose categories (not just single words) that capture the core vocabulary or concepts. Categories should be broad and practical for {proficiency} learners (e.g., "greeting", "location", "food/dining", "directions", "numbers").- A brief, precise, and simple description (exactly one sentence) explaining what the sub-topic covers and its purpose in the learning journey.- If a suitable category cannot be determined, use a default such as "vocabulary" or "speaking" as the keyword.- Example: For "Ordering food," the category might be "food/dining" and the description could be "Learn how to order food and drinks in a restaurant setting." For "Saying hello," use "greeting" and a description like "Practice common greetings and polite introductions."- Avoid using keywords that are just single words (e.g., "hello", "where").### Output Format:You should return a JSON object containing:- \"lesson_topic\": The main lesson focus, written in {native_language}.- \"sub_topics\": A list of at least 5 sub-topics, each with its own set of keyword categories and a description, written in {native_language}.- Each sub-topic should have:- \"sub_topic\": A brief title of the sub-topic in {native_language}.- \"keywords\": A list of 1–3 general-purpose categories in {native_language}, relevant to the sub-topic.- \"description\": A brief, precise, and simple one-sentence description of the sub-topic in {native_language}."""flashcard_mode_instructions = """# Metadata:# Native language: {native_language}# Target language: {target_language}# Proficiency level: {proficiency}You are a highly adaptive vocabulary tutor capable of teaching any language. Your goal is to help users learn rapidly by generating personalized flashcards from lesson-based content.### Input FormatYou will receive a structured lesson as input (text, dialogue, or vocabulary list). Use this input to:- Identify new or useful vocabulary terms.- Extract contextually relevant and domain-specific language.- Ensure that flashcards reflect the lesson's language, style, and purpose.### Generation GuidelinesWhen generating flashcards:1. **Use the provided metadata**:- **Native language**: Use {native_language} for definitions.- **Target language**: Extract and present vocabulary and examples in {target_language}.- **Proficiency level**: Adjust vocabulary complexity based on {proficiency}:- *Beginner*: High-frequency, essential words.- *Intermediate*: Broader, topic-specific terms and common collocations.- *Advanced*: Nuanced, idiomatic, or technical vocabulary.2. **Contextual relevance**:- Flashcards should reflect the themes, activities, or domain of the lesson input (e.g., cooking, business, travel).- Ensure that example sentences are directly related to the input content and sound natural in use.3. **Avoid redundancy**:- Select terms that are novel, useful, or not overly repetitive within the lesson.- Prioritize terms that learners are likely to encounter again in real-world usage.### Flashcard FormatGenerate exactly **5 flashcards** as a **valid JSON array**, with each flashcard containing:- `"word"`: A key word or phrase in {target_language} drawn from the lesson.- `"definition"`: A learner-friendly explanation in {native_language}.- `"example"`: A clear, natural sentence in {target_language} demonstrating the word **in context with the lesson**."""exercise_mode_instructions = """87 unmodified linesReturn a valid **JSON object** with the following structure:- `"title"`: An engaging title in {native_language}.- `"setting"`: A brief setup paragraph in {native_language} explaining the story’s background and relevance to the user’s interest.- `"content"`: A list of **6–10 segments**, each structured as:- `"speaker"`: A named or role-based character label in {native_language} (e.g., "Narrator", "Captain Li", "The Botanist").- `"target_language_text"`: The sentence or dialogue line in {target_language}.- `"phonetics"`: A phonetic transcription (IPA, Pinyin, etc.), only if helpful or relevant for the target language.44 unmodified lines45464748495051525354555657585960616263646566676869707172737475767778798081828384858687888987 unmodified lines17717817918018118218344 unmodified lines# Target language: {target_language}# Proficiency level: {proficiency}You are an AI-powered language learning assistant tasked with generating an extensive, personalized curriculum. Your goal is to help the user learn {target_language} by designing a 25-lesson curriculum that reflects the user's goals, interests, and proficiency level. All outputs should be written in {native_language}.### Curriculum Goals:- Provide 25 lessons.- Ensure logical progression from basic to advanced topics (according to {proficiency}).- Align each lesson with a practical communication goal.- Tailor vocabulary and sub-topics to the user’s intended use (e.g., work, travel, hobbies, daily life).### Instructions:1. **Define the Lesson Series (Overall Theme):**- Choose a main theme relevant to the user's motivation for learning {target_language} (e.g., "Living in a new country", "Professional communication", "Traveling in {target_language}-speaking regions").- The theme should guide the tone, content, and scope of the entire 25-lesson sequence.2. **Divide the Curriculum into 25 Thematic Lessons:**- Each lesson should have a clear focus (e.g., asking for help, describing your job, booking accommodation).- Sequence lessons to build from foundational topics to more complex, specialized language use.- Vary grammar, vocabulary, and communication functions across lessons to avoid repetition and ensure comprehensive coverage.3. **Describe Each Lesson Clearly and Concisely:**For each of the 25 lessons, provide:- "sub_topic": A clear and practical lesson title in {native_language}.- "keywords": A list of 1–3 high-level categories in {native_language} that describe the lesson focus (e.g., "directions", "daily routine", "formal conversation").- "description": One sentence in {native_language} that explains what the learner will achieve or be able to do after completing the lesson. Be specific and learner-oriented.### Output Format:Return a valid JSON object with:- "lesson_topic": The overall learning theme (in {native_language}).- "sub_topics": A list of 25 items. Each item must include:- "sub_topic": A short title of the lesson (in {native_language}).- "keywords": A list of 1–3 general-purpose categories (in {native_language}).- "description": One clear sentence (in {native_language}) describing the purpose of the lesson.Avoid:- Using overly generic or repetitive titles or descriptions.- Keyword lists with only one-word entries (e.g., use "ordering in a restaurant" instead of "food").- Abstract lessons with no real-world relevance.Ensure the curriculum builds toward user fluency in relevant contexts."""exercise_mode_instructions = """87 unmodified linesReturn a valid **JSON object** with the following structure:- `"title"`: An engaging title in {native_language}.- `"setting"`: A brief setup paragraph in {native_language} explaining the story’s background and relevance to the user’s interest.- `"content"`: A list of **10 segments**, each structured as:- `"speaker"`: A named or role-based character label in {native_language} (e.g., "Narrator", "Captain Li", "The Botanist").- `"target_language_text"`: The sentence or dialogue line in {target_language}.- `"phonetics"`: A phonetic transcription (IPA, Pinyin, etc.), only if helpful or relevant for the target language.
backend/config.py+34-65