mirror of
http://112.124.100.131/huang.ze/ebiz-dify-ai.git
synced 2025-12-07 18:06:52 +08:00
Update parse.py to handle empty list result (#10915)
Co-authored-by: crazywoola <427733928@qq.com>
This commit is contained in:
@@ -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]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user