mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 10:44:24 +00:00
test fallbacks
This commit is contained in:
parent
ccf875f84b
commit
72414919dd
3 changed files with 58 additions and 1 deletions
|
@ -17,6 +17,7 @@ from litellm.utils import (
|
|||
install_and_import,
|
||||
CustomStreamWrapper,
|
||||
read_config_args,
|
||||
completion_with_fallbacks
|
||||
)
|
||||
from .llms.anthropic import AnthropicLLM
|
||||
from .llms.huggingface_restapi import HuggingfaceRestAPILLM
|
||||
|
@ -90,9 +91,12 @@ def completion(
|
|||
# used by text-bison only
|
||||
top_k=40,
|
||||
request_timeout=0, # unused var for old version of OpenAI API
|
||||
fallbacks=[],
|
||||
) -> ModelResponse:
|
||||
args = locals()
|
||||
try:
|
||||
if fallbacks != []:
|
||||
return completion_with_fallbacks(**args)
|
||||
model_response = ModelResponse()
|
||||
if azure: # this flag is deprecated, remove once notebooks are also updated.
|
||||
custom_llm_provider = "azure"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue