From 752a2fbdc06ef3fc8fa45731ac237f00ff9b9283 Mon Sep 17 00:00:00 2001 From: "bobo.yang" Date: Wed, 22 Nov 2023 21:39:56 +0800 Subject: [PATCH 1/2] replace $command_path with path of command.yml --- devchat/engine/command_parser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devchat/engine/command_parser.py b/devchat/engine/command_parser.py index a8279193..09da2788 100644 --- a/devchat/engine/command_parser.py +++ b/devchat/engine/command_parser.py @@ -60,7 +60,7 @@ def parse_command(file_path: str) -> Command: with open(file_path, 'r', encoding='utf-8') as file: # replace {curpath} with config_dir - content = file.read().replace('{curpath}', config_dir) + content = file.read().replace('$command_path', config_dir) config_dict = yaml.safe_load(content) config = Command(**config_dict) return config From c737dd0027b60d213ef29c4509c9922703514ef9 Mon Sep 17 00:00:00 2001 From: "bobo.yang" Date: Wed, 22 Nov 2023 21:57:17 +0800 Subject: [PATCH 2/2] update Command fields --- devchat/engine/command_parser.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/devchat/engine/command_parser.py b/devchat/engine/command_parser.py index 09da2788..ef13f631 100644 --- a/devchat/engine/command_parser.py +++ b/devchat/engine/command_parser.py @@ -10,12 +10,13 @@ class Parameter(BaseModel, extra='forbid'): description: Optional[str] enum: Optional[List[str]] default: Optional[str] - required: Optional[bool] class Command(BaseModel, extra='forbid'): description: str + hint: Optional[str] parameters: Optional[Dict[str, Parameter]] + input: Optional[str] steps: Optional[List[Dict[str, str]]]