diff --git a/litellm/types/llms/bedrock.py b/litellm/types/llms/bedrock.py index a829a6b94b9..352e7f7eef0 100644 --- a/litellm/types/llms/bedrock.py +++ b/litellm/types/llms/bedrock.py @@ -324,15 +324,22 @@ class CohereEmbeddingResponse(TypedDict): texts: List[str] -class AmazonTitanV2EmbeddingRequest(TypedDict): - inputText: str +class AmazonTitanV2EmbeddingRequest(TypedDict, total=False): + inputText: Required[str] dimensions: int normalize: bool + embeddingTypes: List[Literal["float", "binary"]] -class AmazonTitanV2EmbeddingResponse(TypedDict): - embedding: List[float] - inputTextTokenCount: int +class AmazonTitanV2EmbeddingsByType(TypedDict, total=False): + binary: List[int] # Array of integers for binary format + float: List[float] # Array of floats for float format + + +class AmazonTitanV2EmbeddingResponse(TypedDict, total=False): + embedding: List[float] # Legacy field - array of floats (backward compatibility) + embeddingsByType: AmazonTitanV2EmbeddingsByType # New format per AWS schema + inputTextTokenCount: Required[int] # Always present in AWS response class AmazonTitanG1EmbeddingRequest(TypedDict):