forked from phoenix/litellm-mirror
fix - support dimension for titan embed v2
This commit is contained in:
parent
bf048ecda4
commit
4a39b95acc
1 changed files with 15 additions and 0 deletions
|
@ -4743,6 +4743,21 @@ def get_optional_params_embeddings(
|
||||||
status_code=500,
|
status_code=500,
|
||||||
message=f"Setting user/encoding format is not supported by {custom_llm_provider}. To drop it from the call, set `litellm.drop_params = True`.",
|
message=f"Setting user/encoding format is not supported by {custom_llm_provider}. To drop it from the call, set `litellm.drop_params = True`.",
|
||||||
)
|
)
|
||||||
|
if custom_llm_provider == "bedrock":
|
||||||
|
if "amazon.titan-embed-text-v2" in model:
|
||||||
|
# embed-text-v2 supports the dimension param
|
||||||
|
non_default_params.pop("dimensions", None)
|
||||||
|
if len(non_default_params.keys()) > 0:
|
||||||
|
if litellm.drop_params is True: # drop the unsupported non-default values
|
||||||
|
keys = list(non_default_params.keys())
|
||||||
|
for k in keys:
|
||||||
|
non_default_params.pop(k, None)
|
||||||
|
final_params = {**non_default_params, **kwargs}
|
||||||
|
return final_params
|
||||||
|
raise UnsupportedParamsError(
|
||||||
|
status_code=500,
|
||||||
|
message=f"Setting user/encoding format is not supported by {custom_llm_provider}. To drop it from the call, set `litellm.drop_params = True`.",
|
||||||
|
)
|
||||||
|
|
||||||
if (
|
if (
|
||||||
custom_llm_provider != "openai"
|
custom_llm_provider != "openai"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue