Hello, I'm hoping to use this tool as a way to have speech-to-text in the terminal and to then send the query as a JSON payload to the ChatGPT API.
The little Bash script looks like this:
The problem that I'm encountering is that the JSON is malformed, and ends up looking like this:
{ "model": "text-davinci-003", "prompt": "\u001b[2K\rTell\u001b[2K\rTell me a\u001b[2K\rTell me a joke\u001b[2K\rTell me a joke send", "max_tokens": "100", "temperature": "0.5" }
Do you know why this is the case, and how I might resolve this so that only the full final output of hear is used? From what I can tell by cat-ing out the /tmp/voice.txt file, it does contain just the prompt. I'm confused on why the includes these extra ANSI escape characters.
Hello, I'm hoping to use this tool as a way to have speech-to-text in the terminal and to then send the query as a JSON payload to the ChatGPT API.
The little Bash script looks like this:
The problem that I'm encountering is that the JSON is malformed, and ends up looking like this:
Do you know why this is the case, and how I might resolve this so that only the full final output of
hear
is used? From what I can tell bycat
-ing out the/tmp/voice.txt
file, it does contain just the prompt. I'm confused on why the includes these extra ANSI escape characters.