# CohereEmbeddings

> **Class** in `langchain_cohere`

📖 [View in docs](https://reference.langchain.com/python/langchain-cohere/embeddings/CohereEmbeddings)

Implements the `Embeddings` interface with Cohere's text representation language
models.

Find out more about us at https://cohere.com and https://huggingface.co/CohereForAI

This implementation uses the Embed API - see https://docs.cohere.com/reference/embed

To use this you'll need to a Cohere API key - either pass it to cohere_api_key
parameter or set the `COHERE_API_KEY` environment variable.

API keys are available on https://cohere.com - it's free to sign up and trial API
keys work with this implementation.

## Signature

```python
CohereEmbeddings()
```

## Description

**Basic Example:**

```python
cohere_embeddings = CohereEmbeddings(model="embed-english-light-v3.0")
text = "This is a test document."

query_result = cohere_embeddings.embed_query(text)
print(query_result)

doc_result = cohere_embeddings.embed_documents([text])
print(doc_result)
```

## Extends

- `BaseModel`
- `Embeddings`

## Properties

- `client`
- `async_client`
- `model`
- `truncate`
- `cohere_api_key`
- `embedding_types`
- `max_retries`
- `request_timeout`
- `user_agent`
- `base_url`
- `model_config`

## Methods

- [`validate_environment()`](https://reference.langchain.com/python/langchain-cohere/embeddings/CohereEmbeddings/validate_environment)
- [`validate_model_specified()`](https://reference.langchain.com/python/langchain-cohere/embeddings/CohereEmbeddings/validate_model_specified)
- [`embed_with_retry()`](https://reference.langchain.com/python/langchain-cohere/embeddings/CohereEmbeddings/embed_with_retry)
- [`aembed_with_retry()`](https://reference.langchain.com/python/langchain-cohere/embeddings/CohereEmbeddings/aembed_with_retry)
- [`embed()`](https://reference.langchain.com/python/langchain-cohere/embeddings/CohereEmbeddings/embed)
- [`aembed()`](https://reference.langchain.com/python/langchain-cohere/embeddings/CohereEmbeddings/aembed)
- [`embed_documents()`](https://reference.langchain.com/python/langchain-cohere/embeddings/CohereEmbeddings/embed_documents)
- [`aembed_documents()`](https://reference.langchain.com/python/langchain-cohere/embeddings/CohereEmbeddings/aembed_documents)
- [`embed_query()`](https://reference.langchain.com/python/langchain-cohere/embeddings/CohereEmbeddings/embed_query)
- [`aembed_query()`](https://reference.langchain.com/python/langchain-cohere/embeddings/CohereEmbeddings/aembed_query)

---

[View source on GitHub](https://github.com/langchain-ai/langchain-cohere/blob/98e3d038d365eebd6dabcf8c4d94072580f7401d/libs/cohere/langchain_cohere/embeddings.py#L13)