Skip to content

LLM-Driven Extraction of Unstructured Data — Built for API Deployments & ETL Pipeline Workflows

UN-2980 [FIX] Handle null response (#1910)

Deepak Kfb137da0be12
diff --git a/workers/executor/executors/answer_prompt.py b/workers/executor/executors/answer_prompt.py
index 89936fe59..c22c8aaaf 100644
--- a/workers/executor/executors/answer_prompt.py
+++ b/workers/executor/executors/answer_prompt.py
@@ -333,7 +333,7 @@ class AnswerPromptService:
return
parsed_data = repair_json_with_best_structure(answer)
- if isinstance(parsed_data, str):
+ if not isinstance(parsed_data, (dict, list)):
logger.error("Error parsing response to JSON")
structured_output[prompt_key] = {}
return