fix(extraction): resolve 'str' object has no attribute 'choices' error in LLMExtractionStrategy. Refs: #979

This patch ensures consistent handling of `response.choices[0].message.content` by avoiding redefinition
of the `response` variable, which caused downstream exceptions during error handling.
This commit is contained in:
ntohidi
2025-05-15 10:09:19 +02:00
parent a3b0cab52a
commit 32966bea11

View File

@@ -680,7 +680,7 @@ class LLMExtractionStrategy(ExtractionStrategy):
block["error"] = False
except Exception:
parsed, unparsed = split_and_parse_json_objects(
response.choices[0].message.content
response
)
blocks = parsed
if unparsed: