fix: 修复工作流对话bug (#1806)
This commit is contained in:
parent
fa3817574b
commit
5e42dcad09
@ -341,10 +341,12 @@ class ChatMessageSerializer(serializers.Serializer):
|
|||||||
user_id = chat_info.application.user_id
|
user_id = chat_info.application.user_id
|
||||||
chat_record_id = self.data.get('chat_record_id')
|
chat_record_id = self.data.get('chat_record_id')
|
||||||
chat_record = None
|
chat_record = None
|
||||||
|
history_chat_record = chat_info.chat_record_list
|
||||||
if chat_record_id is not None:
|
if chat_record_id is not None:
|
||||||
chat_record = self.get_chat_record(chat_info, chat_record_id)
|
chat_record = self.get_chat_record(chat_info, chat_record_id)
|
||||||
|
history_chat_record = [r for r in chat_info.chat_record_list if str(r.id) != chat_record_id]
|
||||||
work_flow_manage = WorkflowManage(Flow.new_instance(chat_info.work_flow_version.work_flow),
|
work_flow_manage = WorkflowManage(Flow.new_instance(chat_info.work_flow_version.work_flow),
|
||||||
{'history_chat_record': chat_info.chat_record_list, 'question': message,
|
{'history_chat_record': history_chat_record, 'question': message,
|
||||||
'chat_id': chat_info.chat_id, 'chat_record_id': str(
|
'chat_id': chat_info.chat_id, 'chat_record_id': str(
|
||||||
uuid.uuid1()) if chat_record is None else chat_record.id,
|
uuid.uuid1()) if chat_record is None else chat_record.id,
|
||||||
'stream': stream,
|
'stream': stream,
|
||||||
|
|||||||
@ -251,9 +251,9 @@ export class ChatRecordManage {
|
|||||||
(node_info.divider_content ? node_info.divider_content.splice(0).join('') : '') +
|
(node_info.divider_content ? node_info.divider_content.splice(0).join('') : '') +
|
||||||
node_info.current_node.buffer.splice(0).join(''),
|
node_info.current_node.buffer.splice(0).join(''),
|
||||||
node_info.answer_text_list_index,
|
node_info.answer_text_list_index,
|
||||||
current_node.chat_record_id,
|
node_info.current_node.chat_record_id,
|
||||||
current_node.runtime_node_id,
|
node_info.current_node.runtime_node_id,
|
||||||
current_node.child_node
|
node_info.current_node.child_node
|
||||||
)
|
)
|
||||||
if (node_info.current_node.buffer.length == 0) {
|
if (node_info.current_node.buffer.length == 0) {
|
||||||
node_info.current_node.is_end = true
|
node_info.current_node.is_end = true
|
||||||
|
|||||||
@ -331,8 +331,10 @@ onMounted(() => {
|
|||||||
set(props.nodeModel.properties.node_data, 'is_result', true)
|
set(props.nodeModel.properties.node_data, 'is_result', true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
set(props.nodeModel, 'validate', validate)
|
set(props.nodeModel, 'validate', validate)
|
||||||
|
if (!chat_data.value.dialogue_type) {
|
||||||
|
chat_data.value.dialogue_type = 'WORKFLOW'
|
||||||
|
}
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped></style>
|
<style lang="scss" scoped></style>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user