fix knowledge retriever return

This commit is contained in:
takatost 2024-03-20 15:43:22 +08:00
parent b50f221327
commit 0d2a90adf3

View File

@ -262,7 +262,8 @@ class LLMNode(BaseNode):
:param context_dict: context dict :param context_dict: context dict
:return: :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', {}) metadata = context_dict.get('metadata', {})
source = { source = {
'position': metadata.get('position'), 'position': metadata.get('position'),