mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-07-21 15:11:08 +08:00
fix(agent): preserve zero temperature setting (#16897)
### Summary - Preserve an explicitly enabled `temperature=0` in the Agent LLM configuration. - Continue excluding invalid negative temperature values. - Add a focused regression test to the existing Agent LLM test file. Fixes #16683
This commit is contained in:
@@ -59,3 +59,13 @@ def test_fit_messages_uses_default_context_when_max_length_zero():
|
||||
)
|
||||
assert err is None
|
||||
assert msg_fit[-1]["content"] == "User query: test"
|
||||
|
||||
|
||||
@pytest.mark.p1
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user