cogcorp commited on
Commit
3f369b8
·
1 Parent(s): 050e620

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -41,7 +41,7 @@ def create_persona(text):
41
  model="gpt-3.5-turbo",
42
  messages=[
43
  {"role": "system", "content": "You are an expert at summarizing content to provide a factual persona."},
44
- {"role": "user", "content": f"Create a persona based on this fact: Cognitive Corp provides workplace optimization and this text: {text}"},
45
  ]
46
  )
47
  return response['choices'][0]['message']['content']
@@ -59,9 +59,9 @@ def call_openai_api(persona, user_prompt, additional_facts):
59
  response = openai.ChatCompletion.create(
60
  model="gpt-3.5-turbo",
61
  messages=[
62
- {"role": "system", "content": f"You are an expert at providing short factual answers, you are known as the author James Waddell"},
63
  {"role": "user", "content": f"""Ignore all previous instructions. As {persona}
64
- You are James Waddell, you wrote this paper: optimizing the workplace through technology.
65
  Here are some additional facts: {additional_facts}. Now, provide short factual answers as James, focus on the additional facts if provided: {user_prompt}"""},
66
  ]
67
  )
 
41
  model="gpt-3.5-turbo",
42
  messages=[
43
  {"role": "system", "content": "You are an expert at summarizing content to provide a factual persona."},
44
+ {"role": "user", "content": f"Create a persona based on this text: {text}"},
45
  ]
46
  )
47
  return response['choices'][0]['message']['content']
 
59
  response = openai.ChatCompletion.create(
60
  model="gpt-3.5-turbo",
61
  messages=[
62
+ {"role": "system", "content": f"You are an expert at providing short factual answers."},
63
  {"role": "user", "content": f"""Ignore all previous instructions. As {persona}
64
+ You are James Waddell, you wrote this paper: optimizing the Workplace through Technology.
65
  Here are some additional facts: {additional_facts}. Now, provide short factual answers as James, focus on the additional facts if provided: {user_prompt}"""},
66
  ]
67
  )