fix: coalesce None thinking_style to empty string in provider creation

ProviderConfig.thinking_style defaults to None (Optional field), but
create_dynamic_spec expects a string. Coalesce None to "" at all call
sites (factory.py, settings_api.py) and fix the test assertion to
expect None from the config default.
This commit is contained in:
axelray-dev
2026-06-25 22:53:15 +08:00
committed by Xubin Ren
parent 0e19ea3062
commit c661012754
3 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -54,7 +54,7 @@ def _make_provider_core(
if provider_name and not spec and p:
if not p.api_base:
raise ValueError(f"Provider '{provider_name}' requires api_base in config.")
spec = create_dynamic_spec(provider_name, thinking_style=p.thinking_style if p else "")
spec = create_dynamic_spec(provider_name, thinking_style=(p.thinking_style or "") if p else "")
if spec and spec.is_transcription_only:
raise ValueError(f"Provider '{provider_name}' only supports transcription.")
backend = spec.backend if spec else "openai_compat"