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

This commit is contained in:
Kowyo 2025-10-22 07:39:08 +08:00 committed by GitHub
parent 2a1dbb5b9e
commit 1fcadd6c05
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

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 ##

View file

@ -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"