From 0cc0b6e0528470516767509b04956c148bc3d9cc Mon Sep 17 00:00:00 2001 From: takatost Date: Thu, 17 Aug 2023 15:33:35 +0800 Subject: [PATCH] fix: error raise status code not exist (#888) --- api/core/third_party/spark/spark_llm.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/api/core/third_party/spark/spark_llm.py b/api/core/third_party/spark/spark_llm.py index ae25a2b071..542565e732 100644 --- a/api/core/third_party/spark/spark_llm.py +++ b/api/core/third_party/spark/spark_llm.py @@ -102,7 +102,10 @@ class SparkLLMClient: data = json.loads(message) code = data['header']['code'] 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() else: choices = data["payload"]["choices"]