Fix CohereError: embed is not an available endpoint on this model (#637)

Running the Cohere embeddings example from the docs:

```python
from langchain.embeddings import CohereEmbeddings
embeddings = CohereEmbeddings(cohere_api_key= cohere_api_key)

text = "This is a test document."
query_result = embeddings.embed_query(text)
doc_result = embeddings.embed_documents([text])
```

I get the error:

```bash
CohereError(message=res['message'], http_status=response.status_code, headers=response.headers)      
cohere.error.CohereError: embed is not an available endpoint on this model
```

This is because the `model` string is set to `medium` which is not
currently available.

From the Cohere docs:

> Currently available models are small and large (default)
pull/642/head
Sasmitha Manathunga 2 years ago committed by GitHub
parent b374d481c8
commit 5c97f70bf1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -22,7 +22,7 @@ class CohereEmbeddings(BaseModel, Embeddings):
"""
client: Any #: :meta private:
model: str = "medium"
model: str = "large"
"""Model name to use."""
cohere_api_key: Optional[str] = None

Loading…
Cancel
Save