fix: error raise status code not exist (#888)
This commit is contained in:
parent
cd78adb0ab
commit
0cc0b6e052
1 changed files with 4 additions and 1 deletions
5
api/core/third_party/spark/spark_llm.py
vendored
5
api/core/third_party/spark/spark_llm.py
vendored
|
|
@ -102,7 +102,10 @@ class SparkLLMClient:
|
||||||
data = json.loads(message)
|
data = json.loads(message)
|
||||||
code = data['header']['code']
|
code = data['header']['code']
|
||||||
if code != 0:
|
if code != 0:
|
||||||
self.queue.put({'error': f"Code: {code}, Error: {data['header']['message']}"})
|
self.queue.put({
|
||||||
|
'status_code': 400,
|
||||||
|
'error': f"Code: {code}, Error: {data['header']['message']}"
|
||||||
|
})
|
||||||
ws.close()
|
ws.close()
|
||||||
else:
|
else:
|
||||||
choices = data["payload"]["choices"]
|
choices = data["payload"]["choices"]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue