Class MistralAiClient
java.lang.Object
dev.langchain4j.model.mistralai.internal.client.MistralAiClient
- Direct Known Subclasses:
DefaultMistralAiClient
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classMistralAiClient.Builder<T extends MistralAiClient, B extends MistralAiClient.Builder<T,B>> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic MistralAiClient.Builderbuilder()cancelBatchJob(String jobId) Requests cancellation of a batch job (POST /v1/batch/jobs/{jobId}/cancel).abstract MistralAiChatCompletionResponsecreateBatchJob(MistralAiBatchJobRequest request) Creates a batch job on the Mistral Batch API (POST /v1/batch/jobs).downloadBatchResults(String fileId) Downloads and parses the JSONL results of a completed batch job from the file referenced by itsoutput_fileorerror_fileid (GET /v1/files/{fileId}/content).abstract MistralAiEmbeddingResponseembedding(MistralAiEmbeddingRequest request) abstract MistralAiChatCompletionResponselistBatchJobs(Integer page, Integer pageSize) Lists batch jobs with page-based pagination (GET /v1/batch/jobs).abstract MistralAiModelResponseabstract MistralAiModerationResponsemoderation(MistralAiModerationRequest request) retrieveBatchJob(String jobId) Retrieves the current state of a batch job (GET /v1/batch/jobs/{jobId}).abstract voidstreamingChatCompletion(MistralAiChatCompletionRequest request, StreamingChatResponseHandler handler) voidstreamingChatCompletion(MistralAiChatCompletionRequest request, StreamingChatResponseHandler handler, boolean returnThinking) abstract voidstreamingFimCompletion(MistralAiFimCompletionRequest request, StreamingResponseHandler<String> handler)
-
Constructor Details
-
MistralAiClient
public MistralAiClient()
-
-
Method Details
-
chatCompletion
public abstract MistralAiChatCompletionResponse chatCompletion(MistralAiChatCompletionRequest request) -
chatCompletionWithRawResponse
public ParsedAndRawResponse<MistralAiChatCompletionResponse> chatCompletionWithRawResponse(MistralAiChatCompletionRequest request) -
streamingChatCompletion
public abstract void streamingChatCompletion(MistralAiChatCompletionRequest request, StreamingChatResponseHandler handler) -
streamingChatCompletion
public void streamingChatCompletion(MistralAiChatCompletionRequest request, StreamingChatResponseHandler handler, boolean returnThinking) -
embedding
-
embeddingWithRawResponse
public ParsedAndRawResponse<MistralAiEmbeddingResponse> embeddingWithRawResponse(MistralAiEmbeddingRequest request) -
moderation
-
listModels
-
fimCompletion
public abstract MistralAiChatCompletionResponse fimCompletion(MistralAiFimCompletionRequest request) -
fimCompletionWithRawResponse
public ParsedAndRawResponse<MistralAiChatCompletionResponse> fimCompletionWithRawResponse(MistralAiFimCompletionRequest request) -
streamingFimCompletion
public abstract void streamingFimCompletion(MistralAiFimCompletionRequest request, StreamingResponseHandler<String> handler) -
createBatchJob
Creates a batch job on the Mistral Batch API (POST /v1/batch/jobs).Implemented as a non-abstract method that throws by default so that adding batch support does not break existing
MistralAiClientimplementations. -
retrieveBatchJob
Retrieves the current state of a batch job (GET /v1/batch/jobs/{jobId}). -
cancelBatchJob
Requests cancellation of a batch job (POST /v1/batch/jobs/{jobId}/cancel). -
listBatchJobs
Lists batch jobs with page-based pagination (GET /v1/batch/jobs). -
downloadBatchResults
Downloads and parses the JSONL results of a completed batch job from the file referenced by itsoutput_fileorerror_fileid (GET /v1/files/{fileId}/content). -
builder
-