diff --git a/.env.example b/.env.example index 46a21e892..f8aa09813 100644 --- a/.env.example +++ b/.env.example @@ -56,3 +56,12 @@ XAI_API_KEY= # Include this environment variable if you want more logging for debugging locally VITE_LOG_LEVEL=debug + +# Voice prompting using Whisper +# For OpneAI: https://help.openai.com/en/articles/4936850-where-do-i-find-my-openai-api-key +# For Groq: https://console.groq.com/docs/speech-text +# Note: Do not include a / on the end of the URL +WHISPER_PROVIDER_API_URL=https://api.openai.com +WHISPER_PROVIDER_API_KEY= +# If left blank, will default to 'whisper-1' +WHISPER_PROVIDER_MODEL= \ No newline at end of file diff --git a/README.md b/README.md index 54ae824ed..3620f7abc 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ This fork of Bolt.new allows you to choose the LLM that you use for each prompt! - ✅ Publish projects directly to GitHub (@goncaloalves) - ✅ Ability to enter API keys in the UI (@ali00209) - ✅ xAI Grok Beta Integration (@milutinke) +- ✅ Voice prompting (@milutinke) - ⬜ **HIGH PRIORITY** - Prevent Bolt from rewriting files as often (file locking and diffs) - ⬜ **HIGH PRIORITY** - Better prompting for smaller LLMs (code window sometimes doesn't start) - ⬜ **HIGH PRIORITY** Load local projects into the app @@ -39,7 +40,6 @@ This fork of Bolt.new allows you to choose the LLM that you use for each prompt! - ⬜ Have LLM plan the project in a MD file for better results/transparency - ⬜ VSCode Integration with git-like confirmations - ⬜ Upload documents for knowledge - UI design templates, a code base to reference coding style, etc. -- ⬜ Voice prompting # Bolt.new: AI-Powered Full-Stack Web Development in the Browser diff --git a/app/routes/api.voice-to-text.ts b/app/routes/api.voice-to-text.ts index 43a6984f6..e4bc4a134 100644 --- a/app/routes/api.voice-to-text.ts +++ b/app/routes/api.voice-to-text.ts @@ -44,9 +44,8 @@ export async function action({ request }: { request: Request }) { }; const formDataToSend = new FormData(); formDataToSend.append('file', audioFile as Blob, 'audio.wav'); - formDataToSend.append('model', 'whisper-1'); + formDataToSend.append('model', env.WHISPER_PROVIDER_MODEL || 'whisper-1'); - const env = process.env; const baseUrl = env.WHISPER_PROVIDER_API_URL; const apiKey = env.WHISPER_PROVIDER_API_KEY;