Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mistral model client integration #286

Open
fm1320 opened this issue Nov 27, 2024 · 1 comment
Open

Mistral model client integration #286

fm1320 opened this issue Nov 27, 2024 · 1 comment
Labels
[adalflow] suggest integration Add a new model_client, db retriever, etc in /adalflow help wanted Need helps with input, discussion, review, and PR submission.

Comments

@fm1320
Copy link
Collaborator

fm1320 commented Nov 27, 2024

Description & Motivation

As part of extending Adalflow's capability we want to integrate Mistral as a provider

Pitch

No response

Provider POC

No response

Additional context

No response

@fm1320 fm1320 added the help wanted Need helps with input, discussion, review, and PR submission. label Nov 27, 2024
@adjahossoualexandre
Copy link

Proposal

I will wrap Mistral text generation and embedding endpoints into a concrete implementation of the 6 ModelClient main methods.

I will use Mistal SDK.

from adalflow.core.model_client import ModelClient

def MistralClient(ModelClient):

    def __init__(self, model_name: Optional[str] = None) -> None:
        super().__init__()
        self._model_name = model_name

    def init_sync_client(self):
        pass

    def convert_inputs_to_api_kwargs(
        self,
        input: Any,  # for retriever, it is a single query,
        model_kwargs: dict = {},
        model_type: ModelType = ModelType.UNDEFINED,
    ) -> dict:
        pass

    def parse_embedding_response(self, response: Any) -> EmbedderOutput:
        pass

    def parse_chat_completion(self, completion: Any) -> GeneratorOutput:
        pass

    def call(self, api_kwargs: Dict = {}, model_type: ModelType = ModelType.UNDEFINED):
        pass

Regarding the init_async_client() method, I'm not sure how to implement it since the SDK has no dedicated method for it. Any suggestions?

@liyin2015 liyin2015 added the [adalflow] suggest integration Add a new model_client, db retriever, etc in /adalflow label Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[adalflow] suggest integration Add a new model_client, db retriever, etc in /adalflow help wanted Need helps with input, discussion, review, and PR submission.
Projects
None yet
Development

No branches or pull requests

3 participants