Spaces:
Running
Running
prompt
Browse files- backend/config.py +39 -0
backend/config.py
CHANGED
@@ -137,6 +137,45 @@ Return exactly **5** cloze-style exercises as a **JSON array**, each element wit
|
|
137 |
_Do not wrap the array in any additional objects or metadata—output only the raw JSON array._
|
138 |
"""
|
139 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
140 |
simulation_mode_instructions = """
|
141 |
# Metadata:
|
142 |
# Native language: {native_language}
|
|
|
137 |
_Do not wrap the array in any additional objects or metadata—output only the raw JSON array._
|
138 |
"""
|
139 |
|
140 |
+
flashcard_mode_instructions = """
|
141 |
+
# Metadata:
|
142 |
+
# Native language: {native_language}
|
143 |
+
# Target language: {target_language}
|
144 |
+
# Proficiency level: {proficiency}
|
145 |
+
|
146 |
+
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.
|
147 |
+
|
148 |
+
### Input Format
|
149 |
+
You will receive a structured lesson as input (text, dialogue, or vocabulary list). Use this input to:
|
150 |
+
- Identify new or useful vocabulary terms.
|
151 |
+
- Extract contextually relevant and domain-specific language.
|
152 |
+
- Ensure that flashcards reflect the lesson's language, style, and purpose.
|
153 |
+
|
154 |
+
### Generation Guidelines
|
155 |
+
When generating flashcards:
|
156 |
+
1. **Use the provided metadata**:
|
157 |
+
- **Native language**: Use {native_language} for definitions.
|
158 |
+
- **Target language**: Extract and present vocabulary and examples in {target_language}.
|
159 |
+
- **Proficiency level**: Adjust vocabulary complexity based on {proficiency}:
|
160 |
+
- *Beginner*: High-frequency, essential words.
|
161 |
+
- *Intermediate*: Broader, topic-specific terms and common collocations.
|
162 |
+
- *Advanced*: Nuanced, idiomatic, or technical vocabulary.
|
163 |
+
|
164 |
+
2. **Contextual relevance**:
|
165 |
+
- Flashcards should reflect the themes, activities, or domain of the lesson input (e.g., cooking, business, travel).
|
166 |
+
- Ensure that example sentences are directly related to the input content and sound natural in use.
|
167 |
+
|
168 |
+
3. **Avoid redundancy**:
|
169 |
+
- Select terms that are novel, useful, or not overly repetitive within the lesson.
|
170 |
+
- Prioritize terms that learners are likely to encounter again in real-world usage.
|
171 |
+
|
172 |
+
### Flashcard Format
|
173 |
+
Generate exactly **5 flashcards** as a **valid JSON array**, with each flashcard containing:
|
174 |
+
- `"word"`: A key word or phrase in {target_language} drawn from the lesson.
|
175 |
+
- `"definition"`: A learner-friendly explanation in {native_language}.
|
176 |
+
- `"example"`: A clear, natural sentence in {target_language} demonstrating the word **in context with the lesson**.
|
177 |
+
"""
|
178 |
+
|
179 |
simulation_mode_instructions = """
|
180 |
# Metadata:
|
181 |
# Native language: {native_language}
|