How to read fields in custom provider in jupyter ai

I’m trying to develop a custom provider for Jupyter AI. i need to read some configurationa. I have defined fields and I can set the value in AI settings in Jupyter, but I’m not able to read these settings in the code. They don’t show-up in kwargs. Can someone provide me an example of the code to be used? Thanks

but I’m not able to read these settings in the code

As in when invoking the model from the chat/inline completion model UI, or as in when using %%ai magics? The former should have access to the configuration in AI settings, the latter will use defaults unless configured separately (e.g. by environment variables).