This project is an extension using Azure Functions and JavaScript. It consists of a backend service that processes speech and text using various Azure AI services and a frontend web application.
BetterPrompt is a smart Chrome extension built to enhance digital communication by making user input clearer, more concise, and contextually accurateβwhether you're typing, speaking, or on the move. Designed for ease of use and accessibility, BetterPrompt empowers users from all backgrounds, including non-native speakers and individuals with writing disabilities, to communicate more effectively across any website.
Built with React and Material-UI (MUI) for a sleek, responsive interface, and powered by Azure Cognitive Services, the extension provides real-time grammar correction, translation, speech-to-text input, and prompt optimization. BetterPrompt integrates directly into text input fields on any webpage and improves both the quality of search queries and AI interactionsβhelping users get better results, faster.
-
Grammar & Clarity Enhancements: Real-time grammar correction and sentence restructuring.
-
Prompt Optimization: Refines prompts for search engines and AI tools like ChatGPT.
-
Speech-to-Text Input: Enables hands-free communication through Azure Speech.
-
Language Translation: Accurately translates input to and from multiple languages.
-
Content Moderation: Flags harmful, biased, or sensitive content and suggests ethical alternatives.
-
Accessible UI: Clean, responsive React + MUI interface that overlays any text field on a webpage.
-
Help users communicate clearly, quickly, and effectivelyβregardless of language fluency or ability.
-
Make digital spaces more accessible to users with writing or speech-related disabilities.
-
Support global, multilingual communication with accurate translation and optimization.
-
Improve the quality of user inputs for AI interactions and search results.
-
Promote safe, ethical, and inclusive online communication through intelligent moderation.
BetterPrompt aims to evolve into a universal communication assistant that:
-
Integrates with virtual assistants, messaging tools, and productivity platforms.
-
Offers tone adjustment, prompt intent detection, and smart writing suggestions.
-
Becomes a default accessibility and clarity enhancer for the web and mobile environments.
BetterPrompt Presentation Link
-
Frontend: React, Material-UI (MUI)
-
Browser Platform: Chrome Extension API
-
Speech & Text Processing: Azure Cognitive Services (Text Analytics, Translator, Speech-to-Text)
-
Backend (Planned): Azure Functions or Node.js for processing user input
π¦ project-root
βββ π backend_service
β βββ π AnalyzePrompt
β βββ π SpeechToText
β βββ π host.json
β βββ π local.settings.json
β βββ π package.json
βββ π web
β βββ π src
β βββ π public
β βββ π index.html
β βββ π package.json
β βββ π README.md
βββ π README.md
Click To Expand
+---------------------------------+
| User Input (Text/Voice) |
|---------------------------------|
| - Chrome Extension detects input|
| - Voice Input processed via |
| Azure Speech-to-Text |
+---------------------------------+
|
v
+---------------------------------+
| Azure Functions |
| - Serverless backend processing |
| - Triggers various Azure APIs |
+---------------------------------+
|
v
+---------------------------------+
| Azure OpenAI (GPT) |
| - Refines input for clarity, |
| conciseness, and grammar |
| - Optimizes AI queries |
+---------------------------------+
|
v
+---------------------------------+ +---------------------------------+
| Azure Content Safety |<--->| Azure Translator |
| - Detects harmful content, | | - Translates text input into |
| bias, or offensive language | | desired language |
| - Suggests ethical alternatives| +---------------------------------+
+---------------------------------+
|
v
+---------------------------------+
| Azure Speech (optional) |
| - Converts optimized text to |
| speech (Text-to-Speech) |
+---------------------------------+
|
v
+---------------------------------+
| Chrome Extension UI |
| - Displays optimized input |
| - Provides feedback to the user|
| - Suggests improvements or |
| alternative phrasing |
+---------------------------------+
- Azure Functions
AnalyzePrompt
SpeechToText
- Azure AI Services
- Azure OpenAI
- Azure Content Safety
- Azure Translator
- Azure Speech
- Frontend
- JavaScript (React/Vanilla JS)
- Azure integration
- Processes input text using Azure OpenAI.
- Ensures safe content using Azure Content Safety.
- Supports translation via Azure Translator.
- Converts audio to text using Azure Speech Service.
- Outputs transcribed text for further analysis.
- Node.js (Latest LTS)
- Azure Functions Core Tools
- Azure CLI
- A configured Azure Subscription with required services
Installation
1. Clone the repository: ```sh git clone https://github.com/your-repo.git cd project-root ```-
Install dependencies for the backend:
cd backend_service npm install
-
Install dependencies for the frontend:
cd ../web npm install
Running Locally
-
Navigate to the
backend_service
folder:cd backend_service
-
Start the Azure Functions locally:
func start
-
Navigate to the
web
folder:cd web
-
Start the development server:
npm run dev
Deployment
-
Login to Azure:
az login
-
Deploy Azure Functions:
func azure functionapp publish <YourFunctionAppName>
- Deploy frontend (if using Azure Static Web Apps):
az staticwebapp create --name <YourWebAppName> --resource-group <YourResourceGroup> --source ./web --branch main --location <YourRegion>
Go to local.settings.json
file in backend_service
and put the values of these environment variables:
"OPENAI_ENDPOINT": "",
"OPENAI_API_KEY":"",
"CONTENT_SAFETY_ENDPOINT": "",
"CONTENT_SAFETY_API_KEY"="",
"AZURE_TEXT_ANALYTICS_ENDPOINT": "",
"AZURE_TEXT_ANALYTICS_API_KEY":"",
"AZURE_TRANSLATOR_ENDPOINT": "",
"AZURE_TRANSLATOR_API_KEY":""
Feel free to submit issues or contribute to the project.
MIT License