stitionai / devika

Devika is an Agentic AI Software Engineer that can understand high-level human instructions, break them down into steps, research relevant information, and write code to achieve the given objective. Devika aims to be a competitive open-source alternative to Devin by Cognition AI.
MIT License
18.49k stars 2.4k forks source link

Update mistral_client.py #633

Closed Athulkrishna-S closed 2 months ago

Athulkrishna-S commented 3 months ago

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 commented 3 months ago

Why there are no commits for the past two months ?