This PR adds a new feature to the ChatGPT application that allows users to convert speech to text using the Whisper OpenAI API. The feature includes a microphone icon that appears instead of the send button when the chat box is empty. Clicking on the microphone icon reveals three other icons for pause/unpause, canceling the recording, and sending the recording to the API. The icons have ARIA states and properties for accessibility. The recorded audio is sent to the Whisper OpenAI API using the user's token, and the transcribed text is displayed as a user message in the chat. The transcribed text is then sent to the ChatGPT API as a text message. Additionally, a second tab is added to the preferences file for optional arguments to the API request, similar to the chat settings. The API request header used is the same as the one used in the chat API, including the API key.
Summary of Changes
Added microphone icon to ChatInput.jsx that appears when the chat box is empty
Implemented recording functionality and sending recorded audio to the Whisper OpenAI API in ChatInput.jsx
Displayed transcribed text as a user message in the chat using the sendMessage function in ChatInput.jsx
Added second tab for optional arguments to the API request in Preferences.jsx
Used the same API request header as the chat API, including the API key, in App.jsx
Fixes #6.
To checkout this PR branch, run the following command in your terminal:
git checkout sweep/whisper-api-integration
To get Sweep to edit this pull request, leave a comment below or in the code. Leaving a comment in the code will only modify the file but commenting below can change the entire PR.
Description
This PR adds a new feature to the ChatGPT application that allows users to convert speech to text using the Whisper OpenAI API. The feature includes a microphone icon that appears instead of the send button when the chat box is empty. Clicking on the microphone icon reveals three other icons for pause/unpause, canceling the recording, and sending the recording to the API. The icons have ARIA states and properties for accessibility. The recorded audio is sent to the Whisper OpenAI API using the user's token, and the transcribed text is displayed as a user message in the chat. The transcribed text is then sent to the ChatGPT API as a text message. Additionally, a second tab is added to the preferences file for optional arguments to the API request, similar to the chat settings. The API request header used is the same as the one used in the chat API, including the API key.
Summary of Changes
ChatInput.jsx
that appears when the chat box is emptyChatInput.jsx
sendMessage
function inChatInput.jsx
Preferences.jsx
App.jsx
Fixes #6.
To checkout this PR branch, run the following command in your terminal:
To get Sweep to edit this pull request, leave a comment below or in the code. Leaving a comment in the code will only modify the file but commenting below can change the entire PR.