From 198d88b011337f44054917d9f6c1cd7557c22062 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E8=89=AF?= <841369634@qq.com> Date: Mon, 27 Apr 2026 17:46:38 +0800 Subject: [PATCH] fix: Fix the wrong image url in the execution details of the `Image understand` node --- .../impl/base_image_understand_node.py | 4 ++-- apps/users/serializers/user.py | 1 - ui/src/components/execution-detail-card/index.vue | 2 +- 3 files changed, 3 insertions(+), 4 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 2ae04fb9893..ef7ff1534bd 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 @@ -18,7 +18,7 @@ def _write_context(node_variable: Dict, workflow_variable: Dict, node: INode, workflow, answer: str, reasoning_content: str): chat_model = node_variable.get('chat_model') - message_tokens = node_variable['usage_metadata']['output_tokens'] if 'usage_metadata' in node_variable else 0 + message_tokens = chat_model.get_num_tokens_from_messages(node_variable.get('message_list')) answer_tokens = chat_model.get_num_tokens(answer) node.context['message_tokens'] = message_tokens node.context['answer_tokens'] = answer_tokens @@ -256,7 +256,7 @@ def generate_history_human_message(self, chat_record): *[{'type': 'image_url', 'image_url': {'url': f'data:image/{base64_image[1]};base64,{base64_image[0]}'}} for base64_image in image_base64_list], - *[{'type': 'image_url', 'image_url': url} for url in url_list] + *[{'type': 'image_url', 'image_url': {'url': url}} for url in url_list] ]) return HumanMessage(content=chat_record.problem_text) diff --git a/apps/users/serializers/user.py b/apps/users/serializers/user.py index 08b10e9cc69..139b4b93640 100644 --- a/apps/users/serializers/user.py +++ b/apps/users/serializers/user.py @@ -31,7 +31,6 @@ from common.utils.common import valid_license, password_encrypt, password_verify, get_random_chars from common.utils.rsa_util import decrypt from maxkb import settings -from maxkb.const import CONFIG from maxkb.conf import PROJECT_DIR from maxkb.const import CONFIG from system_manage.models import SystemSetting, SettingType, AuthTargetType, WorkspaceUserResourcePermission diff --git a/ui/src/components/execution-detail-card/index.vue b/ui/src/components/execution-detail-card/index.vue index 91c87c347c6..03a4c3f1302 100644 --- a/ui/src/components/execution-detail-card/index.vue +++ b/ui/src/components/execution-detail-card/index.vue @@ -595,7 +595,7 @@