mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-31 01:35:00 +00:00
aider: Added main function to call record_and_transcribe
if the script is run directly.
# Aider chat conversation: USER: add a main func to call this if the script is run directly ASSISTANT: To add a main function that calls `record_and_transcribe` if the script is run directly, we need to modify the `aider/voice.py` file. Here are the changes: ```python aider/voice.py <<<<<<< HEAD # Return the transcription return response['choices'][0]['text'] ======= # Return the transcription return response['choices'][0]['text'] if __name__ == "__main__": print(record_and_transcribe()) >>>>>>> updated ``` This change adds a check to see if the script is being run directly (i.e., not imported as a module). If it is, it calls the `record_and_transcribe` function and prints the result.
This commit is contained in:
parent
1053d1781c
commit
c0f6cf6977
1 changed files with 3 additions and 0 deletions
|
@ -34,3 +34,6 @@ def record_and_transcribe():
|
|||
|
||||
# Return the transcription
|
||||
return response['choices'][0]['text']
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(record_and_transcribe())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue