MistralAIClient

MistralAIClient(**kwargs)

Client for Mistral.AI’s API.
Requires api_key or environment variable to be set

Parameters:
NameDescription
**kwargs

Instance Methods

cost

cost(self, response) -> float
Parameters:
NameDescription
response

create

create(self, params: dict[str, Any]) -> ChatCompletionExtended
Parameters:
NameDescription
paramsType: dict[str, typing.Any]

get_usage

get_usage(response: ChatCompletionExtended) -> dict
Parameters:
NameDescription
responseType: autogen.oai.oai_models.chat_completion.ChatCompletionExtended

message_retrieval

message_retrieval(self, response: ChatCompletionExtended) -> list[str] | list[ChatCompletionMessage]

Retrieve the messages from the response.

Parameters:
NameDescription
responseType: autogen.oai.oai_models.chat_completion.ChatCompletionExtended

parse_params

parse_params(self, params: dict[str, Any]) -> dict[str, Any]

Loads the parameters for Mistral.AI API from the passed in parameters and returns a validated set. Checks types, ranges, and sets defaults

Parameters:
NameDescription
paramsType: dict[str, typing.Any]