diff --git a/packages/jupyter-ai/jupyter_ai/config/config_schema.json b/packages/jupyter-ai/jupyter_ai/config/config_schema.json index 0dd910ab9..d276dd31d 100644 --- a/packages/jupyter-ai/jupyter_ai/config/config_schema.json +++ b/packages/jupyter-ai/jupyter_ai/config/config_schema.json @@ -22,12 +22,6 @@ "default": null, "readOnly": false }, - "completions_embeddings_provider_id": { - "$comment": "Embedding model global ID for completions.", - "type": ["string", "null"], - "default": null, - "readOnly": false - }, "api_keys": { "$comment": "Dictionary of API keys, mapping key names to key values.", "type": "object", diff --git a/packages/jupyter-ai/jupyter_ai/config_manager.py b/packages/jupyter-ai/jupyter_ai/config_manager.py index def992bee..fa8a53ef7 100644 --- a/packages/jupyter-ai/jupyter_ai/config_manager.py +++ b/packages/jupyter-ai/jupyter_ai/config_manager.py @@ -100,7 +100,6 @@ class ConfigManager(Configurable): model_provider_id: Optional[str] embeddings_provider_id: Optional[str] completions_model_provider_id: Optional[str] - completions_embeddings_provider_id: Optional[str] def __init__( self, @@ -177,10 +176,7 @@ def _process_existing_config(self, default_config): def _validate_lm_em_id(self, config): lm_provider_keys = ["model_provider_id", "completions_model_provider_id"] - em_provider_keys = [ - "embeddings_provider_id", - "completions_embeddings_provider_id", - ] + em_provider_keys = ["embeddings_provider_id"] # if the currently selected language or embedding model are # forbidden, set them to `None` and log a warning. @@ -352,7 +348,6 @@ def delete_api_key(self, key_name: str): self.lm_provider, self.em_provider, self.completions_lm_provider, - self.completions_em_provider, ]: if ( provider @@ -417,12 +412,6 @@ def em_provider(self): def completions_lm_provider(self): return self._get_provider("completions_model_provider_id", self._lm_providers) - @property - def completions_em_provider(self): - return self._get_provider( - "completions_embeddings_provider_id", self._em_providers - ) - def _get_provider(self, key, listing): config = self._read_config() gid = getattr(config, key) @@ -446,12 +435,6 @@ def completions_lm_provider_params(self): "completions_model_provider_id", self._lm_providers ) - @property - def completions_em_provider_params(self): - return self._provider_params( - "completions_embeddings_provider_id", self._em_providers - ) - def _provider_params(self, key, listing): # get generic fields config = self._read_config() diff --git a/packages/jupyter-ai/jupyter_ai/models.py b/packages/jupyter-ai/jupyter_ai/models.py index 5675c6366..6742a922d 100644 --- a/packages/jupyter-ai/jupyter_ai/models.py +++ b/packages/jupyter-ai/jupyter_ai/models.py @@ -124,7 +124,6 @@ class DescribeConfigResponse(BaseModel): # passed to the subsequent UpdateConfig request. last_read: int completions_model_provider_id: Optional[str] - completions_embeddings_provider_id: Optional[str] completions_fields: Dict[str, Dict[str, Any]] @@ -143,7 +142,6 @@ class UpdateConfigRequest(BaseModel): # time specified by `last_read` to prevent write-write conflicts. last_read: Optional[int] completions_model_provider_id: Optional[str] - completions_embeddings_provider_id: Optional[str] completions_fields: Optional[Dict[str, Dict[str, Any]]] _validate_send_wse = validator("send_with_shift_enter", allow_reuse=True)( @@ -163,5 +161,4 @@ class GlobalConfig(BaseModel): fields: Dict[str, Dict[str, Any]] api_keys: Dict[str, str] completions_model_provider_id: Optional[str] - completions_embeddings_provider_id: Optional[str] completions_fields: Dict[str, Dict[str, Any]] diff --git a/packages/jupyter-ai/jupyter_ai/tests/__snapshots__/test_config_manager.ambr b/packages/jupyter-ai/jupyter_ai/tests/__snapshots__/test_config_manager.ambr index b5d75bdc9..111ebe6ea 100644 --- a/packages/jupyter-ai/jupyter_ai/tests/__snapshots__/test_config_manager.ambr +++ b/packages/jupyter-ai/jupyter_ai/tests/__snapshots__/test_config_manager.ambr @@ -3,7 +3,6 @@ dict({ 'api_keys': list([ ]), - 'completions_embeddings_provider_id': None, 'completions_fields': dict({ }), 'completions_model_provider_id': None, diff --git a/packages/jupyter-ai/src/components/settings/use-server-info.ts b/packages/jupyter-ai/src/components/settings/use-server-info.ts index 3695bfe41..d583b9579 100644 --- a/packages/jupyter-ai/src/components/settings/use-server-info.ts +++ b/packages/jupyter-ai/src/components/settings/use-server-info.ts @@ -13,7 +13,7 @@ type ServerInfoProperties = { emProviders: AiService.ListProvidersResponse; config: AiService.DescribeConfigResponse; chat: ProvidersInfo; - completions: ProvidersInfo; + completions: Omit; }; type ServerInfoMethods = { @@ -72,11 +72,8 @@ export function useServerInfo(): ServerInfo { const lmLocalId = (lmGid && getModelLocalId(lmGid)) ?? ''; const cLmGid = config.completions_model_provider_id; - const cEmGid = config.completions_embeddings_provider_id; const cLmProvider = cLmGid === null ? null : getProvider(cLmGid, lmProviders); - const cEmProvider = - cEmGid === null ? null : getProvider(cEmGid, emProviders); const cLmLocalId = (cLmGid && getModelLocalId(cLmGid)) ?? ''; setServerInfoProps({ @@ -90,7 +87,6 @@ export function useServerInfo(): ServerInfo { }, completions: { lmProvider: cLmProvider, - emProvider: cEmProvider, lmLocalId: cLmLocalId } }); diff --git a/packages/jupyter-ai/src/handler.ts b/packages/jupyter-ai/src/handler.ts index 600a257f6..512479b7e 100644 --- a/packages/jupyter-ai/src/handler.ts +++ b/packages/jupyter-ai/src/handler.ts @@ -118,7 +118,6 @@ export namespace AiService { fields: Record>; last_read: number; completions_model_provider_id: string | null; - completions_embeddings_provider_id: string | null; }; export type UpdateConfigRequest = { @@ -129,7 +128,6 @@ export namespace AiService { fields?: Record>; last_read?: number; completions_model_provider_id?: string | null; - completions_embeddings_provider_id?: string | null; completions_fields?: Record>; };