Class for generating embeddings using the MistralAI API.
class MistralAIEmbeddingsThe API key to use.
The maximum number of documents to embed in a single request.
A list of custom hooks that must follow (req: Request) => Awaitable<Request | void> They are automatically added when a ChatMistralAI instance is created
The async caller should be used by subclasses to make any async calls, which will thus benefit from the concurrency and retry logic.
The format of the output data.
Optional custom HTTP client to manage API requests Allows users to add custom fetch implementations, hooks, as well as error and response processing.
The name of the model to use.
The name of the model to use.
Alias for model.
A list of custom hooks that must follow (err: unknown, req: Request) => Awaitable
A list of custom hooks that must follow (res: Response, req: Request) => Awaitable
Override the default server URL used by the Mistral SDK.
Whether to strip new lines from the input text. This is recommended, but may not be suitable for all use cases.
Method to generate embeddings for an array of documents. Splits the documents into batches and makes requests to the MistralAI API to generate embeddings.
Method to generate an embedding for a single document. Calls the embeddingWithRetry method with the document as the input.