# MiniMaxEmbeddings

> **Class** in `langchain_community`

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

MiniMax embedding model integration.

## Signature

```python
MiniMaxEmbeddings()
```

## Description

**Setup:**

To use, you should have the environment variable ``MINIMAX_GROUP_ID`` and
``MINIMAX_API_KEY`` set with your API token.

.. code-block:: bash

    export MINIMAX_API_KEY="your-api-key"
    export MINIMAX_GROUP_ID="your-group-id"

Key init args — completion params:
    model: Optional[str]
        Name of ZhipuAI model to use.
    api_key: Optional[str]
        Automatically inferred from env var `MINIMAX_GROUP_ID` if not provided.
    group_id: Optional[str]
        Automatically inferred from env var `MINIMAX_GROUP_ID` if not provided.

See full list of supported init args and their descriptions in the params section.

Instantiate:

    .. code-block:: python

        from langchain_community.embeddings import MiniMaxEmbeddings

        embed = MiniMaxEmbeddings(
            model="embo-01",
            # api_key="...",
            # group_id="...",
            # other
        )

**Embed single text:**

.. code-block:: python

    input_text = "The meaning of life is 42"
    embed.embed_query(input_text)

.. code-block:: python

    [0.03016241, 0.03617699, 0.0017198119, -0.002061239, -0.00029994643, -0.0061320597, -0.0043635326, ...]

**Embed multiple text:**

.. code-block:: python

    input_texts = ["This is a test query1.", "This is a test query2."]
    embed.embed_documents(input_texts)

.. code-block:: python

    [
        [-0.0021588828, -0.007608119, 0.029349545, -0.0038194496, 0.008031177, -0.004529633, -0.020150753, ...],
        [ -0.00023150232, -0.011122423, 0.016930554, 0.0083089275, 0.012633711, 0.019683322, -0.005971041, ...]
    ]

## Extends

- `BaseModel`
- `Embeddings`

## Properties

- `endpoint_url`
- `model`
- `embed_type_db`
- `embed_type_query`
- `minimax_group_id`
- `minimax_api_key`
- `model_config`

## Methods

- [`validate_environment()`](https://reference.langchain.com/python/langchain-community/embeddings/minimax/MiniMaxEmbeddings/validate_environment)
- [`embed()`](https://reference.langchain.com/python/langchain-community/embeddings/minimax/MiniMaxEmbeddings/embed)
- [`embed_documents()`](https://reference.langchain.com/python/langchain-community/embeddings/minimax/MiniMaxEmbeddings/embed_documents)
- [`embed_query()`](https://reference.langchain.com/python/langchain-community/embeddings/minimax/MiniMaxEmbeddings/embed_query)

---

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