feat(ollama): set 'think' to False when reasoning effort is not high/medium/low (#15763)

This commit is contained in:
Kowyo
2025-10-21 16:39:08 -07:00
committed by GitHub
parent 2a1dbb5b9e
commit 1fcadd6c05
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -188,7 +188,7 @@ class OllamaChatConfig(BaseConfig):
if model.startswith("gpt-oss"):
optional_params["think"] = value
else:
optional_params["think"] = True
optional_params["think"] = value in {"low", "medium", "high"}
### FUNCTION CALLING LOGIC ###
if param == "tools":
## CHECK IF MODEL SUPPORTS TOOL CALLING ##
@@ -183,7 +183,7 @@ class OllamaConfig(BaseConfig):
if model.startswith("gpt-oss"):
optional_params["think"] = value
else:
optional_params["think"] = True
optional_params["think"] = value in {"low", "medium", "high"}
elif param == "response_format" and isinstance(value, dict):
if value["type"] == "json_object":
optional_params["format"] = "json"