mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2026-04-05 22:55:22 +00:00
API: Fix tool call parser crash on non-dict JSON output
This commit is contained in:
parent
8ecdb41078
commit
fc35acab9b
1 changed files with 2 additions and 0 deletions
|
|
@ -699,6 +699,8 @@ def parse_tool_call(answer: str, tool_names: list[str], return_prefix: bool = Fa
|
|||
if not isinstance(candidates, list):
|
||||
candidates = [candidates]
|
||||
for candidate_dict in candidates:
|
||||
if not isinstance(candidate_dict, dict):
|
||||
continue
|
||||
checked_candidate = check_and_sanitize_tool_call_candidate(candidate_dict, tool_names)
|
||||
if checked_candidate is not None:
|
||||
matches.append(checked_candidate)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue