Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -10,7 +10,8 @@ dashscope.api_key = YOUR_API_TOKEN
|
|
| 10 |
def add_text(chatbot, task_history, input):
|
| 11 |
"""Add text to the chat history."""
|
| 12 |
task_history.append({"role": "user", "content": [{"text": input.text}]})
|
| 13 |
-
|
|
|
|
| 14 |
chatbot.append([{
|
| 15 |
"text": input.text,
|
| 16 |
"files": input.files,
|
|
|
|
| 10 |
def add_text(chatbot, task_history, input):
|
| 11 |
"""Add text to the chat history."""
|
| 12 |
task_history.append({"role": "user", "content": [{"text": input.text}]})
|
| 13 |
+
if len (input.files) > 0:
|
| 14 |
+
task_history.append({"role": "user", "content": [{"audio": input.files[0].path}]})
|
| 15 |
chatbot.append([{
|
| 16 |
"text": input.text,
|
| 17 |
"files": input.files,
|