Package dev.langchain4j.model.mistralai
Class MistralAiEmbeddingModel
java.lang.Object
dev.langchain4j.model.embedding.DimensionAwareEmbeddingModel
dev.langchain4j.model.mistralai.MistralAiEmbeddingModel
- All Implemented Interfaces:
EmbeddingModel
Represents a Mistral AI embedding model, such as mistral-embed.
You can find description of parameters here.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
-
Field Summary
Fields inherited from class dev.langchain4j.model.embedding.DimensionAwareEmbeddingModel
dimension
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuilder()
embedAll
(List<TextSegment> textSegments) Embeds a list of text segments using the Mistral AI embedding model.static MistralAiEmbeddingModel
withApiKey
(String apiKey) Deprecated, for removal: This API element is subject to removal in a future version.Methods inherited from class dev.langchain4j.model.embedding.DimensionAwareEmbeddingModel
dimension, knownDimension
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface dev.langchain4j.model.embedding.EmbeddingModel
embed, embed
-
Constructor Details
-
MistralAiEmbeddingModel
public MistralAiEmbeddingModel(String baseUrl, String apiKey, String modelName, Duration timeout, Boolean logRequests, Boolean logResponses, Integer maxRetries) Constructs a new MistralAiEmbeddingModel instance.- Parameters:
baseUrl
- the base URL of the Mistral AI API. It use a default value if not specifiedapiKey
- the API key for authenticationmodelName
- the name of the embedding model. It uses a default value if not specifiedtimeout
- the timeout duration for API requests. It uses a default value of 60 seconds if not specifiedThe default value is 60 seconds
logRequests
- a flag indicating whether to log API requestslogResponses
- a flag indicating whether to log API responsesmaxRetries
- the maximum number of retries for API requests. It uses a default value of 3 if not specified
-
-
Method Details
-
withApiKey
Deprecated, for removal: This API element is subject to removal in a future version.Please usebuilder()
instead, and explicitly set the model name and, if necessary, other parameters. The default value for the model name will be removed in future releases! -
embedAll
Embeds a list of text segments using the Mistral AI embedding model.- Parameters:
textSegments
- the list of text segments to embed- Returns:
- a Response object containing the embeddings and token usage information
-
builder
-
builder()
instead, and explicitly set the model name and, if necessary, other parameters.