smgc commited on
Commit
5beee5c
1 Parent(s): 8c30e80

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -0
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"}], # 合并所有文本块,并设置类型