Spaces:
Sleeping
Sleeping
don't bail on reconnect
Browse files
llm.py
CHANGED
|
@@ -62,11 +62,13 @@ class LLM:
|
|
| 62 |
user_msg_parts = last_msg["content"]
|
| 63 |
else:
|
| 64 |
user_msg_parts = []
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
|
|
|
|
|
|
| 70 |
|
| 71 |
if user_msg_parts:
|
| 72 |
messages.append({"role": "user", "content": user_msg_parts})
|
|
|
|
| 62 |
user_msg_parts = last_msg["content"]
|
| 63 |
else:
|
| 64 |
user_msg_parts = []
|
| 65 |
+
|
| 66 |
+
if message:
|
| 67 |
+
if message["text"]:
|
| 68 |
+
user_msg_parts.append({"text": message["text"]})
|
| 69 |
+
if message["files"]:
|
| 70 |
+
for file in message["files"]:
|
| 71 |
+
user_msg_parts.extend(self._process_file(file))
|
| 72 |
|
| 73 |
if user_msg_parts:
|
| 74 |
messages.append({"role": "user", "content": user_msg_parts})
|