Bläddra i källkod

fix: error raise status code not exist (#888)

tags/0.3.15
takatost 2 år sedan
förälder
incheckning
0cc0b6e052
Inget konto är kopplat till bidragsgivarens mejladress
1 ändrade filer med 4 tillägg och 1 borttagningar
  1. 4
    1
      api/core/third_party/spark/spark_llm.py

+ 4
- 1
api/core/third_party/spark/spark_llm.py Visa fil

@@ -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"]

Laddar…
Avbryt
Spara