From 25d22d855975a5e3af83956a833d46e71640949b Mon Sep 17 00:00:00 2001 From: "Rossdan Craig rossdan@lastmileai.dev" <> Date: Fri, 15 Dec 2023 03:13:43 -0500 Subject: [PATCH] [ez][documentation] Making error message for unfound param to delete more clear where we're trying to look for it TSIA --- python/src/aiconfig/schema.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/src/aiconfig/schema.py b/python/src/aiconfig/schema.py index 3a2c26520..e62a6c9ab 100644 --- a/python/src/aiconfig/schema.py +++ b/python/src/aiconfig/schema.py @@ -326,7 +326,8 @@ def delete_parameter(self, parameter_name, prompt_name: Optional[str] = None): if parameter_name in target_metadata.parameters: del target_metadata.parameters[parameter_name] else: - raise KeyError(f"Parameter '{parameter_name}' does not exist.") + scope_suffix = f"prompt '{prompt_name}'" if prompt_name is not None else "current AIConfig-scoped metadata" + raise KeyError(f"Parameter '{parameter_name}' does not exist for {scope_suffix}.") def get_prompt(self, prompt_name: str) -> Prompt: """