fix: 修复文档提取参数选择了开始问题报会话不存在的问题
Some checks are pending
sync2gitee / repo-sync (push) Waiting to run
Typos Check / Spell Check with Typos (push) Waiting to run

--bug=1049648 --user=刘瑞斌 【应用编排】文档内容提取节点,节点设置选择 “开始-用户问题” 对话报错 https://www.tapd.cn/57709429/s/1619714
This commit is contained in:
CaptainB 2024-11-28 11:05:45 +08:00 committed by 刘瑞斌
parent b7905198a2
commit c3d92e8dc8
2 changed files with 5 additions and 1 deletions

View File

@ -16,7 +16,7 @@ class BaseDocumentExtractNode(IDocumentExtractNode):
self.context['document_list'] = document
content = []
splitter = '\n`-----------------------------------`\n'
if document is None:
if document is None or not isinstance(document, list):
return NodeResult({'content': content}, {})
for doc in document:

View File

@ -66,6 +66,10 @@ class BaseImageUnderstandNode(IImageUnderstandNode):
def execute(self, model_id, system, prompt, dialogue_number, dialogue_type, history_chat_record, stream, chat_id, chat_record_id,
image,
**kwargs) -> NodeResult:
# 处理不正确的参数
if image is None or not isinstance(image, list):
image = []
image_model = get_model_instance_by_model_user_id(model_id, self.flow_params_serializer.data.get('user_id'))
# 执行详情中的历史消息不需要图片内容
history_message =self.get_history_message_for_details(history_chat_record, dialogue_number)