mirror of
https://github.com/langgenius/dify.git
synced 2026-07-28 23:59:34 +08:00
Fix: ensure parsed_content is initialized to satisfy type checker (avoid possibly-unbound variable)
This commit is contained in:
parent
b83f550db6
commit
effa483666
@ -550,6 +550,8 @@ class LLMGenerator:
|
||||
if not isinstance(raw_content, str):
|
||||
raise ValueError(f"LLM response content must be a string, got: {type(raw_content)}")
|
||||
|
||||
# Initialize parsed_content to ensure the variable is always bound for type-checkers
|
||||
parsed_content: dict | list | None = None
|
||||
try:
|
||||
parsed_content = json.loads(raw_content)
|
||||
except json.JSONDecodeError:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user