From 9f32c906023c596a7610ee4d1d6cff9f1201a5dc Mon Sep 17 00:00:00 2001 From: Ty Dunn <ty@tydunn.com> Date: Thu, 6 Jul 2023 12:22:15 -0700 Subject: description for custom commands --- continuedev/src/continuedev/core/autopilot.py | 2 +- continuedev/src/continuedev/core/config.py | 2 ++ continuedev/src/continuedev/core/policy.py | 2 +- continuedev/src/continuedev/steps/open_config.py | 5 +++-- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/continuedev/src/continuedev/core/autopilot.py b/continuedev/src/continuedev/core/autopilot.py index b1c4f471..49fbacc5 100644 --- a/continuedev/src/continuedev/core/autopilot.py +++ b/continuedev/src/continuedev/core/autopilot.py @@ -75,7 +75,7 @@ class Autopilot(ContinueBaseModel): def get_available_slash_commands(self) -> List[Dict]: custom_commands = list(map(lambda x: { - "name": x.name, "description": x.prompt}, self.continue_sdk.config.custom_commands)) or [] + "name": x.name, "description": x.description}, self.continue_sdk.config.custom_commands)) or [] slash_commands = list(map(lambda x: { "name": x.name, "description": x.description}, self.continue_sdk.config.slash_commands)) or [] return custom_commands + slash_commands diff --git a/continuedev/src/continuedev/core/config.py b/continuedev/src/continuedev/core/config.py index ff7b8cb0..55f5bc60 100644 --- a/continuedev/src/continuedev/core/config.py +++ b/continuedev/src/continuedev/core/config.py @@ -15,6 +15,7 @@ class SlashCommand(BaseModel): class CustomCommand(BaseModel): name: str prompt: str + description: str class OnTracebackSteps(BaseModel): @@ -73,6 +74,7 @@ class ContinueConfig(BaseModel): "gpt-4"] = 'gpt-4' custom_commands: Optional[List[CustomCommand]] = [CustomCommand( name="test", + description="This is an example custom command. Use /config to edit it and create more", prompt="Write a comprehensive set of unit tests for the selected code. It should setup, run tests that check for correctness including important edge cases, and teardown. Ensure that the tests are complete and sophisticated. Give the tests just as chat output, don't edit any file.", )] slash_commands: Optional[List[SlashCommand]] = DEFAULT_SLASH_COMMANDS diff --git a/continuedev/src/continuedev/core/policy.py b/continuedev/src/continuedev/core/policy.py index fc9266ab..6ee2d03f 100644 --- a/continuedev/src/continuedev/core/policy.py +++ b/continuedev/src/continuedev/core/policy.py @@ -46,7 +46,7 @@ def parse_custom_command(inp: str, config: ContinueConfig) -> Union[None, Step]: slash_command = parse_slash_command(custom_cmd.prompt, config) if slash_command is not None: return slash_command - return CustomCommandStep(name=custom_cmd.name, prompt=custom_cmd.prompt, user_input=after_command) + return CustomCommandStep(name=custom_cmd.name, description=custom_cmd.description, prompt=custom_cmd.prompt, user_input=after_command) return None diff --git a/continuedev/src/continuedev/steps/open_config.py b/continuedev/src/continuedev/steps/open_config.py index 91459113..441cb0e7 100644 --- a/continuedev/src/continuedev/steps/open_config.py +++ b/continuedev/src/continuedev/steps/open_config.py @@ -9,12 +9,13 @@ class OpenConfigStep(Step): async def describe(self, models): return dedent("""\ - Config.json is now open. You can add a custom slash command in the `\"custom_commands\"` section, like in this example: + `\"config.json\"` is now open. You can add a custom slash command in the `\"custom_commands\"` section, like in this example: ```json "custom_commands": [ { "name": "test", - "prompt": "write me a comprehensive unit test for this function, that covers all edge cases. Use pytest." + "description": "Write unit tests like I do for the highlighted code" + "prompt": "Write a comprehensive set of unit tests for the selected code. It should setup, run tests that check for correctness including important edge cases, and teardown. Ensure that the tests are complete and sophisticated." } ], ```""") -- cgit v1.2.3-70-g09d2 From d24071fea080e6555e51bd516476c1a733975634 Mon Sep 17 00:00:00 2001 From: Ty Dunn <ty@tydunn.com> Date: Thu, 6 Jul 2023 12:36:34 -0700 Subject: shortening api key msg --- extension/src/continueIdeClient.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extension/src/continueIdeClient.ts b/extension/src/continueIdeClient.ts index 90547edc..e6966f41 100644 --- a/extension/src/continueIdeClient.ts +++ b/extension/src/continueIdeClient.ts @@ -264,7 +264,7 @@ class IdeProtocolClient { // If not, ask user for secret secret = await vscode.window.showInputBox({ - prompt: `Enter secret for ${key}, OR press enter to try for free. You can edit this later in the Continue VS Code settings.`, + prompt: `Either enter secret for ${key} or press enter to try Continue for free.`, password: true, }); -- cgit v1.2.3-70-g09d2