RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.
Go agent-harnessagent-native-databaseagentic-aiagentic-retrievalagentic-searchaiai-agentscontext-enginecontext-engineeringcontext-managementharness-engineeringknowledge-compilationragretrieval-augmented-generationretrieval-harnesssearch-harness
fix(agent): preserve zero temperature setting (#16897)
hyotaek kim760203be4261
diff --git a/agent/component/llm.py b/agent/component/llm.pyindex f50bd22edd..dbafe0267e 100644--- a/agent/component/llm.py+++ b/agent/component/llm.py@@ -70,7 +70,7 @@ class LLMParam(ComponentParamBase):if int(self.max_tokens) > 0 and get_attr("maxTokensEnabled"):conf["max_tokens"] = int(self.max_tokens)- if float(self.temperature) > 0 and get_attr("temperatureEnabled"):+ if float(self.temperature) >= 0 and get_attr("temperatureEnabled"):conf["temperature"] = float(self.temperature)if float(self.top_p) > 0 and get_attr("topPEnabled"):conf["top_p"] = float(self.top_p)diff --git a/test/unit_test/agent/component/test_llm_prompt.py b/test/unit_test/agent/component/test_llm_prompt.pyindex ebc011b08b..97db27e9c3 100644--- a/test/unit_test/agent/component/test_llm_prompt.py+++ b/test/unit_test/agent/component/test_llm_prompt.py@@ -59,3 +59,13 @@ def test_fit_messages_uses_default_context_when_max_length_zero():)assert err is Noneassert msg_fit[-1]["content"] == "User query: test"+++def test_gen_conf_includes_zero_temperature_when_enabled():+ """Include an explicitly enabled zero temperature in the model configuration."""+ param = LLMParam()+ param.temperature = 0+ param.temperatureEnabled = True++ assert param.gen_conf()["temperature"] == 0