# CloudflareWorkersAIEmbeddings

> **Class** in `langchain_community`

📖 [View in docs](https://reference.langchain.com/python/langchain-community/embeddings/cloudflare_workersai/CloudflareWorkersAIEmbeddings)

Cloudflare Workers AI embedding model.

To use, you need to provide an API token and
account ID to access Cloudflare Workers AI.

## Signature

```python
CloudflareWorkersAIEmbeddings(
    self,
    **kwargs: Any = {},
)
```

## Description

**Example:**

.. code-block:: python

from langchain_community.embeddings import CloudflareWorkersAIEmbeddings

account_id = "my_account_id"
api_token = "my_secret_api_token"
model_name =  "@cf/baai/bge-small-en-v1.5"

cf = CloudflareWorkersAIEmbeddings(
    account_id=account_id,
    api_token=api_token,
    model_name=model_name
)

## Extends

- `BaseModel`
- `Embeddings`

## Constructors

```python
__init__(
    self,
    **kwargs: Any = {},
)
```


## Properties

- `api_base_url`
- `account_id`
- `api_token`
- `model_name`
- `batch_size`
- `strip_new_lines`
- `headers`
- `model_config`

## Methods

- [`embed_documents()`](https://reference.langchain.com/python/langchain-community/embeddings/cloudflare_workersai/CloudflareWorkersAIEmbeddings/embed_documents)
- [`embed_query()`](https://reference.langchain.com/python/langchain-community/embeddings/cloudflare_workersai/CloudflareWorkersAIEmbeddings/embed_query)

## ⚠️ Deprecated

Deprecated since version 0.3.23.

---

[View source on GitHub](https://github.com/langchain-ai/langchain-community/blob/d5ea8358933260ad48dd31f7f8076555c7b4885a/libs/community/langchain_community/embeddings/cloudflare_workersai.py#L11)