Proof of concept for a phone-simulated chatbot.
- simulate a phone call with a chatbot to
- learn a language
- practice phone calls
- Claude AI to generate random characters
- ChatGPT to create avatar images for the random characters
- Next.JS for building FE+BE for the App
- Elevenlabs for text-to-speech generation
- when clicking on an avatar we simulate a phone call, with dialing, ringback and greeting sounds
- the user's microphone get's enabled and the transcript of the spoken text (using native speech recognition) will be sent to the backend
- if the transcript is not empty and did not change in the last 1500ms, we send the transcript to the backend
- the backend receives the transcript and generates an answer using Claude AI with some instructions around it (conversation/history starts for the call)
- the generated answer from Claude AI get's passed to Elevenlabs to generate a speech file which get's streamed to the user's client
- the client receives the speech file and plays it, usually the response from Claude AI contains an open question and the user's microphone will be enabled again so he can respond
- whenever there is a language switch in the backend (through Claude AI) we pass it in the text-to-speech response, so the client can re-initialize the microphones native speech recognition with the desired language
- Clone the repository
- Run
npm install - Run
npm start - Open a browser and go to
http://localhost:3000 - Click on an Avatar to start a call
- Allow the browser access to your microphone or click on the microphone icon to respond by text message
- Wait for a response and respond back.
- Repeat until you don't like it anymore
- create easier to read and use react hooks for the request and response logic of tts + chat
- add a way to see the history of a call and jump back to a previous message and continue from there
- predict the next answers based on the current message and pre-generate voice messages for them so the conversation can be more fluid (already generate answers while still waiting for response)
- add a way to add custom voice messages for the bot
- re-generate avatars with random details for each