Skip to content

Commit

Permalink
[ez][documentation] Making error message for unfound param to delete …
Browse files Browse the repository at this point in the history
…more clear where we're trying to look for it

TSIA
  • Loading branch information
Rossdan Craig [email protected] committed Dec 15, 2023
1 parent 3de8c1c commit 25d22d8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion python/src/aiconfig/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
"""
Expand Down

0 comments on commit 25d22d8

Please sign in to comment.