fix image generation provider settings

This commit is contained in:
ZegWe
2026-05-22 17:42:01 +08:00
committed by Xubin Ren
parent 65dff4f3a5
commit ffd85a8611
4 changed files with 34 additions and 3 deletions
+4
View File
@@ -73,12 +73,16 @@ def _mask_secret_hint(secret: str | None) -> str | None:
def _provider_requires_api_key(spec: Any) -> bool:
if spec.backend == "azure_openai":
return True
if spec.is_oauth:
return False
if spec.is_local or spec.is_direct:
return False
return True
def _provider_configured_for_settings(spec: Any, provider_config: Any) -> bool:
if spec.is_oauth:
return True
if _provider_requires_api_key(spec):
return bool(provider_config.api_key)
return bool(