forked from phoenix/litellm-mirror
Check for converse support first.
This commit is contained in:
parent
22c66991ed
commit
64adae6e7f
1 changed files with 13 additions and 12 deletions
|
@ -3121,7 +3121,19 @@ def get_optional_params(
|
||||||
supported_params = get_supported_openai_params(
|
supported_params = get_supported_openai_params(
|
||||||
model=model, custom_llm_provider=custom_llm_provider
|
model=model, custom_llm_provider=custom_llm_provider
|
||||||
)
|
)
|
||||||
if "ai21" in model:
|
if model in litellm.BEDROCK_CONVERSE_MODELS:
|
||||||
|
_check_valid_arg(supported_params=supported_params)
|
||||||
|
optional_params = litellm.AmazonConverseConfig().map_openai_params(
|
||||||
|
model=model,
|
||||||
|
non_default_params=non_default_params,
|
||||||
|
optional_params=optional_params,
|
||||||
|
drop_params=(
|
||||||
|
drop_params
|
||||||
|
if drop_params is not None and isinstance(drop_params, bool)
|
||||||
|
else False
|
||||||
|
),
|
||||||
|
)
|
||||||
|
elif "ai21" in model:
|
||||||
_check_valid_arg(supported_params=supported_params)
|
_check_valid_arg(supported_params=supported_params)
|
||||||
# params "maxTokens":200,"temperature":0,"topP":250,"stop_sequences":[],
|
# params "maxTokens":200,"temperature":0,"topP":250,"stop_sequences":[],
|
||||||
# https://us-west-2.console.aws.amazon.com/bedrock/home?region=us-west-2#/providers?model=j2-ultra
|
# https://us-west-2.console.aws.amazon.com/bedrock/home?region=us-west-2#/providers?model=j2-ultra
|
||||||
|
@ -3143,17 +3155,6 @@ def get_optional_params(
|
||||||
optional_params=optional_params,
|
optional_params=optional_params,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
elif model in litellm.BEDROCK_CONVERSE_MODELS:
|
|
||||||
optional_params = litellm.AmazonConverseConfig().map_openai_params(
|
|
||||||
model=model,
|
|
||||||
non_default_params=non_default_params,
|
|
||||||
optional_params=optional_params,
|
|
||||||
drop_params=(
|
|
||||||
drop_params
|
|
||||||
if drop_params is not None and isinstance(drop_params, bool)
|
|
||||||
else False
|
|
||||||
),
|
|
||||||
)
|
|
||||||
else:
|
else:
|
||||||
optional_params = litellm.AmazonAnthropicConfig().map_openai_params(
|
optional_params = litellm.AmazonAnthropicConfig().map_openai_params(
|
||||||
non_default_params=non_default_params,
|
non_default_params=non_default_params,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue