A React TypeScript application that allows users to interact with OpenAI's GPT model using voice input. The application converts speech to text and displays the AI's response.
- Real-time speech-to-text conversion using Web Speech API
- Integration with OpenAI's GPT-3.5 Turbo model
- Modern React with TypeScript
- Responsive and user-friendly interface
- Error handling and status feedback
- Node.js (v14 or higher)
- npm or yarn
- OpenAI API key
- Modern web browser (Chrome or Edge recommended for best speech recognition support)
- Clone the repository:
git clone <repository-url> cd voice-chat- Install dependencies:
npm install- Create a
.envfile in the root directory and add your OpenAI API key:
VITE_OPENAI_API_KEY=your_api_key_here - Start the development server:
npm run devThe application will be available at http://localhost:5173
- Click the "Start Listening" button
- Allow microphone access when prompted by your browser
- Speak your question or message
- The application will convert your speech to text and send it to OpenAI
- The AI's response will be displayed on the screen
The Web Speech API is best supported in:
- Google Chrome
- Microsoft Edge
- Safari (limited support)
- React
- TypeScript
- Vite
- OpenAI API
- Web Speech API
MIT
Contributions are welcome! Please feel free to submit a Pull Request.