Image Studio: move tool_choice into params.custom_params (correct field)

Previous commit put tool_choice at the top level of params. Open WebUI
drops that silently — apply_model_params_to_body has a whitelist of
mapped param names (temperature, top_p, etc.) and tool_choice isn't
on it. The Custom Parameters UI section also only iterates
params.custom_params, which is why the value didn't appear there
after importing the preset.

Correct location is the custom_params sub-dict, where values go
through json.loads before being merged into the outgoing chat
completion body. 'required' stays a string after the failed
json.loads and ends up exactly where the OpenAI / Ollama tools spec
expects it.

Source: src/lib/components/chat/Settings/Advanced/AdvancedParams.svelte
(UI binding) and backend/open_webui/utils/payload.py (serialization).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-19 14:50:34 -05:00
co-authored by Claude Opus 4.7
parent f6f5690fcd
commit 780ce42711
@@ -8,7 +8,9 @@
"temperature": 0.5,
"top_p": 0.9,
"function_calling": "native",
"tool_choice": "required"
"custom_params": {
"tool_choice": "required"
}
},
"meta": {
"profile_image_url": "/static/favicon.png",