From 2176aec9b1f6ee76753ae44643bc0f74605d2219 Mon Sep 17 00:00:00 2001 From: Tai An Date: Thu, 16 Apr 2026 18:59:36 -0700 Subject: [PATCH] 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 --- litellm/llms/bedrock/embed/cohere_transformation.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/litellm/llms/bedrock/embed/cohere_transformation.py b/litellm/llms/bedrock/embed/cohere_transformation.py index d00cb74aae0..b5dfa5bb1e1 100644 --- a/litellm/llms/bedrock/embed/cohere_transformation.py +++ b/litellm/llms/bedrock/embed/cohere_transformation.py @@ -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 +