Bug fix: Some non-standard forms of error return are not caught (#1877)

这个提交包含在:
Menghuan1918
2024-07-01 20:35:49 +08:00
提交者 GitHub
父节点 18d3245fc9
当前提交 6cd2d80dfd

查看文件

@@ -44,7 +44,8 @@ def decode_chunk(chunk):
try: try:
chunk = json.loads(chunk[6:]) chunk = json.loads(chunk[6:])
except: except:
finish_reason = "JSON_ERROR" respose = "API_ERROR"
finish_reason = chunk
# 错误处理部分 # 错误处理部分
if "error" in chunk: if "error" in chunk:
respose = "API_ERROR" respose = "API_ERROR"