mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-12 19:08:58 +08:00
Update parse.py to handle empty list result (#10915)
Co-authored-by: crazywoola <427733928@qq.com>
This commit is contained in:
parent
ea0ebc020c
commit
83b6abf4ad
@ -40,6 +40,9 @@ class JSONParseTool(BuiltinTool):
|
||||
expr = parse(json_filter)
|
||||
result = [match.value for match in expr.find(input_data)]
|
||||
|
||||
if not result:
|
||||
return ""
|
||||
|
||||
if len(result) == 1:
|
||||
result = result[0]
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user