From 0d2a90adf3e63cf8eef9fe9654ee01a46f97f589 Mon Sep 17 00:00:00 2001 From: takatost Date: Wed, 20 Mar 2024 15:43:22 +0800 Subject: [PATCH] fix knowledge retriever return --- api/core/workflow/nodes/llm/llm_node.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/core/workflow/nodes/llm/llm_node.py b/api/core/workflow/nodes/llm/llm_node.py index 21371488d4..27a8302537 100644 --- a/api/core/workflow/nodes/llm/llm_node.py +++ b/api/core/workflow/nodes/llm/llm_node.py @@ -262,7 +262,8 @@ class LLMNode(BaseNode): :param context_dict: context dict :return: """ - if '_source' in context_dict and context_dict['_source'] == 'knowledge': + if ('metadata' in context_dict and '_source' in context_dict['metadata'] + and context_dict['metadata']['_source'] == 'knowledge'): metadata = context_dict.get('metadata', {}) source = { 'position': metadata.get('position'),