(feat) embedding() add bedrock/amazon.titan-embed-text-v1

This commit is contained in:
ishaan-jaff 2023-11-01 13:55:17 -07:00
parent 8deeb52f7c
commit 2ad81bdd7b
2 changed files with 69 additions and 2 deletions

View file

@ -1633,6 +1633,7 @@ def embedding(
api_type: Optional[str] = None,
caching: bool=False,
custom_llm_provider=None,
**kwargs
):
"""
Embedding function that calls an API to generate embeddings for the given input.
@ -1784,6 +1785,15 @@ def embedding(
logging_obj=logging,
model_response= EmbeddingResponse()
)
elif custom_llm_provider == "bedrock":
response = bedrock.embedding(
model=model,
input=input,
encoding=encoding,
logging_obj=logging,
optional_params=kwargs,
model_response= EmbeddingResponse()
)
else:
args = locals()
raise ValueError(f"No valid embedding model args passed in - {args}")