diff --git a/apps/application/flow/step_node/ai_chat_step_node/impl/base_chat_node.py b/apps/application/flow/step_node/ai_chat_step_node/impl/base_chat_node.py index 67999f37314..27cbe9e9cf7 100644 --- a/apps/application/flow/step_node/ai_chat_step_node/impl/base_chat_node.py +++ b/apps/application/flow/step_node/ai_chat_step_node/impl/base_chat_node.py @@ -523,9 +523,10 @@ def generate_prompt_question(self, prompt, model): images = self._process_images(image) if video and vision: videos = self._process_videos(video, model) - return HumanMessage( - content=[*videos, *images, {"type": "text", "text": self.workflow_manage.generate_prompt(prompt)}] - ) + prompt = self.workflow_manage.generate_prompt(prompt) + if images or videos: + return HumanMessage(content=[*videos, *images, {"type": "text", "text": prompt}]) + return HumanMessage(content=prompt) def is_vision(self): if "vision" in self.node_params_serializer.data: