跳到主要内容
版本:v2.6.x

MistralAIEmbeddingFunction

MistralAIEmbeddingFunction is a class in pymilvus that handles encoding text into embeddings using Mistral AI embedding models to support embedding retrieval in Milvus.

Python
pymilvus.model.dense.MistralAIEmbeddingFunction

Constructor

Constructs a MistralAIEmbeddingFunction for common use cases.

Python
MistralAIEmbeddingFunction(
api_key: str,
model_name: str = "mistral-embed",
**kwargs
)

PARAMETERS:

  • api_key (string)

    The API key for accessing the Mistral AI API.

  • model_name (string)

    The name of the Mistral AI embedding model to use for encoding. The value defaults to mistral-embed. For more information, refer to Embeddings.

  • kwargs

    Allows additional keyword arguments to be passed to the model initialization. For more information, refer to Embedding API.

Examples

Python
from pymilvus.model.dense import MistralAIEmbeddingFunction

ef = MistralAIEmbeddingFunction(
model_name="mistral-embed", # Defaults to \`mistral-embed\`
api_key="MISTRAL_API_KEY" # Provide your Mistral AI API key
)