Skip to main content

Parameters

ParameterTypeDefaultDescription
api_keystr | NoneNoneThe API key to use for authentication, if not provided, the MISTRAL_API_KEY environment variable will be used if available.
mistral_clientMistral | NoneNoneAn existing Mistral client to use, if provided, api_key and http_client must be None.
base_urlstr | NoneNoneThe base url for the Mistral requests.
http_clienthttpx.AsyncClient | NoneNoneAn existing async client to use for making HTTP requests.

Functions

__init__

Create a new Mistral provider. Parameters:
  • api_key (str | None): The API key to use for authentication, if not provided, the MISTRAL_API_KEY environment variable will be used if available.
  • mistral_client (Mistral | None): An existing Mistral client to use, if provided, api_key and http_client must be None.
  • base_url (str | None): The base url for the Mistral requests.
  • http_client (httpx.AsyncClient | None): An existing async client to use for making HTTP requests.

name

Get the provider name. Returns:
  • str: The provider name (‘mistral’)

base_url

Get the base URL for the provider API. Returns:
  • str: The base URL for the provider API

client

Get the client for the provider. Returns:
  • Mistral: The Mistral client

model_profile

Get the model profile for the named model, if available. Parameters:
  • model_name (str): The name of the model
Returns:
  • ModelProfile | None: The model profile for the named model, if available
I