-
Notifications
You must be signed in to change notification settings - Fork 237
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
Comments
ProposalI 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 |
@adjahossoualexandre So in |
@fm1320 Yes, exactly. The only thing I'm not sure about is the |
Maybe wrap the synchronous client that makes the API call for async usage ? This is my rough idea, feel free to start the PR and I will adapt this part if needed async def acall(self, api_kwargs: Dict = {}):
response = await asyncio.to_thread(self.call, api_kwargs)
return response
# Using the client
async def example():
client = MistralClient()
response = await client.acall(
{"prompt": "Hello!"},
model_type=ModelType.LLM
)
return response |
I'll try to do that thanks! |
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
The text was updated successfully, but these errors were encountered: