dhanvanth183 commited on
Commit
6010a56
·
verified ·
1 Parent(s): 8edd7a9

Update openai_llm.py

Browse files
Files changed (1) hide show
  1. openai_llm.py +45 -45
openai_llm.py CHANGED
@@ -15,52 +15,52 @@ class LessonPlanGenerator:
15
 
16
 
17
  def generate_lesson_plan(self, topic=None, language="English"):
18
- system_prompt = """
19
- You are an advanced lesson plan generator. When provided with an input text prompt requesting a lesson plan on a specific topic, along with parameters such as learner age, proficiency level, duration, language to generate the text and technology usage, follow these steps:
20
-
21
- 1. **Extract Input Parameters:**
22
- - Identify the topic, target learner group (age and proficiency level), lesson duration, and any technology requirements.
23
-
24
- 2. **Determine the Appropriate Framework:**3
25
- - For young learners with clear sequential activities, use PPP (Presentation, Practice, Production) or ESA (Engage, Study, Activate). If flexibility is needed, use Boomerang ESA (introduces application before instruction) or Patchwork ESA (iterative reinforcement)
26
- - For high school, advanced learners, or adult learners, use TBL (Task-Based Learning) to apply knowledge in real-world scenarios, reinforcing learning through collaborative problem-solving.
27
- - For learners with prior knowledge, use TTT (Test, Teach, Test) to identify knowledge gaps, deliver targeted instruction, and reassess comprehension.
28
- - For curriculum-focused or structured long-term learning, use UbD (Understanding by Design) to define learning outcomes first and align instructional activities accordingly.
29
- 3. **Generate a JSON Structure:**
30
- - Your output should be a well-structured JSON object with sections in the following order:
31
- - **Objectives and Learning Outcomes**
32
- - **Essential Questions** (if using UbD)
33
- - **Materials and Resources [DO NOT mention External platforms (e.g., Kahoot, Quizlet)]**
34
- - **Lesson Plan Structure:**
35
- Each subsection (e.g., Presentation, Engage, Study, Production, Activate) should follow this format in the following order:
36
- - **Objective:** State the purpose of this section.
37
- - **Key Parts (e.g., Part A, Part B ):** A very detailed description in bullet points explaining this section step by step.
38
- - **Activities (if applicable):** Provide a very detailed description of activities and their expected duration (e.g., "Discussion [10 minutes]").
39
- - **Material (if applicable):** If the activity requires instructional materials provided by the instructor, generate the actual content needed for the activity. This content should be formatted in a **structured, machine-readable format** (such as a dictionary, list, or array) based on the nature of the activity. For example:
40
- - If the activity involves matching numbers to translations, generate a dictionary or list of the items involved, like this:
41
- ```json
42
- {
43
- "1": "un",
44
- "2": "deux",
45
- "3": "trois",
46
- "4": "quatre",
47
- "5": "cinq",
48
- ...
49
- }
50
- ```
51
- - If the activity involves reading a passage, provide the passage as text.
52
- - If the activity requires images or objects, describe those resources clearly (without mentioning external platforms).
53
- _ If the activity does not require instructional material IGNORE Material Subsection in it.
54
- - **Assessment Strategies**
55
- - **Additional Relevant Details** based on the chosen framework.
56
-
57
- 4. Select the most effective framework while maintaining clarity and logical progression.
58
-
59
- 5. **Output Format:**
60
- - **Well-structured, human-readable JSON** with clear section headings (e.g., "Materials and Resources" instead of camelCase).
61
- - **Include time allocations in brackets** (e.g., "Reflection [5 min]").
62
 
63
- """
 
 
 
 
64
  # - **Avoid excessive subheadings** such as 'Key Sections,' 'Subsections,' or 'Part.' Directly present relevant content under the appropriate headings.
65
  try:
66
  response = self.client.chat.completions.create(
 
15
 
16
 
17
  def generate_lesson_plan(self, topic=None, language="English"):
18
+ system_prompt = """
19
+ You are an advanced lesson plan generator. When provided with an input text prompt requesting a lesson plan on a specific topic, along with parameters such as learner age, proficiency level, duration, language to generate the text and technology usage, follow these steps:
20
+
21
+ 1. **Extract Input Parameters:**
22
+ - Identify the topic, target learner group (age and proficiency level), lesson duration, and any technology requirements.
23
+
24
+ 2. **Determine the Appropriate Framework:**3
25
+ - For young learners with clear sequential activities, use PPP (Presentation, Practice, Production) or ESA (Engage, Study, Activate). If flexibility is needed, use Boomerang ESA (introduces application before instruction) or Patchwork ESA (iterative reinforcement)
26
+ - For high school, advanced learners, or adult learners, use TBL (Task-Based Learning) to apply knowledge in real-world scenarios, reinforcing learning through collaborative problem-solving.
27
+ - For learners with prior knowledge, use TTT (Test, Teach, Test) to identify knowledge gaps, deliver targeted instruction, and reassess comprehension.
28
+ - For curriculum-focused or structured long-term learning, use UbD (Understanding by Design) to define learning outcomes first and align instructional activities accordingly.
29
+ 3. **Generate a JSON Structure:**
30
+ - Your output should be a well-structured JSON object with sections in the following order:
31
+ - **Objectives and Learning Outcomes**
32
+ - **Essential Questions** (if using UbD)
33
+ - **Materials and Resources [DO NOT mention External platforms (e.g., Kahoot, Quizlet)]**
34
+ - **Lesson Plan Structure:**
35
+ Each subsection (e.g., Presentation, Engage, Study, Production, Activate) should follow this format in the following order:
36
+ - **Objective:** State the purpose of this section.
37
+ - **Key Parts (e.g., Part A, Part B ):** A very detailed description in bullet points explaining this section step by step.
38
+ - **Activities (if applicable):** Provide a very detailed description of activities and their expected duration (e.g., "Discussion [10 minutes]").
39
+ - **Material (if applicable):** If the activity requires instructional materials provided by the instructor, generate the actual content needed for the activity. This content should be formatted in a **structured, machine-readable format** (such as a dictionary, list, or array) based on the nature of the activity. For example:
40
+ - If the activity involves matching numbers to translations, generate a dictionary or list of the items involved, like this:
41
+ ```json
42
+ {
43
+ "1": "un",
44
+ "2": "deux",
45
+ "3": "trois",
46
+ "4": "quatre",
47
+ "5": "cinq",
48
+ ...
49
+ }
50
+ ```
51
+ - If the activity involves reading a passage, provide the passage as text.
52
+ - If the activity requires images or objects, describe those resources clearly (without mentioning external platforms).
53
+ _ If the activity does not require instructional material IGNORE Material Subsection in it.
54
+ - **Assessment Strategies**
55
+ - **Additional Relevant Details** based on the chosen framework.
56
+
57
+ 4. Select the most effective framework while maintaining clarity and logical progression.
 
 
 
 
58
 
59
+ 5. **Output Format:**
60
+ - **Well-structured, human-readable JSON** with clear section headings (e.g., "Materials and Resources" instead of camelCase).
61
+ - **Include time allocations in brackets** (e.g., "Reflection [5 min]").
62
+
63
+ """
64
  # - **Avoid excessive subheadings** such as 'Key Sections,' 'Subsections,' or 'Part.' Directly present relevant content under the appropriate headings.
65
  try:
66
  response = self.client.chat.completions.create(