dlennon commited on
Commit
cb1984b
·
verified ·
1 Parent(s): a5b0fec

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -6,7 +6,7 @@ import os
6
  openai.api_key = os.getenv("OPENAI_API_KEY")
7
 
8
  def generate_video_script(title, formality_level, emotional_tone, engagement_level):
9
- messages = (
10
  f"[Use this video framework below]\n"
11
  f"First we need to have a strong hook.\n"
12
  f"A short intro that stops people from scrolling and holds their attention\n"
@@ -37,10 +37,10 @@ def generate_video_script(title, formality_level, emotional_tone, engagement_lev
37
  )
38
 
39
  response = openai.ChatCompletion.create(
40
- model="gpt-3.5-turbo",
41
- messages=messages,
42
- temperature=0.5,
43
- max_tokens=1000
44
  )
45
 
46
  script = response.choices[0].text.strip()
 
6
  openai.api_key = os.getenv("OPENAI_API_KEY")
7
 
8
  def generate_video_script(title, formality_level, emotional_tone, engagement_level):
9
+ prompt = (
10
  f"[Use this video framework below]\n"
11
  f"First we need to have a strong hook.\n"
12
  f"A short intro that stops people from scrolling and holds their attention\n"
 
37
  )
38
 
39
  response = openai.ChatCompletion.create(
40
+ engine="gpt-3.5-turbo",
41
+ prompt=prompt,
42
+ max_tokens=300,
43
+ stop="\n"
44
  )
45
 
46
  script = response.choices[0].text.strip()