mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-29 01:42:19 +00:00
fix: avoid mutating caller fallback dicts in async_completion_with_fallbacks
This commit is contained in:
parent
a72414a061
commit
105b45967a
1 changed files with 3 additions and 2 deletions
|
|
@ -47,8 +47,9 @@ async def async_completion_with_fallbacks(**kwargs):
|
|||
completion_kwargs = safe_deep_copy(base_kwargs)
|
||||
# Handle dictionary fallback configurations
|
||||
if isinstance(fallback, dict):
|
||||
model = fallback.pop("model", original_model)
|
||||
completion_kwargs.update(fallback)
|
||||
fallback_copy = dict(fallback) # avoid mutating caller's dict
|
||||
model = fallback_copy.pop("model", original_model)
|
||||
completion_kwargs.update(fallback_copy)
|
||||
else:
|
||||
model = fallback
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue