Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
|
@@ -115,9 +115,18 @@ def generator_agent(state: State) -> State:
|
|
| 115 |
|
| 116 |
topic = state["topic"]
|
| 117 |
|
| 118 |
-
generate_prompt = f"""Create a
|
| 119 |
|
| 120 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 121 |
|
| 122 |
{{
|
| 123 |
"title": "Create an engaging title related to {topic}",
|
|
@@ -137,22 +146,22 @@ Generate a JSON lesson with exactly this structure:
|
|
| 137 |
"conversation": "Create a realistic beginner-level dialogue related to {topic} with A and B speakers using simple Japanese. Include line breaks with \\n",
|
| 138 |
"conversationTranslation": "Provide English translation of the dialogue",
|
| 139 |
"vocabularies": [
|
| 140 |
-
{{"japanese": "
|
| 141 |
-
{{"japanese": "
|
| 142 |
-
{{"japanese": "
|
| 143 |
-
{{"japanese": "
|
| 144 |
-
{{"japanese": "
|
| 145 |
-
{{"japanese": "
|
| 146 |
-
{{"japanese": "
|
| 147 |
-
{{"japanese": "
|
| 148 |
-
{{"japanese": "
|
| 149 |
-
{{"japanese": "
|
| 150 |
],
|
| 151 |
"grammarPoints": [
|
| 152 |
-
{{"pattern": "
|
| 153 |
-
{{"pattern": "
|
| 154 |
-
{{"pattern": "
|
| 155 |
-
{{"pattern": "
|
| 156 |
],
|
| 157 |
"interactiveActivities": [
|
| 158 |
{{"type": "roleplay", "instruction": "Beginner-level roleplay instruction related to {topic}", "example": "Example dialogue or sentences"}},
|
|
|
|
| 115 |
|
| 116 |
topic = state["topic"]
|
| 117 |
|
| 118 |
+
generate_prompt = f"""You are an expert Japanese language instructor. Create a detailed, comprehensive lesson about: {topic}
|
| 119 |
|
| 120 |
+
IMPORTANT: You MUST return ONLY valid JSON. NO markdown, NO backticks, NO explanations.
|
| 121 |
+
|
| 122 |
+
For each vocabulary item, MUST include:
|
| 123 |
+
- Actual Japanese characters (e.g., こんにちは, 銀行, 友達)
|
| 124 |
+
- Romaji transcription
|
| 125 |
+
- English meaning
|
| 126 |
+
- Hiragana reading
|
| 127 |
+
- Example sentence with Japanese characters
|
| 128 |
+
|
| 129 |
+
Generate exactly this JSON structure (MUST be valid JSON):
|
| 130 |
|
| 131 |
{{
|
| 132 |
"title": "Create an engaging title related to {topic}",
|
|
|
|
| 146 |
"conversation": "Create a realistic beginner-level dialogue related to {topic} with A and B speakers using simple Japanese. Include line breaks with \\n",
|
| 147 |
"conversationTranslation": "Provide English translation of the dialogue",
|
| 148 |
"vocabularies": [
|
| 149 |
+
{{"japanese": "こんにちは", "romaji": "Konnichiwa", "meaning": "Hello", "hiragana": "こんにちは", "example": "こんにちは。お元気ですか?"}},
|
| 150 |
+
{{"japanese": "友達", "romaji": "Tomodachi", "meaning": "Friend", "hiragana": "ともだち", "example": "私の友達は学生です。"}},
|
| 151 |
+
{{"japanese": "話す", "romaji": "Hanasu", "meaning": "To talk/speak", "hiragana": "はなす", "example": "友達と話します。"}},
|
| 152 |
+
{{"japanese": "一緒に", "romaji": "Issho ni", "meaning": "Together", "hiragana": "いっしょに", "example": "友達と一緒に遊びます。"}},
|
| 153 |
+
{{"japanese": "楽しい", "romaji": "Tanoshii", "meaning": "Fun/enjoyable", "hiragana": "たのしい", "example": "友達との会話は楽しいです。"}},
|
| 154 |
+
{{"japanese": "笑う", "romaji": "Warau", "meaning": "To laugh", "hiragana": "わらう", "example": "一緒に笑います。"}},
|
| 155 |
+
{{"japanese": "学校", "romaji": "Gakkou", "meaning": "School", "hiragana": "がっこう", "example": "学校の友達です。"}},
|
| 156 |
+
{{"japanese": "遊ぶ", "romaji": "Asobu", "meaning": "To play/hang out", "hiragana": "あそぶ", "example": "放課後に遊びます。"}},
|
| 157 |
+
{{"japanese": "会う", "romaji": "Au", "meaning": "To meet", "hiragana": "あう", "example": "友達に会いました。"}},
|
| 158 |
+
{{"japanese": "大切", "romaji": "Taisetsu", "meaning": "Important/precious", "hiragana": "たいせつ", "example": "友達は大切です。"}}
|
| 159 |
],
|
| 160 |
"grammarPoints": [
|
| 161 |
+
{{"pattern": "N は N です", "level": "N5", "explanation": "Basic statement pattern. Used to state what something or someone is.", "example": "私は学生です。", "translation": "I am a student."}},
|
| 162 |
+
{{"pattern": "V ます (Polite present)", "level": "N5", "explanation": "Polite form of action verbs in present/future tense.", "example": "友達と話します。", "translation": "I talk with my friend."}},
|
| 163 |
+
{{"pattern": "と一緒に", "level": "N5", "explanation": "Means 'together with' or 'at the same time as'. Shows doing something with someone.", "example": "友達と一緒に遊びます。", "translation": "I play together with my friend."}},
|
| 164 |
+
{{"pattern": "N は 形容詞 です", "level": "N5", "explanation": "Using adjectives to describe nouns in polite form.", "example": "友達は楽しいです。", "translation": "My friend is fun."}}
|
| 165 |
],
|
| 166 |
"interactiveActivities": [
|
| 167 |
{{"type": "roleplay", "instruction": "Beginner-level roleplay instruction related to {topic}", "example": "Example dialogue or sentences"}},
|