mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-14 23:21:35 +00:00
fix(bedrock/cohere): wrap embedding_types string value in list
Bedrock Cohere embedding API requires embedding_types to be an array of strings, but map_openai_params was passing it as a raw string when encoding_format was provided. This caused 400 Malformed request errors. Fixes #25925
This commit is contained in:
parent
850fe595ac
commit
2176aec9b1
1 changed files with 2 additions and 1 deletions
|
|
@ -22,7 +22,7 @@ class BedrockCohereEmbeddingConfig:
|
|||
) -> dict:
|
||||
for k, v in non_default_params.items():
|
||||
if k == "encoding_format":
|
||||
optional_params["embedding_types"] = v
|
||||
optional_params["embedding_types"] = v if isinstance(v, list) else [v]
|
||||
elif k == "dimensions":
|
||||
optional_params["output_dimension"] = v
|
||||
return optional_params
|
||||
|
|
@ -45,3 +45,4 @@ class BedrockCohereEmbeddingConfig:
|
|||
new_transformed_request[k] = transformed_request[k] # type: ignore
|
||||
|
||||
return new_transformed_request
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue