This commit is contained in:
Rodrigo Flávio 2026-08-26 14:34:06 +08:00 committed by GitHub
commit cd86f13327
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -170,10 +170,13 @@ class OllamaChatConfig(BaseConfig):
if value.get("json_schema") and value["json_schema"].get("schema"):
optional_params["format"] = value["json_schema"]["schema"]
if param == "reasoning_effort" and value is not None:
if model.startswith("gpt-oss"):
optional_params["think"] = value
else:
optional_params["think"] = value in {"low", "medium", "high"}
if isinstance(value, dict):
value = value.get("effort")
if value is not None:
if model.startswith("gpt-oss"):
optional_params["think"] = value
else:
optional_params["think"] = value in {"low", "medium", "high"}
### FUNCTION CALLING LOGIC ###
# Ollama 0.4+ supports native tool calling - pass tools directly
# and let Ollama handle model capability detection