diff --git a/api/core/workflow/nodes/llm/node.py b/api/core/workflow/nodes/llm/node.py index 05c1364a78..280f3e310d 100644 --- a/api/core/workflow/nodes/llm/node.py +++ b/api/core/workflow/nodes/llm/node.py @@ -1182,4 +1182,4 @@ def _handle_completion_template( contents=[TextPromptMessageContent(data=result_text)], role=PromptMessageRole.USER ) prompt_messages.append(prompt_message) - return prompt_messages \ No newline at end of file + return prompt_messages diff --git a/api/tests/integration_tests/workflow/nodes/test_llm.py b/api/tests/integration_tests/workflow/nodes/test_llm.py index 4f73fe6af9..da014c6a22 100644 --- a/api/tests/integration_tests/workflow/nodes/test_llm.py +++ b/api/tests/integration_tests/workflow/nodes/test_llm.py @@ -404,4 +404,4 @@ def test_execute_llm_with_thinking_tags(flask_req_ctx, thinking_tags_enabled, sh assert "" not in output_text assert "Hello! How can I help you today?" in output_text # Verify thinking content is not in output - assert "Let me think about this greeting..." not in output_text \ No newline at end of file + assert "Let me think about this greeting..." not in output_text diff --git a/api/tests/unit_tests/core/workflow/nodes/llm/test_node.py b/api/tests/unit_tests/core/workflow/nodes/llm/test_node.py index 5b5332e611..79841f2b02 100644 --- a/api/tests/unit_tests/core/workflow/nodes/llm/test_node.py +++ b/api/tests/unit_tests/core/workflow/nodes/llm/test_node.py @@ -795,6 +795,7 @@ more context or rephrase your question? I'm here to help!""" def test_environment_variable_enabled(self): """Test that environment variable is properly read when enabled.""" from core.workflow.nodes.llm.node import LLM_NODE_THINKING_TAGS_ENABLED + assert LLM_NODE_THINKING_TAGS_ENABLED is True @mock.patch.dict("os.environ", {"LLM_NODE_THINKING_TAGS_ENABLED": "false"}) @@ -802,13 +803,17 @@ more context or rephrase your question? I'm here to help!""" """Test that environment variable is properly read when disabled.""" # Need to reimport to get the updated value import importlib + import core.workflow.nodes.llm.node + importlib.reload(core.workflow.nodes.llm.node) from core.workflow.nodes.llm.node import LLM_NODE_THINKING_TAGS_ENABLED + assert LLM_NODE_THINKING_TAGS_ENABLED is False def test_environment_variable_default(self): """Test that environment variable defaults to True.""" from core.workflow.nodes.llm.node import LLM_NODE_THINKING_TAGS_ENABLED + # Default should be True for backward compatibility assert LLM_NODE_THINKING_TAGS_ENABLED is True