From 2339b6a80cc3704c3d9c7f79c40bc23f5367476e Mon Sep 17 00:00:00 2001 From: "liuchangsheng@wisdomidata.com" Date: Sun, 22 Jun 2025 22:29:15 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90Dify=E3=80=91=20=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89vanna=E6=8F=92=E4=BB=B6=EF=BC=8C=E6=89=A7=E8=A1=8C?= =?UTF-8?q?=E6=8A=A5=E9=94=99=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/core/workflow/nodes/llm/node.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/api/core/workflow/nodes/llm/node.py b/api/core/workflow/nodes/llm/node.py index ee181cf3bf..5c764b8354 100644 --- a/api/core/workflow/nodes/llm/node.py +++ b/api/core/workflow/nodes/llm/node.py @@ -553,8 +553,7 @@ class LLMNode(BaseNode[LLMNodeData]): model_schema = model.model_type_instance.get_model_schema(node_data_model.name, model.credentials) if not model_schema: raise ModelNotExistError(f"Model {node_data_model.name} not exist.") - - if self.node_data.structured_output_enabled: + if "structured_output_enabled" in self.node_data and self.node_data.structured_output_enabled: if model_schema.support_structure_output: node_data_model.completion_params = self._handle_native_json_schema( node_data_model.completion_params, model_schema.parameter_rules @@ -784,7 +783,7 @@ class LLMNode(BaseNode[LLMNodeData]): ) if not model_schema: raise ModelNotExistError(f"Model {self.node_data.model.name} not exist.") - if self.node_data.structured_output_enabled: + if "structured_output_enabled" in self.node_data and self.node_data.structured_output_enabled: if not model_schema.support_structure_output: filtered_prompt_messages = self._handle_prompt_based_schema( prompt_messages=filtered_prompt_messages,