# DashScopeEmbeddings

> **Class** in `langchain_community`

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

DashScope embedding models.

To use, you should have the ``dashscope`` python package installed, and the
environment variable ``DASHSCOPE_API_KEY`` set with your API key or pass it
as a named parameter to the constructor.

## Signature

```python
DashScopeEmbeddings()
```

## Description

**Example:**

.. code-block:: python

from langchain_community.embeddings import DashScopeEmbeddings
embeddings = DashScopeEmbeddings(dashscope_api_key="my-api-key")

**Example:**

.. code-block:: python

import os
os.environ["DASHSCOPE_API_KEY"] = "your DashScope API KEY"

from langchain_community.embeddings.dashscope import DashScopeEmbeddings
embeddings = DashScopeEmbeddings(
    model="text-embedding-v1",
)
text = "This is a test query."
query_result = embeddings.embed_query(text)

## Extends

- `BaseModel`
- `Embeddings`

## Properties

- `client`
- `model`
- `dashscope_api_key`
- `max_retries`
- `model_config`

## Methods

- [`validate_environment()`](https://reference.langchain.com/python/langchain-community/embeddings/dashscope/DashScopeEmbeddings/validate_environment)
- [`embed_documents()`](https://reference.langchain.com/python/langchain-community/embeddings/dashscope/DashScopeEmbeddings/embed_documents)
- [`embed_query()`](https://reference.langchain.com/python/langchain-community/embeddings/dashscope/DashScopeEmbeddings/embed_query)

---

[View source on GitHub](https://github.com/langchain-ai/langchain-community/blob/4b280287bd55b99b44db2dd849f02d66c89534d5/libs/community/langchain_community/embeddings/dashscope.py#L86)