Support for Ollama Structured output json_schema (#11880)

This commit is contained in:
Thakee Nathees 2025-06-21 11:49:53 +05:30 committed by GitHub
parent aaa41d1e24
commit 34bfaf5e71
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -179,6 +179,8 @@ class OllamaConfig(BaseConfig):
if param == "response_format" and isinstance(value, dict):
if value["type"] == "json_object":
optional_params["format"] = "json"
elif value["type"] == "json_schema":
optional_params["format"] = value["json_schema"]["schema"]
return optional_params