forked from phoenix/litellm-mirror
fix(utils.py): handle 'os.environ/' being passed in as kwargs
This commit is contained in:
parent
d87e59db25
commit
278f61f3ed
5 changed files with 68 additions and 4 deletions
|
@ -1627,6 +1627,10 @@ def client(original_function):
|
|||
logging_obj = function_setup(start_time, *args, **kwargs)
|
||||
kwargs["litellm_logging_obj"] = logging_obj
|
||||
|
||||
# CHECK FOR 'os.environ/' in kwargs
|
||||
for k,v in kwargs.items():
|
||||
if v is not None and isinstance(v, str) and v.startswith("os.environ/"):
|
||||
kwargs[k] = litellm.get_secret(v)
|
||||
# [OPTIONAL] CHECK BUDGET
|
||||
if litellm.max_budget:
|
||||
if litellm._current_cost > litellm.max_budget:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue