jupyterlite / jupyterlab-codestral

AI code completions and chat for JupyterLab, Notebook 7 and JupyterLite, powered by MistralAI ✨
http://jupyterlite.github.io/jupyterlab-codestral/
BSD 3-Clause "New" or "Revised" License
6 stars 2 forks source link

Add another provider #13

Open jtpio opened 3 weeks ago

jtpio commented 3 weeks ago

As a follow-up to https://github.com/jupyterlite/jupyterlab-codestral/pull/10 and to validate the approach, it would be interesting to add support for another provider, for example OpenAI.

brichet commented 3 weeks ago

We'll probably have to handle it a bit differently for other providers than MistralAI.

I looked a bit into openAi and Groq providers, for example, and it seems that the options (apiKey, ...) are not updated after the initialization. We probably need to create a new instance every time a setting change. In the long run we may want a dedicated settings panel that is validated on purpose, and not on every change.

For MistalAI, the API "client" is instantiated for each request, that's why the updated options are taken into account.