diff --git a/packages/jupyter-ai/jupyter_ai/config_manager.py b/packages/jupyter-ai/jupyter_ai/config_manager.py index 7b309faae..b01cc122e 100644 --- a/packages/jupyter-ai/jupyter_ai/config_manager.py +++ b/packages/jupyter-ai/jupyter_ai/config_manager.py @@ -461,6 +461,13 @@ def _provider_params(self, key, listing, completions: bool = False): fields = config.completions_fields.get(model_uid, {}) else: fields = config.fields.get(model_uid, {}) + + # exclude empty fields + # TODO: modify the config manager to never save empty fields in the + # first place. + for field_key in fields: + if isinstance(fields[field_key], str) and not len(fields[field_key]): + fields[field_key] = None # get authn fields _, Provider = get_em_provider(model_uid, listing)