mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-08 08:08:37 +00:00
fix(openai_like): inline negation on provider disabled check to satisfy SIM103
This commit is contained in:
parent
703b982b77
commit
2e20b2754f
1 changed files with 5 additions and 7 deletions
|
|
@ -121,13 +121,11 @@ def create_config_class(provider: SimpleProviderConfig):
|
|||
except (ModelNotMappedError, KeyError, ValueError):
|
||||
pass
|
||||
|
||||
# State 4: Provider-wide explicit False applies when model has no explicit declaration
|
||||
if provider.provider_info and provider.provider_info.get("supports_function_calling") is False:
|
||||
return False
|
||||
|
||||
# State 1 (unmapped model) & State 2 (mapped model with missing/None declaration):
|
||||
# default to preserving tool parameters for OpenAI-compatible providers
|
||||
return True
|
||||
# State 4 (provider explicitly disabled) vs State 1 & 2 (unmapped / missing metadata):
|
||||
# Preserves tool parameters unless provider_info explicitly sets supports_function_calling to False
|
||||
return not (
|
||||
provider.provider_info and provider.provider_info.get("supports_function_calling") is False
|
||||
)
|
||||
|
||||
_supports_fc: Final = _check_supports_fc()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue