a2hsh / chatGPT

A react app that connects to ChatGPT, providing a custom and accessible UI for using OpenAI's chat experience.
MIT License
1 stars 0 forks source link

Add Integration with WhisperAI API for Speech-to-Text Conversion #10

Closed sweep-ai[bot] closed 1 year ago

sweep-ai[bot] commented 1 year ago

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

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.