Skip to contents

Generate Embeddings Using Mistral API

Usage

mistral_embedding(
  .input,
  .model = "mistral-embed",
  .timeout = 120,
  .max_tries = 3,
  .dry_run = FALSE,
  .dimensions = NULL
)

Arguments

.input

A character vector of texts to embed or an LLMMessage object

.model

The embedding model identifier (default: "mistral-embed").

.timeout

Timeout for the API request in seconds (default: 120).

.max_tries

Maximum retries to peform request

.dry_run

If TRUE, perform a dry run and return the request object.

.dimensions

Number of dimensions to return (default: NULL, the model's full size). Sent as output_dimension. codestral-embed accepts it; mistral-embed does not and returns an error.

Value

A matrix where each column corresponds to the embedding of a message in the message history.