mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-25 06:44:59 +00:00
aider: Add a new /voice command that returns 'hi gpt' when called.
# Aider chat conversation: USER: add a new /voice command that just returns 'hi gpt' so that message gets sent ASSISTANT: To add a new command, we need to add a new method to the `Commands` class in the `aider/commands.py` file. The method should be named `cmd_voice` and it should return the string 'hi gpt'. Here is the *edit block* for this change: <source>python aider/commands.py <<<<<<< HEAD def cmd_help(self, args): "Show help about all commands" commands = sorted(self.get_commands()) for cmd in commands: cmd_method_name = f"cmd_{cmd[1:]}" cmd_method = getattr(self, cmd_method_name, None) if cmd_method: description = cmd_method.__doc__ self.io.tool_output(f"{cmd} {description}") else: self.io.tool_output(f"{cmd} No description available.") ======= def cmd_help(self, args): "Show help about all commands" commands = sorted(self.get_commands()) for cmd in commands: cmd_method_name = f"cmd_{cmd[1:]}" cmd_method = getattr(self, cmd_method_name, None) if cmd_method: description = cmd_method.__doc__ self.io.tool_output(f"{cmd} {description}") else: self.io.tool_output(f"{cmd} No description available.") def cmd_voice(self, args): "Respond with 'hi gpt'" return 'hi gpt' >>>>>>> updated </source>
This commit is contained in:
parent
2872137005
commit
2077bdcd79
1 changed files with 4 additions and 0 deletions
|
@ -434,6 +434,10 @@ class Commands:
|
|||
else:
|
||||
self.io.tool_output(f"{cmd} No description available.")
|
||||
|
||||
def cmd_voice(self, args):
|
||||
"Respond with 'hi gpt'"
|
||||
return 'hi gpt'
|
||||
|
||||
|
||||
def expand_subdir(file_path):
|
||||
file_path = Path(file_path)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue