mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-08 22:21:35 +00:00
Fix duplicate keyword argument error for acompletion parameter
- Only add acompletion=True to completion_kwargs if not already in kwargs - Prevents TypeError when functools.partial() receives acompletion twice - Fixes issue affecting multiple model groups (llama-3-70b, gpt-4o, gemini, etc.) - More Pythonic approach that respects explicit values in kwargs
This commit is contained in:
parent
ce37729da4
commit
fb7f5351ab
1 changed files with 5 additions and 1 deletions
|
|
@ -555,11 +555,15 @@ async def acompletion(
|
|||
"safety_identifier": safety_identifier,
|
||||
"service_tier": service_tier,
|
||||
"extra_headers": extra_headers,
|
||||
"acompletion": True, # assuming this is a required parameter
|
||||
"thinking": thinking,
|
||||
"web_search_options": web_search_options,
|
||||
"shared_session": shared_session,
|
||||
}
|
||||
# Only add acompletion if not already in kwargs (avoids duplicate keyword argument error)
|
||||
# acompletion is an internal flag to distinguish async from sync calls
|
||||
if "acompletion" not in kwargs:
|
||||
completion_kwargs["acompletion"] = True
|
||||
|
||||
if custom_llm_provider is None:
|
||||
_, custom_llm_provider, _, _ = get_llm_provider(
|
||||
model=model,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue