Add voice transcription to the cmd_voice command and output the transcribed text.

This commit is contained in:
Paul Gauthier 2023-08-10 16:18:13 -03:00
parent 2b1de442ed
commit 47144a7e99

View file

@ -9,6 +9,7 @@ import tiktoken
from prompt_toolkit.completion import Completion from prompt_toolkit.completion import Completion
from aider import prompts from aider import prompts
from aider.voice import record_and_transcribe
from .dump import dump # noqa: F401 from .dump import dump # noqa: F401
@ -434,11 +435,11 @@ class Commands:
else: else:
self.io.tool_output(f"{cmd} No description available.") self.io.tool_output(f"{cmd} No description available.")
from .voice import record_and_transcribe
def cmd_voice(self, args): def cmd_voice(self, args):
"Record and transcribe voice input" "Record and transcribe voice input"
return record_and_transcribe() text = record_and_transcribe()
self.io.tool_output(text)
return text
def expand_subdir(file_path): def expand_subdir(file_path):