Update mistral_client.py
Description
Refactor: Update to new version of Mistral library
This pull request updates the MistralAi class to be compatible with the latest version of the Mistral Python library. The changes include:
Refactored Imports: Updated imports from mistralai.client and mistralai.models.chat_completion to mistralai. Specifically, Mistral is used instead of MistralClient, and message formatting has been changed.
Client Initialization: Replaced MistralClient with Mistral for creating the client instance. This change aligns with the new library structure.
Message Formatting: Modified the message structure from using ChatMessage to a dictionary format, which is now the standard for the new library version.
Chat Completion Method: Updated the method call from client.chat() to client.chat.complete() for generating chat completions.
Explain what existing problem does the pull request solve?
Problem Solved: This refactor ensures compatibility with the new version of the Mistral library, addressing deprecated classes and methods from the previous version.
Why there are no commits for the past two months ?