swcrazyfan commited on
Commit
b88bca6
·
1 Parent(s): b69ffd9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -18
app.py CHANGED
@@ -6,22 +6,20 @@ openai.api_key = os.environ["OPENAI_API_KEY"]
6
 
7
  def generate_pptx(lesson_topic):
8
  prompt = (
9
- "I need you to create PowerPoint slides based on a given lesson plan. Create a set of clear and concise PowerPoint slides to help a teacher effectively teach the lesson described in the given lesson plan:\n"
10
- f"{lesson_topic}\n\n"
11
- "The slides should be visually engaging and include concise headings, bullet points, and relevant images or icons. Make sure to provide any necessary information, such as activity steps or reflection questions. Limit each slide to a maximum of 3-4 sub-points and a single image or icon when relevant. If necessary, divide the same heading into multiple slides to make the points more clear."
12
- "For the first slide, include the lesson title and any relevant sub-points. Choose a PowerPoint theme from these options: dark, light, corporate, or playful, depending on the lesson's context."
13
- "The output should be suitable for use with the python-pptx library to create a PowerPoint presentation.\n\n"
14
- "Lesson Plan:\n\n"
15
- "lesson_plan_content\n\n"
16
- "For each slide, provide this information:\n\n"
17
- "#. Slide (slide_title):\n"
18
- "Heading: concise_heading\n"
19
- "Sub-point 1:\n"
20
- "Sub-point 2:\n"
21
- "...\n"
22
- "If an image is relevant, include: 'Image: short_description_of_image'\n"
23
- "If an icon is relevant, include: 'Icon: font_awesome_icon_code the python library will understand'\n\n"
24
- "When creating the slides, remember to use clear and concise language, appropriate images or icons, and choose a suitable theme for the PowerPoint presentation."
25
  )
26
 
27
  response = openai.ChatCompletion.create(
@@ -38,8 +36,8 @@ def generate_pptx(lesson_topic):
38
  max_tokens=1000,
39
  n=1,
40
  stop=None,
41
- temperature=0.6,
42
- top_p=0.9,
43
  )
44
 
45
  output = response.choices[0]['message']['content']
 
6
 
7
  def generate_pptx(lesson_topic):
8
  prompt = (
9
+ "I need you to create a set of PowerPoint slides that will help teachers summarize and emphasize key points for their students during a lesson. The slides should be visually engaging and include concise headings, bullet points, and relevant images or icons. Make sure to provide any necessary information, such as activity steps or reflection questions. Limit each slide to a maximum of 3-4 sub-points and a single image or icon when relevant. If necessary, divide the same heading into multiple slides to make the points more clear."
10
+ "\n\nFor the first slide, include the lesson title and any relevant sub-points such as. Also, include a closing slide with takeaways from the lesson. Choose a PowerPoint theme from these options: dark, light, corporate, or playful, depending on the lesson's context."
11
+ "\n\nThe output should be suitable for use with the python-pptx library to create a PowerPoint presentation.\n\n"
12
+ "Lesson Plan:\n\n"
13
+ "lesson_plan_content\n\n"
14
+ "For each slide, provide this information:\n\n"
15
+ "#. Slide (slide_title):\n"
16
+ "Heading: concise_heading\n"
17
+ "Sub-point 1:\n"
18
+ "Sub-point 2:\n"
19
+ "...\n"
20
+ "If an image is relevant, include: 'Image: short_description_of_image'\n"
21
+ "If an icon is relevant, include: 'Icon: font_awesome_icon_code the python library will understand without anything else'\n\n"
22
+ "When creating the slides, remember to use clear and concise language, write the slides for the students to understand, and use appropriate images or icons, and choose a suitable theme for the PowerPoint presentation. Follow the template clearly."
 
 
23
  )
24
 
25
  response = openai.ChatCompletion.create(
 
36
  max_tokens=1000,
37
  n=1,
38
  stop=None,
39
+ temperature=0.7,
40
+ # top_p=0.9,
41
  )
42
 
43
  output = response.choices[0]['message']['content']