mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 18:54:30 +00:00
(fix) proxy - fix when STORE_MODEL_IN_DB
should be set (#6492)
* set store_model_in_db at the top * correctly use store_model_in_db global
This commit is contained in:
parent
441adad3ae
commit
8e19a31d36
2 changed files with 33 additions and 5 deletions
|
@ -67,6 +67,29 @@ def get_secret_str(
|
|||
return value
|
||||
|
||||
|
||||
def get_secret_bool(
|
||||
secret_name: str,
|
||||
default_value: Optional[bool] = None,
|
||||
) -> Optional[bool]:
|
||||
"""
|
||||
Guarantees response from 'get_secret' is either boolean or none. Used for fixing linting errors.
|
||||
|
||||
Args:
|
||||
secret_name: The name of the secret to get.
|
||||
default_value: The default value to return if the secret is not found.
|
||||
|
||||
Returns:
|
||||
The secret value as a boolean or None if the secret is not found.
|
||||
"""
|
||||
_secret_value = get_secret(secret_name, default_value)
|
||||
if _secret_value is None:
|
||||
return None
|
||||
elif isinstance(_secret_value, bool):
|
||||
return _secret_value
|
||||
else:
|
||||
return str_to_bool(_secret_value)
|
||||
|
||||
|
||||
def get_secret( # noqa: PLR0915
|
||||
secret_name: str,
|
||||
default_value: Optional[Union[str, bool]] = None,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue