Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

Update parse.py to handle empty list result (#10915)

Pedro Gomes83b6abf4ad01
diff --git a/api/core/tools/provider/builtin/json_process/tools/parse.py b/api/core/tools/provider/builtin/json_process/tools/parse.py
index 37cae401533..f91432ee77f 100644
--- a/api/core/tools/provider/builtin/json_process/tools/parse.py
+++ b/api/core/tools/provider/builtin/json_process/tools/parse.py
@@ -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]