Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -34,8 +34,7 @@ def chatbot(input, history):
|
|
| 34 |
try:
|
| 35 |
# Call your chatbot function here
|
| 36 |
message = [{"role": "user", "content": input}]
|
| 37 |
-
|
| 38 |
-
messages = history + message
|
| 39 |
|
| 40 |
output = client.chat_completion(
|
| 41 |
messages=messages,
|
|
@@ -43,8 +42,6 @@ def chatbot(input, history):
|
|
| 43 |
temperature=0.7
|
| 44 |
)
|
| 45 |
|
| 46 |
-
history = history + [{"role": "assistant", "content": output.choices[0].message.content}]
|
| 47 |
-
|
| 48 |
return output.choices[0].message.content
|
| 49 |
|
| 50 |
except Exception as e:
|
|
|
|
| 34 |
try:
|
| 35 |
# Call your chatbot function here
|
| 36 |
message = [{"role": "user", "content": input}]
|
| 37 |
+
messages = message
|
|
|
|
| 38 |
|
| 39 |
output = client.chat_completion(
|
| 40 |
messages=messages,
|
|
|
|
| 42 |
temperature=0.7
|
| 43 |
)
|
| 44 |
|
|
|
|
|
|
|
| 45 |
return output.choices[0].message.content
|
| 46 |
|
| 47 |
except Exception as e:
|