devika icon indicating copy to clipboard operation
devika copied to clipboard

Update mistral_client.py

Open Athulkrishna-S opened this issue 1 year ago • 1 comments

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.

Athulkrishna-S avatar Aug 08 '24 14:08 Athulkrishna-S

Why there are no commits for the past two months ?

Athulkrishna-S avatar Aug 18 '24 11:08 Athulkrishna-S