jakaria6284 commited on
Commit
a5374ae
·
verified ·
1 Parent(s): 30614f2

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +25 -16
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 complete, detailed Japanese lesson about: {topic}
119
 
120
- Generate a JSON lesson with exactly this structure:
 
 
 
 
 
 
 
 
 
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": "Japanese word", "romaji": "romanization", "meaning": "English meaning", "hiragana": "hiragana", "example": "Example sentence using the word"}},
141
- {{"japanese": "Japanese word", "romaji": "romanization", "meaning": "English meaning", "hiragana": "hiragana", "example": "Example sentence"}},
142
- {{"japanese": "Japanese word", "romaji": "romanization", "meaning": "English meaning", "hiragana": "hiragana", "example": "Example sentence"}},
143
- {{"japanese": "Japanese word", "romaji": "romanization", "meaning": "English meaning", "hiragana": "hiragana", "example": "Example sentence"}},
144
- {{"japanese": "Japanese word", "romaji": "romanization", "meaning": "English meaning", "hiragana": "hiragana", "example": "Example sentence"}},
145
- {{"japanese": "Japanese word", "romaji": "romanization", "meaning": "English meaning", "hiragana": "hiragana", "example": "Example sentence"}},
146
- {{"japanese": "Japanese word", "romaji": "romanization", "meaning": "English meaning", "hiragana": "hiragana", "example": "Example sentence"}},
147
- {{"japanese": "Japanese word", "romaji": "romanization", "meaning": "English meaning", "hiragana": "hiragana", "example": "Example sentence"}},
148
- {{"japanese": "Japanese word", "romaji": "romanization", "meaning": "English meaning", "hiragana": "hiragana", "example": "Example sentence"}},
149
- {{"japanese": "Japanese word", "romaji": "romanization", "meaning": "English meaning", "hiragana": "hiragana", "example": "Example sentence"}}
150
  ],
151
  "grammarPoints": [
152
- {{"pattern": "Grammar pattern 1", "level": "N5", "explanation": "Detailed explanation of this grammar pattern", "example": "Example sentence using this pattern", "translation": "English translation of example"}},
153
- {{"pattern": "Grammar pattern 2", "level": "N5", "explanation": "Detailed explanation of this grammar pattern", "example": "Example sentence using this pattern", "translation": "English translation of example"}},
154
- {{"pattern": "Grammar pattern 3", "level": "N5", "explanation": "Detailed explanation of this grammar pattern", "example": "Example sentence using this pattern", "translation": "English translation of example"}},
155
- {{"pattern": "Grammar pattern 4", "level": "N5", "explanation": "Detailed explanation of this grammar pattern", "example": "Example sentence using this pattern", "translation": "English translation of example"}}
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"}},