Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -8,8 +8,8 @@ openai.api_key = os.getenv("OPENAPI_KEY") # Replace with your key
|
|
8 |
def predict(message, history):
|
9 |
history_openai_format = []
|
10 |
for human, system in history:
|
11 |
-
history_openai_format.append({"role": "system", "content":os.getenv("PROMPT")})
|
12 |
history_openai_format.append({"role": "user", "content": human })
|
|
|
13 |
history_openai_format.append({"role": "user", "content": message})
|
14 |
|
15 |
response = openai.ChatCompletion.create(
|
|
|
8 |
def predict(message, history):
|
9 |
history_openai_format = []
|
10 |
for human, system in history:
|
|
|
11 |
history_openai_format.append({"role": "user", "content": human })
|
12 |
+
history_openai_format.append({"role": "system", "content":os.getenv("PROMPT")})
|
13 |
history_openai_format.append({"role": "user", "content": message})
|
14 |
|
15 |
response = openai.ChatCompletion.create(
|