mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 02:34:29 +00:00
fix(acompletion): fix acompletion raise exception issue when custom llm provider is none
This commit is contained in:
parent
37f3b1edd1
commit
56bb39e52c
2 changed files with 5 additions and 1 deletions
|
@ -154,6 +154,7 @@ async def acompletion(*args, **kwargs):
|
|||
model = args[0] if len(args) > 0 else kwargs["model"]
|
||||
### PASS ARGS TO COMPLETION ###
|
||||
kwargs["acompletion"] = True
|
||||
custom_llm_provider = None
|
||||
try:
|
||||
# Use a partial function to pass your keyword arguments
|
||||
func = partial(completion, *args, **kwargs)
|
||||
|
@ -190,6 +191,7 @@ async def acompletion(*args, **kwargs):
|
|||
else:
|
||||
return response
|
||||
except Exception as e:
|
||||
custom_llm_provider = custom_llm_provider or "openai"
|
||||
raise exception_type(
|
||||
model=model, custom_llm_provider=custom_llm_provider, original_exception=e, completion_kwargs=args,
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue