Skip to content

Commit 5c97f70

Browse files
authored
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)
1 parent b374d48 commit 5c97f70

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

langchain/embeddings/cohere.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class CohereEmbeddings(BaseModel, Embeddings):
2222
"""
2323

2424
client: Any #: :meta private:
25-
model: str = "medium"
25+
model: str = "large"
2626
"""Model name to use."""
2727

2828
cohere_api_key: Optional[str] = None

0 commit comments

Comments
 (0)