Spaces:
Runtime error
Runtime error
arite commited on
Commit ·
25059c7
1
Parent(s): a4c8210
Fix: Update chatbot to use messages format instead of tuples
Browse files
app.py
CHANGED
|
@@ -370,8 +370,9 @@ def chat_with_avatar(message, history, use_tts, persona_selection, llm_preferenc
|
|
| 370 |
# Format response with model indicator
|
| 371 |
formatted_response = f"**{model_used}**\n\n{ai_response}"
|
| 372 |
|
| 373 |
-
# Update history
|
| 374 |
-
history.append(
|
|
|
|
| 375 |
|
| 376 |
return history, "", audio_file, get_avatar_display(True, ai_response)
|
| 377 |
|
|
|
|
| 370 |
# Format response with model indicator
|
| 371 |
formatted_response = f"**{model_used}**\n\n{ai_response}"
|
| 372 |
|
| 373 |
+
# Update history with proper message format
|
| 374 |
+
history.append({"role": "user", "content": message})
|
| 375 |
+
history.append({"role": "assistant", "content": formatted_response})
|
| 376 |
|
| 377 |
return history, "", audio_file, get_avatar_display(True, ai_response)
|
| 378 |
|