Class MistralAiApi

java.lang.Object
org.springframework.ai.mistralai.api.MistralAiApi

public class MistralAiApi extends Object
Single-class, Java Client library for Mistral AI platform. Provides implementation for the MistralAI Embedding API and the Chat Completion APIs.

Implements Synchronous and Streaming chat completion and supports latest Function Calling features.

Since:
1.0.0
Author:
Ricken Bazolo, Christian Tzolov, Thomas Vitale
  • Field Details

    • PROVIDER_NAME

      public static final String PROVIDER_NAME
  • Constructor Details

    • MistralAiApi

      public MistralAiApi(String mistralAiApiKey)
      Create a new client api with DEFAULT_BASE_URL
      Parameters:
      mistralAiApiKey - Mistral api Key.
    • MistralAiApi

      public MistralAiApi(String baseUrl, String mistralAiApiKey)
      Create a new client api.
      Parameters:
      baseUrl - api base URL.
      mistralAiApiKey - Mistral api Key.
    • MistralAiApi

      public MistralAiApi(String baseUrl, String mistralAiApiKey, org.springframework.web.client.RestClient.Builder restClientBuilder, org.springframework.web.client.ResponseErrorHandler responseErrorHandler)
      Create a new client api.
      Parameters:
      baseUrl - api base URL.
      mistralAiApiKey - Mistral api Key.
      restClientBuilder - RestClient builder.
      responseErrorHandler - Response error handler.
    • MistralAiApi

      public MistralAiApi(String baseUrl, String mistralAiApiKey, org.springframework.web.client.RestClient.Builder restClientBuilder, org.springframework.web.reactive.function.client.WebClient.Builder webClientBuilder, org.springframework.web.client.ResponseErrorHandler responseErrorHandler)
      Create a new client api.
      Parameters:
      baseUrl - api base URL.
      mistralAiApiKey - Mistral api Key.
      restClientBuilder - RestClient builder.
      responseErrorHandler - Response error handler.
  • Method Details