HelgeSverre / mistral

PHP Client for the Mistral.ai API
MIT License
36 stars 1 forks source link

Any chance for version of client not depending on Laravel? #4

Closed ddebowczyk closed 7 months ago

HelgeSverre commented 7 months ago

Ill see if i can make the laravel related stuff suggested in the composer file, gimme a few hours.

HelgeSverre commented 7 months ago

Hmmm, this might not be trivial, (well to be fair, it probably is fairly trivial, I just have to spend a lot of time figuring out and failing along the way).

@ddebowczyk For context, are you rolling vanilla PHP, wordpress, cake, yii or some symfony-flavor?

ddebowczyk commented 7 months ago

Vanilla PHP

ddebowczyk commented 7 months ago

Frankly, Saloon has everything thats needed. Laravel stuff could be made an optional plugin.

ddebowczyk commented 7 months ago

I've been also thinking on a general client as APIs between Mistral, Anthropic, OpenAI, OpenRouter are so similar that if base client code gives up interacting via classes and accepts arrays as inputs and outputs a single client could be used to interact with all of those APIs. This is not ideal if you want to interact with them manually, but there could be an optional, extra layer which provides those dev friendly translations to object / class based calls. This might be too big change for your library, if so I'm thinking of some quick poc to see how this could work. Ultimately, nobody wants to use 4 different clients to talk to several llms, so i see value in having more flexible client which has minimum dependecies and can be used across various providers with extra typing required to provide all relevant options to call vendor specific options then to consume vendor specific responses. My use case is php port of instructor by Jason Liu.

ddebowczyk commented 7 months ago

I've built the integrations with OpenAI, Anthropic, Mistral, OpenRouter, Azure from the scratch using SaloonPHP. This makes my problem solved, so I'm closing the issue.