From 66e91bd316de271262e0d6120c9808c90a69da38 Mon Sep 17 00:00:00 2001 From: CaptainB Date: Fri, 29 Nov 2024 11:45:51 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=89=A7=E8=A1=8C?= =?UTF-8?q?=E5=8E=86=E5=8F=B2=E8=AF=A6=E6=83=85=E9=87=8C=E8=8A=82=E7=82=B9?= =?UTF-8?q?=E5=92=8C=E5=B7=A5=E4=BD=9C=E6=B5=81=E7=B1=BB=E5=9E=8B=E7=9A=84?= =?UTF-8?q?=E5=B1=95=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1049655 --user=刘瑞斌 【应用编排】图片理解模型,历史记录选择节点和工作流的效果反了 https://www.tapd.cn/57709429/s/1620986 --- .../impl/base_image_understand_node.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/apps/application/flow/step_node/image_understand_step_node/impl/base_image_understand_node.py b/apps/application/flow/step_node/image_understand_step_node/impl/base_image_understand_node.py index cc077a9ca..0ddd7e489 100644 --- a/apps/application/flow/step_node/image_understand_step_node/impl/base_image_understand_node.py +++ b/apps/application/flow/step_node/image_understand_step_node/impl/base_image_understand_node.py @@ -92,15 +92,24 @@ class BaseImageUnderstandNode(IImageUnderstandNode): 'history_message': history_message, 'question': question.content}, {}, _write_context=write_context) - @staticmethod - def get_history_message_for_details(history_chat_record, dialogue_number): + + def get_history_message_for_details(self, history_chat_record, dialogue_number): start_index = len(history_chat_record) - dialogue_number history_message = reduce(lambda x, y: [*x, *y], [ - [history_chat_record[index].get_human_message(), history_chat_record[index].get_ai_message()] + [self.generate_history_human_message_for_details(history_chat_record[index]), history_chat_record[index].get_ai_message()] for index in range(start_index if start_index > 0 else 0, len(history_chat_record))], []) return history_message + def generate_history_human_message_for_details(self, chat_record): + for data in chat_record.details.values(): + if self.node.id == data['node_id'] and 'image_list' in data: + image_list = data['image_list'] + if len(image_list) == 0 or data['dialogue_type'] == 'WORKFLOW': + return HumanMessage(content=chat_record.problem_text) + return HumanMessage(content=data['question']) + return HumanMessage(content=chat_record.problem_text) + def get_history_message(self, history_chat_record, dialogue_number): start_index = len(history_chat_record) - dialogue_number history_message = reduce(lambda x, y: [*x, *y], [ From cf4b4af6be85b8f53266a9447c04cc47767f49ec Mon Sep 17 00:00:00 2001 From: CaptainB Date: Fri, 29 Nov 2024 12:54:20 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E9=A6=96=E6=AC=A1?= =?UTF-8?q?=E6=89=93=E5=BC=80=E5=BA=94=E7=94=A8=E6=96=87=E4=BB=B6=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0=EF=BC=8C=E7=9B=B4=E6=8E=A5=E7=82=B9=E5=87=BB=E5=8F=91?= =?UTF-8?q?=E5=B8=83=E5=90=8E=E6=B2=A1=E6=9C=89=E6=98=BE=E7=A4=BA=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0=E6=8C=89=E9=92=AE=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/src/views/application-workflow/index.vue | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ui/src/views/application-workflow/index.vue b/ui/src/views/application-workflow/index.vue index da0965752..5da2bb8e0 100644 --- a/ui/src/views/application-workflow/index.vue +++ b/ui/src/views/application-workflow/index.vue @@ -241,9 +241,12 @@ function onmousedown(item: any) { function clickoutside() { showPopover.value = false } -function publicHandle() { +async function publicHandle() { // 先执行保存 - saveApplication() + const obj = { + work_flow: getGraphData() + } + await application.asyncPutApplication(id, obj) // 后执行发布 workflowRef.value ?.validate()