mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-03 02:22:24 +00:00
feat(bedrock): add amazon.titan-embed-g1-text-02 embedding model support
The model amazon.titan-embed-g1-text-02 is a Bedrock Titan G1 text embedding model that uses the same request/response format as the existing amazon.titan-embed-text-v1 (AmazonTitanG1Config). Without this change litellm raises 'Unable to map Bedrock request to provider'. Add the model to: 1. The provider routing check (model list) 2. The per-model request transformation branch 3. The per-model response transformation branch Fixes #29786
This commit is contained in:
parent
a72414a061
commit
0514680914
1 changed files with 10 additions and 0 deletions
|
|
@ -224,6 +224,10 @@ class BedrockEmbedding(BaseAWSLLM):
|
|||
returned_response = AmazonTitanV2Config()._transform_response(
|
||||
response_list=response_list, model=model
|
||||
)
|
||||
elif model == "amazon.titan-embed-g1-text-02":
|
||||
returned_response = AmazonTitanG1Config()._transform_response(
|
||||
response_list=response_list, model=model
|
||||
)
|
||||
elif provider == "twelvelabs":
|
||||
returned_response = (
|
||||
TwelveLabsMarengoEmbeddingConfig()._transform_response(
|
||||
|
|
@ -447,6 +451,7 @@ class BedrockEmbedding(BaseAWSLLM):
|
|||
"amazon.titan-embed-image-v1",
|
||||
"amazon.titan-embed-text-v1",
|
||||
"amazon.titan-embed-text-v2:0",
|
||||
"amazon.titan-embed-g1-text-02",
|
||||
]:
|
||||
batch_data = []
|
||||
for i in input:
|
||||
|
|
@ -464,6 +469,10 @@ class BedrockEmbedding(BaseAWSLLM):
|
|||
transformed_request = AmazonTitanV2Config()._transform_request(
|
||||
input=i, inference_params=inference_params
|
||||
)
|
||||
elif model == "amazon.titan-embed-g1-text-02":
|
||||
transformed_request = AmazonTitanG1Config()._transform_request(
|
||||
input=i, inference_params=inference_params
|
||||
)
|
||||
else:
|
||||
raise Exception(
|
||||
"Unmapped model. Received={}. Expected={}".format(
|
||||
|
|
@ -472,6 +481,7 @@ class BedrockEmbedding(BaseAWSLLM):
|
|||
"amazon.titan-embed-image-v1",
|
||||
"amazon.titan-embed-text-v1",
|
||||
"amazon.titan-embed-text-v2:0",
|
||||
"amazon.titan-embed-g1-text-02",
|
||||
],
|
||||
)
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue