# QianfanEmbeddingsEndpoint

> **Class** in `langchain_community`

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

Baidu Qianfan Embeddings embedding models.

## Signature

```python
QianfanEmbeddingsEndpoint()
```

## Description

**Setup:**

To use, you should have the ``qianfan`` python package installed, and set
environment variables ``QIANFAN_AK``, ``QIANFAN_SK``.

.. code-block:: bash

    pip install qianfan
    export QIANFAN_AK="your-api-key"
    export QIANFAN_SK="your-secret_key"

**Instantiate:**

.. code-block:: python

from langchain_community.embeddings import QianfanEmbeddingsEndpoint

embeddings = QianfanEmbeddingsEndpoint()

Embed:
   .. code-block:: python

       # embed the documents
       vectors = embeddings.embed_documents([text1, text2, ...])

       # embed the query
       vectors = embeddings.embed_query(text)

       # embed the documents with async
       vectors = await embeddings.aembed_documents([text1, text2, ...])

       # embed the query with async
       vectors = await embeddings.aembed_query(text)

## Extends

- `BaseModel`
- `Embeddings`

## Properties

- `qianfan_ak`
- `qianfan_sk`
- `chunk_size`
- `model`
- `endpoint`
- `client`
- `init_kwargs`
- `model_kwargs`
- `model_config`

## Methods

- [`validate_environment()`](https://reference.langchain.com/python/langchain-community/embeddings/baidu_qianfan_endpoint/QianfanEmbeddingsEndpoint/validate_environment)
- [`embed_query()`](https://reference.langchain.com/python/langchain-community/embeddings/baidu_qianfan_endpoint/QianfanEmbeddingsEndpoint/embed_query)
- [`embed_documents()`](https://reference.langchain.com/python/langchain-community/embeddings/baidu_qianfan_endpoint/QianfanEmbeddingsEndpoint/embed_documents)
- [`aembed_query()`](https://reference.langchain.com/python/langchain-community/embeddings/baidu_qianfan_endpoint/QianfanEmbeddingsEndpoint/aembed_query)
- [`aembed_documents()`](https://reference.langchain.com/python/langchain-community/embeddings/baidu_qianfan_endpoint/QianfanEmbeddingsEndpoint/aembed_documents)

---

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