From c3b01418844a2fc0f21346aee745e6c52e7b4d1a Mon Sep 17 00:00:00 2001 From: Andrii Ieroshenko Date: Wed, 15 Nov 2023 23:46:22 -0800 Subject: [PATCH] rename APIErrorModel -> ErrorModel --- packages/jupyter-ai/jupyter_ai/config_manager.py | 4 ++-- packages/jupyter-ai/jupyter_ai/models.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/jupyter-ai/jupyter_ai/config_manager.py b/packages/jupyter-ai/jupyter_ai/config_manager.py index 65d3ab159..68b44406d 100644 --- a/packages/jupyter-ai/jupyter_ai/config_manager.py +++ b/packages/jupyter-ai/jupyter_ai/config_manager.py @@ -8,7 +8,7 @@ from deepmerge import always_merger as Merger from jsonschema import Draft202012Validator as Validator from jupyter_ai.models import ( - APIErrorModel, + ErrorModel, DescribeConfigResponse, GlobalConfig, UpdateConfigRequest, @@ -222,7 +222,7 @@ def _validate_lm_em_id(self, config): def _handle_validation_error(self, e: ValidationError): formatted_error = _format_validation_errors(e) - self._config_error = APIErrorModel( + self._config_error = ErrorModel( type="ValidationError", message="Configuration validation failed", details=formatted_error, diff --git a/packages/jupyter-ai/jupyter_ai/models.py b/packages/jupyter-ai/jupyter_ai/models.py index 8be0f8d03..febfdf387 100644 --- a/packages/jupyter-ai/jupyter_ai/models.py +++ b/packages/jupyter-ai/jupyter_ai/models.py @@ -145,7 +145,7 @@ class GlobalConfig(BaseModel): api_keys: Dict[str, str] -class APIErrorModel(BaseModel): - type: str = "APIError" - message: str +class ErrorModel(BaseModel): + type: str = None + message: str = None details: str = None