(feat) detect amazon.titan-embed-text-v1 as bedrock embedding model

This commit is contained in:
ishaan-jaff 2023-11-01 14:46:33 -07:00
parent f4a45ec35b
commit 9cfd218101
4 changed files with 7 additions and 4 deletions

View file

@ -68,7 +68,7 @@ os.environ["AWS_REGION_NAME"] = "" # us-east-1, us-east-2, us-west-1, us-west-2
```python
from litellm import embedding
response = embedding(
model="bedrock/amazon.titan-embed-text-v1",
model="amazon.titan-embed-text-v1",
input=["good morning from litellm"],
)
print(response)
@ -76,7 +76,7 @@ print(response)
| Model Name | Function Call |
|----------------------|---------------------------------------------|
| Titan Embeddings - G1 | `embedding(model="bedrock/amazon.titan-embed-text-v1", input=input)` |
| Titan Embeddings - G1 | `embedding(model="amazon.titan-embed-text-v1", input=input)` |
## Cohere Embedding Models

View file

@ -161,7 +161,7 @@ os.environ["AWS_REGION_NAME"] = "" # us-east-1, us-east-2, us-west-1,
```python
from litellm import embedding
response = embedding(
model="bedrock/amazon.titan-embed-text-v1",
model="amazon.titan-embed-text-v1",
input=["good morning from litellm"],
)
print(response)
@ -171,4 +171,4 @@ print(response)
| Model Name | Function Call |
|----------------------|---------------------------------------------|
| Titan Embeddings - G1 | `embedding(model="bedrock/amazon.titan-embed-text-v1", input=input)` |
| Titan Embeddings - G1 | `embedding(model="amazon.titan-embed-text-v1", input=input)` |

View file

@ -317,6 +317,7 @@ longer_context_model_fallback_dict: dict = {
####### EMBEDDING MODELS ###################
open_ai_embedding_models: List = ["text-embedding-ada-002"]
cohere_embedding_models: List = ["embed-english-v2.0", "embed-english-light-v2.0", "embed-multilingual-v2.0"]
bedrock_embedding_models: List = ["amazon.titan-embed-text-v1"]
from .timeout import timeout
from .testing import *

View file

@ -1700,6 +1700,8 @@ def get_llm_provider(model: str, custom_llm_provider: Optional[str] = None, api_
# cohere embeddings
elif model in litellm.cohere_embedding_models:
custom_llm_provider = "cohere"
elif model in litellm.bedrock_embedding_models:
custom_llm_provider = "bedrock"
if custom_llm_provider is None or custom_llm_provider=="":
print()