Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

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

takatost0cc0b6e05284
diff --git a/api/core/third_party/spark/spark_llm.py b/api/core/third_party/spark/spark_llm.py
index ae25a2b0718..542565e7325 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"]