fix knowledge retriever return

This commit is contained in:
takatost 2024-03-20 15:43:22 +08:00
parent b50f221327
commit 0d2a90adf3
1 changed files with 2 additions and 1 deletions

View File

@ -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'),