jupyterlab / jupyter-ai

A generative AI extension for JupyterLab
https://jupyter-ai.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
3.25k stars 332 forks source link

`EnvAuthStrategy.keyword_param` is not respected in the magics package #928

Open krassowski opened 3 months ago

krassowski commented 3 months ago

Description

EnvAuthStrategy.keyword_param works for instantiation of provider models in chat UI but not in magics

https://github.com/jupyterlab/jupyter-ai/blob/8efe46bb70698105073c66f9666de55f11531f79/packages/jupyter-ai-magics/jupyter_ai_magics/providers.py#L113-L119

White the chat UI (jupyter-ai package) does handle it correctly:

https://github.com/jupyterlab/jupyter-ai/blob/8efe46bb70698105073c66f9666de55f11531f79/packages/jupyter-ai/jupyter_ai/config_manager.py#L438-L461

The jupyter-ai-magics will just call

https://github.com/jupyterlab/jupyter-ai/blob/8efe46bb70698105073c66f9666de55f11531f79/packages/jupyter-ai-magics/jupyter_ai_magics/magics.py#L544-L545

jhgoebbert commented 3 months ago

Oh, I have to check if this is related to an issue I have with a custom model provider: https://github.com/FZJ-JSC/jupyter-ai-blablador/issues/1