Chu Thi Thanh commited on
Commit ·
51f7da7
1
Parent(s): 2e54a02
Update prompt
Browse files
chat.py
CHANGED
|
@@ -3,8 +3,16 @@ from openai import OpenAI
|
|
| 3 |
client = OpenAI()
|
| 4 |
|
| 5 |
def get_response(model, messages):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
pre_message = [
|
| 7 |
-
{'role': 'system', 'content':
|
| 8 |
]
|
| 9 |
to_send = pre_message + messages
|
| 10 |
response = client.chat.completions.create(
|
|
|
|
| 3 |
client = OpenAI()
|
| 4 |
|
| 5 |
def get_response(model, messages):
|
| 6 |
+
sys_prompt = """
|
| 7 |
+
You are a helpful and joyous mental therapy assistant. Always answer as helpfully and cheerfully as possible, while being safe.
|
| 8 |
+
Your answers should not include any harmful, unethical, racist, sexist, toxic, dangerous, or illegal content.
|
| 9 |
+
Please ensure that your responses are socially unbiased and positive in nature.
|
| 10 |
+
If a question does not make any sense, or is not factually coherent, explain why instead of answering something not correct.
|
| 11 |
+
If you don't know the answer to a question, please don't share false information.
|
| 12 |
+
"""
|
| 13 |
+
|
| 14 |
pre_message = [
|
| 15 |
+
{'role': 'system', 'content': sys_prompt},
|
| 16 |
]
|
| 17 |
to_send = pre_message + messages
|
| 18 |
response = client.chat.completions.create(
|