Added a check to ensure the input text is a string before proceeding with parsing (#22809)
Co-authored-by: -LAN- <laipz8200@outlook.com>
This commit is contained in:
parent
82cc37bf51
commit
60c37fe492
4 changed files with 26 additions and 3 deletions
|
|
@ -114,7 +114,8 @@ class LLMGenerator:
|
|||
),
|
||||
)
|
||||
|
||||
questions = output_parser.parse(cast(str, response.message.content))
|
||||
text_content = response.message.get_text_content()
|
||||
questions = output_parser.parse(text_content) if text_content else []
|
||||
except InvokeError:
|
||||
questions = []
|
||||
except Exception:
|
||||
|
|
|
|||
|
|
@ -15,5 +15,4 @@ class SuggestedQuestionsAfterAnswerOutputParser:
|
|||
json_obj = json.loads(action_match.group(0).strip())
|
||||
else:
|
||||
json_obj = []
|
||||
|
||||
return json_obj
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue