Skip to content

Mistral

MistralEmbedder

Bases: BaseEmbedder

Initializes the MistralEmbedder component with given configuration.

Attributes:

Name Type Description
connection Mistral

The connection to the Mistral API. A new connection is created if none is provided.

model str

The model name to use for embedding. Defaults to "mistral/mistral-embed"

Source code in dynamiq/components/embedders/mistral.py
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
class MistralEmbedder(BaseEmbedder):
    """
    Initializes the MistralEmbedder component with given configuration.

    Attributes:
        connection (MistralConnection): The connection to the  Mistral API. A new connection
            is created if none is provided.
        model (str): The model name to use for embedding. Defaults to "mistral/mistral-embed"
    """
    connection: MistralConnection
    model: str = "mistral/mistral-embed"

    def __init__(self, **kwargs):
        if kwargs.get("client") is None and kwargs.get("connection") is None:
            kwargs["connection"] = MistralConnection()
        super().__init__(**kwargs)