Spaces:
Paused
Paused
Upload proxy_handler.py
Browse files- proxy_handler.py +4 -1
proxy_handler.py
CHANGED
|
@@ -63,10 +63,13 @@ class ProxyHandler:
|
|
| 63 |
import uuid
|
| 64 |
target_model = "0727-360B-API"
|
| 65 |
|
|
|
|
|
|
|
|
|
|
| 66 |
return {
|
| 67 |
"stream": True,
|
| 68 |
"model": target_model,
|
| 69 |
-
"messages":
|
| 70 |
"background_tasks": {
|
| 71 |
"title_generation": True,
|
| 72 |
"tags_generation": True
|
|
|
|
| 63 |
import uuid
|
| 64 |
target_model = "0727-360B-API"
|
| 65 |
|
| 66 |
+
# Correctly serialize ChatMessage objects to dictionaries
|
| 67 |
+
messages_as_dicts = [msg.model_dump() for msg in request.messages]
|
| 68 |
+
|
| 69 |
return {
|
| 70 |
"stream": True,
|
| 71 |
"model": target_model,
|
| 72 |
+
"messages": messages_as_dicts,
|
| 73 |
"background_tasks": {
|
| 74 |
"title_generation": True,
|
| 75 |
"tags_generation": True
|