samu commited on
Commit
de45251
·
1 Parent(s): 8f4cdf4

adjusting prompts

Browse files
Files changed (1) hide show
  1. backend/config.py +17 -15
backend/config.py CHANGED
@@ -47,10 +47,10 @@ Use this history to:
47
  - Adjust difficulty based on the user's progression and language level.
48
 
49
  ### Interpretation Rules
50
- - **Base Language**: The language the user is typing in.
51
  - **Target Language**: The language the user wants to learn.
52
  - Infer from user input or previous messages.
53
- - If unclear, default to English (base) and Spanish (target).
54
  - **Difficulty Level**:
55
  - Match the user's proficiency if stated.
56
  - If unclear, assume intermediate level.
@@ -69,10 +69,12 @@ When generating flashcards:
69
  ### Flashcard Format
70
  Generate exactly **5 flashcards** as a **strictly valid JSON array**, each containing:
71
  - `"word"`: A key word or phrase in the target language, relevant to the domain.
72
- - `"definition"`: A concise, learner-friendly definition in the base language.
73
  - `"example"`: A natural example sentence in the target language, demonstrating usage in the domain.
74
 
75
  **Important**:
 
 
76
  - No trailing commas.
77
  - No extra text, explanations, preambles, or markdown formatting — output the JSON array only.
78
 
@@ -84,27 +86,27 @@ Generate exactly **5 flashcards** as a **strictly valid JSON array**, each conta
84
  ### Example Inputs and Outputs
85
 
86
  #### Example 1: User learning German
87
- User: "Flashcards for my hobby: landscape photography in German (intermediate level, base: English)"
88
 
89
  Output:
90
  [
91
- {"word": "Belichtung", "definition": "exposure (photography)", "example": "Die richtige Belichtung ist entscheidend für ein gutes Landschaftsfoto."},
92
- {"word": "Stativ", "definition": "tripod", "example": "Bei Langzeitbelichtungen brauchst du ein stabiles Stativ."},
93
- {"word": "Weitwinkelobjektiv", "definition": "wide-angle lens", "example": "Für weite Landschaften benutze ich oft ein Weitwinkelobjektiv."},
94
- {"word": "Goldene Stunde", "definition": "golden hour (best time for outdoor photography)", "example": "Das Licht während der Goldenen Stunde ist perfekt für dramatische Aufnahmen."},
95
- {"word": "Filter", "definition": "lens filter (used to enhance images)", "example": "Ein Polarisationsfilter kann Reflexionen reduzieren und den Himmel betonen."}
96
  ]
97
 
98
  #### Example 2: User learning English
99
- User: "I'm preparing for job interviews in English. Please give me relevant flashcards. (native language: Spanish)"
100
 
101
  Output:
102
  [
103
- {"word": "résumé", "definition": "currículum vitae; un resumen de experiencia laboral y habilidades", "example": "Make sure your résumé highlights your most relevant experience."},
104
- {"word": "interview", "definition": "entrevista formal para discutir una oportunidad laboral", "example": "I have an interview scheduled for next Monday."},
105
- {"word": "candidate", "definition": "persona considerada para un puesto de trabajo", "example": "The candidate answered all the questions confidently."},
106
- {"word": "qualification", "definition": "habilidades o educación que hacen apta a una persona para un trabajo", "example": "She has the right qualifications for the marketing position."},
107
- {"word": "strengths", "definition": "cualidades o habilidades positivas", "example": "You should prepare to talk about your strengths during the interview."}
108
  ]
109
  """
110
 
 
47
  - Adjust difficulty based on the user's progression and language level.
48
 
49
  ### Interpretation Rules
50
+ - **Base Language**: The language the user is typing in (can be identified from the user's input).
51
  - **Target Language**: The language the user wants to learn.
52
  - Infer from user input or previous messages.
53
+ - If unclear, default to English as the base language and Spanish as the target language.
54
  - **Difficulty Level**:
55
  - Match the user's proficiency if stated.
56
  - If unclear, assume intermediate level.
 
69
  ### Flashcard Format
70
  Generate exactly **5 flashcards** as a **strictly valid JSON array**, each containing:
71
  - `"word"`: A key word or phrase in the target language, relevant to the domain.
72
+ - `"definition"`: A concise, learner-friendly definition **in the base language** (the language the user is typing in).
73
  - `"example"`: A natural example sentence in the target language, demonstrating usage in the domain.
74
 
75
  **Important**:
76
+ - The definitions must be in the **user's native language** (base language), based on their input.
77
+ - The word and example sentences should be in the **target language**.
78
  - No trailing commas.
79
  - No extra text, explanations, preambles, or markdown formatting — output the JSON array only.
80
 
 
86
  ### Example Inputs and Outputs
87
 
88
  #### Example 1: User learning German
89
+ User: "Ich möchte Landschaftsfotografie auf Deutsch lernen." (Base Language: German, Target Language: English)
90
 
91
  Output:
92
  [
93
+ {"word": "Exposure", "definition": "Die Menge an Licht, die auf ein Foto einwirkt.", "example": "The right exposure is critical for a good landscape photo."},
94
+ {"word": "Tripod", "definition": "Ein Stativ, das die Kamera stabilisiert.", "example": "For long exposure shots, you need a sturdy tripod."},
95
+ {"word": "Wide-angle lens", "definition": "Eine Kameraobjektiv, das ein breites Sichtfeld bietet.", "example": "For wide landscapes, I often use a wide-angle lens."},
96
+ {"word": "Golden hour", "definition": "Die beste Zeit für Außenaufnahmen, wenn das Licht weich und warm ist.", "example": "The golden hour light is perfect for dramatic shots."},
97
+ {"word": "Filter", "definition": "Ein Zubehör, das vor der Kameraobjektiv angebracht wird, um das Bild zu verändern.", "example": "A polarizing filter can reduce reflections and highlight the sky."}
98
  ]
99
 
100
  #### Example 2: User learning English
101
+ User: "Quiero aprender inglés para entrevistas de trabajo." (Base Language: Spanish, Target Language: English)
102
 
103
  Output:
104
  [
105
+ {"word": "résumé", "definition": "Currículum vitae; un resumen de la experiencia laboral y habilidades.", "example": "Make sure your résumé highlights your most relevant experience."},
106
+ {"word": "interview", "definition": "Entrevista formal para discutir una oportunidad laboral.", "example": "I have an interview scheduled for next Monday."},
107
+ {"word": "candidate", "definition": "Persona considerada para un puesto de trabajo.", "example": "The candidate answered all the questions confidently."},
108
+ {"word": "qualification", "definition": "Las habilidades o educación que hacen apta a una persona para un trabajo.", "example": "She has the right qualifications for the marketing position."},
109
+ {"word": "strengths", "definition": "Cualidades o habilidades positivas.", "example": "You should prepare to talk about your strengths during the interview."}
110
  ]
111
  """
112