Skip to content

Commit 5a46158

Browse files
authored
Update temperature handling for reasoning models
1 parent eb6dc3a commit 5a46158

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

openhands-sdk/openhands/sdk/llm/options/chat_options.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,8 @@ def select_chat_options(
3939
if llm.reasoning_effort is not None:
4040
out["reasoning_effort"] = llm.reasoning_effort
4141

42-
# OpenAI reasoning models (o1, o3) ignore temp/top_p
43-
# Gemini models DO respect temperature, so we only pop for OpenAI
44-
model_lower = llm.model.lower()
45-
# Normalize to basename so provider-prefixed IDs like "openai/o1" are handled
46-
model_name = model_lower.split("/")[-1]
47-
if model_name.startswith(("o1", "o3")):
42+
# All reasoning models ignore temp/top_p, except Gemini
43+
if "gemini" not in llm.model.lower():
4844
out.pop("temperature", None)
4945
out.pop("top_p", None)
5046

0 commit comments

Comments
 (0)