Update app.py
Browse files
app.py
CHANGED
|
@@ -7,15 +7,15 @@ openai.api_key = os.getenv("OPENAPI_KEY") # Replace with your key
|
|
| 7 |
|
| 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(
|
| 16 |
model='gpt-3.5-turbo',
|
| 17 |
messages= history_openai_format,
|
| 18 |
-
temperature=
|
| 19 |
stream=True
|
| 20 |
)
|
| 21 |
|
|
|
|
| 7 |
|
| 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(
|
| 16 |
model='gpt-3.5-turbo',
|
| 17 |
messages= history_openai_format,
|
| 18 |
+
temperature=0.5,
|
| 19 |
stream=True
|
| 20 |
)
|
| 21 |
|