Update app.py
Browse files
app.py
CHANGED
@@ -283,6 +283,9 @@ def handle_non_stream(previous_messages, msg_id, model):
|
|
283 |
response_event.wait(timeout=30)
|
284 |
|
285 |
# 生成符合 Claude API 格式的完整响应
|
|
|
|
|
|
|
286 |
full_response = {
|
287 |
"id": msg_id,
|
288 |
"content": [{"text": ''.join(response_text), "type": "text"}], # 合并所有文本块,并设置类型
|
|
|
283 |
response_event.wait(timeout=30)
|
284 |
|
285 |
# 生成符合 Claude API 格式的完整响应
|
286 |
+
if not response_text:
|
287 |
+
response_text = [""]
|
288 |
+
|
289 |
full_response = {
|
290 |
"id": msg_id,
|
291 |
"content": [{"text": ''.join(response_text), "type": "text"}], # 合并所有文本块,并设置类型
|