Update app.py
Browse files
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
|
| 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
|
| 63 |
{"role": "user", "content": f"""Ignore all previous instructions. As {persona}
|
| 64 |
-
You are James Waddell, you wrote this paper: optimizing the
|
| 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 |
)
|