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:
@@ -680,7 +680,7 @@ class LLMExtractionStrategy(ExtractionStrategy):
|
|||||||
block["error"] = False
|
block["error"] = False
|
||||||
except Exception:
|
except Exception:
|
||||||
parsed, unparsed = split_and_parse_json_objects(
|
parsed, unparsed = split_and_parse_json_objects(
|
||||||
response.choices[0].message.content
|
response
|
||||||
)
|
)
|
||||||
blocks = parsed
|
blocks = parsed
|
||||||
if unparsed:
|
if unparsed:
|
||||||
|
|||||||
Reference in New Issue
Block a user