Text Assistant is a desktop application designed to enhance text using AI models. It provides features like text enhancement, history management, and voice input/output, all accessible through a system tray icon and global shortcuts.
- Text Enhancement 📝: Enhance your text with options for tone, length, format, and language adjustments.
- History Management 📚: Save and load previous text enhancements for easy access and reuse.
- Voice Input/Output 🎤: Use voice commands to input text and have the application read text aloud.
- System Tray Integration 🖥️: Access the application quickly from the system tray with single and double-click actions.
- Global Shortcuts ⌨️: Use global hotkeys to trigger the application from anywhere on your system.
- Dark Mode 🌙: Toggle between light and dark mode for a comfortable viewing experience.
- Templates 📋: Apply structured writing templates for various formats like emails, blog posts, and more.
- User Profiles 👤: Create and manage multiple user profiles with personal and professional details.
- Customizable Prompts ✏️: Edit and customize AI prompts based on your specific needs.
- Progress Tracking 📊: Monitor text enhancement progress with a built-in progress indicator.
- Multi-language Support 🌍: Support for multiple languages including English, Spanish, French, German, Chinese, Japanese, and Korean.
- Tone Selection: Choose from Professional, Casual, Friendly, Formal, Academic, Creative, Persuasive, or Enthusiastic
- Length Control: Options for Keep Original, Make Shorter, Make Longer, Very Concise, or Detailed
- Format Options: Plain Text, Markdown, HTML, Email, Blog Post, or Social Media
- Quality Improvements: Grammar fixing, spelling correction, and clarity enhancement
Pre-built templates for:
- Email Response
- Professional Letter
- Meeting Minutes
- Blog Post
- Social Media Post
- Technical Documentation
- Business Proposal
- Formal Report
Store and manage:
- Personal Information (name, email, phone)
- Professional Details (company, designation)
- Social Media Links (LinkedIn, Facebook, Instagram, X/Twitter, YouTube, Telegram)
- Project-specific Information
Before you begin, ensure you have met the following requirements:
- Python 🐍: Make sure Python 3.6 or later is installed on your system. You can download it from python.org.
- Pip 📦: Ensure pip is installed and updated. It usually comes with Python, but you can update it using:
python -m pip install --upgrade pip
- Virtual Environment 🌐: Familiarity with Python virtual environments is recommended.
- Windows 🪟: This application is designed for Windows systems, as it uses Windows-specific libraries like
pywin32
. - Ollama 🤖: Ensure that the Ollama service is installed and running. This service is used to fetch AI models and perform text enhancements.
-
Clone the Repository 📥:
git clone https://github.com/sahilr2050/ai-oncall-writer.git cd ai-oncall-writer
-
Create a Virtual Environment 🌍: Ensure you have Python installed, then create a virtual environment:
python -m venv venv
-
Activate the Virtual Environment
▶️ :- On Windows:
venv\Scripts\activate
- On Windows:
-
Install Dependencies 📚: Install the required packages using pip:
pip install -r requirements.txt
-
Start the Application
▶️ : Use the provided batch script to start the application. This script will handle starting the necessary services and the application itself.start_writer_assistant.bat
- The script checks for an existing instance of the application and terminates it if found.
- It creates a lock file to prevent multiple instances.
- It checks if the Ollama service is running and starts it if necessary, along with the Mistral:7b model.
-
Access the Application 🖱️:
- The application will run in the background and can be accessed via the system tray icon.
- Use the global shortcut
Ctrl+Shift+A
to open the assistant from anywhere.
- System Tray 🖥️: Right-click the tray icon for options to open the assistant or quit the application.
- Enhance Text ✍️: Enter text in the input area, select your enhancement options, and click "Enhance Text".
- History 📚: Access previous enhancements through the "History" button, where you can load or clear past entries.
- Voice Commands 🎤: Use the microphone icon to input text via voice and the speaker icon to read text aloud.
- Dark Mode 🌙: Toggle between light and dark mode using the "Dark Mode" button.
- Templates 📋: Select from various templates to structure your writing.
-
Creating a Profile:
- Click "User Personalization"
- Enter project name (required)
- Fill in personal and professional details
- Click "Save" to store the profile
-
Managing Profiles:
- Select profiles from the dropdown
- Edit existing profiles through the personalization dialog
- Delete unwanted profiles using the "Delete Profile" button
- Select a template from the dropdown menu
- The template will populate the input area with a structured format
- Customize the placeholder text with your content
- Apply AI enhancement while maintaining the template structure
Voice Input:
- Click the "Voice Input" button
- Speak clearly into your microphone
- The application will transcribe your speech to text
- Supports multiple languages based on your language selection
Voice Output:
- Select the enhanced text
- Click "Voice Output"
- The application will read the text aloud
- Uses system text-to-speech engine
Features:
- Stores up to 50 recent enhancements
- Search functionality for finding past entries
- Load previous enhancements with original settings
- Option to clear individual or all history entries
- Default Options 🎯: The application starts with default options for grammar, spelling, and clarity improvements enabled.
- Model Selection 🤖: Choose from available AI models fetched from the Ollama API.
The application starts with:
- Grammar correction enabled
- Spelling check enabled
- Clarity improvement enabled
- Professional tone selected
- Original length maintained
- Plain text format
- English language selected
- Dark/Light Mode: Toggle between themes
- Window Position: Remembers last position
- Profile Selection: Persists between sessions
- Model Selection: Choose between available Ollama models
- Last Used Settings: Automatically saved and restored
-
Application Freezing:
- Check the task manager for hung processes
- Delete the writer_assistant.lock file
- Restart the Ollama service
-
Voice Recognition Issues:
- Verify microphone permissions in Windows settings
- Check the selected input device
- Ensure proper language pack installation
-
Template Loading Problems:
- Clear application cache
- Reset to default templates
- Check file permissions
-
Profile Management Issues:
- Verify personalize directory permissions
- Check for corrupted profile files
- Backup profiles before deletion
-
Hotkey Issues ⌨️: If the global hotkey doesn't work, ensure no other application is using the same shortcut.
-
Voice Input/Output 🎤: Ensure your microphone and speakers are properly configured and accessible by the application.
Q1: What should I do if the application doesn't start? 🚫
- Ensure that all prerequisites are met, especially the installation of Python and Ollama.
- Check the logs for any error messages that might indicate the problem.
- If the application crashes, ensure that the
writer_assistant.lock
file is deleted before restarting the application.
Q2: How can I update the application? 🔄
- Pull the latest changes from the repository and reinstall the dependencies if necessary.
Q3: Can I run this application on macOS or Linux? 💻
- The application is designed for Windows due to the use of Windows-specific libraries like
pywin32
.
Q4: What if the Ollama service is not running? 🤖
- Ensure that Ollama is installed and running. The batch script should start it automatically, but you can also start it manually if needed.
Q5: How do I clear the enhancement history? 🗑️
- Use the "Clear History" button in the history dialog to remove all saved enhancements.
Q6: How do I switch between light and dark mode? 🌓
- Use the "Dark Mode" button in the application to toggle between light and dark themes.
Q7: What should I do if the voice input doesn't work? 🎤
- Ensure your microphone is properly connected and configured. Check the application permissions to ensure it can access the microphone.
Q8: How can I customize the AI prompt? ✏️
- Use the prompt editor in the application to customize the AI prompt based on your selected options.
Q9: The application is not responding, what should I do?
- Try closing the application from the system tray icon and restarting it.
- If the application is still unresponsive, check the logs for any error messages and ensure that the
writer_assistant.lock
file is not present.
Q10: How do I handle multiple instances of the application? 📑
- The application uses a lock file (
writer_assistant.lock
) to prevent multiple instances. If you need to restart the application after a crash, ensure this file is deleted.
Q11: What if the global hotkey doesn't work? ⌨️
- Ensure no other application is using the same shortcut. You may need to change the hotkey in the code if conflicts persist.
Q12: How can I troubleshoot network issues with the Ollama API? 🌐
- Ensure your network connection is stable. If issues persist, check the API endpoint and ensure the Ollama service is running correctly.
Q13: Can I customize the templates provided in the application? 📝
- Currently, templates are predefined. You can modify the code in
app.py
to add or change templates as needed.
Contributions are welcome! Please fork the repository and submit a pull request for any enhancements or bug fixes.
This project is licensed under the MIT License. See the LICENSE file for details.
- PyQt5 🖼️: For the GUI framework.
- Ollama API 🤖: For providing AI model access.
- Python Libraries 📚: Including
requests
,pyttsx3
, andspeech_recognition
for various functionalities.
Text Assistant is designed with user privacy and security in mind. Here are some key points regarding the security of the application:
-
Local Processing 💻: All text enhancements and AI model operations are performed locally on your machine. The application does not require an internet connection to function, ensuring that your data remains private and secure.
-
No Internet Dependency 🌐: The application uses the locally installed Ollama LLM, which means it does not send any data over the internet. This ensures that your text and voice inputs are not exposed to external servers.
-
Local Storage 💾: All outputs, configuration files, and history are stored locally on your PC. This means you have full control over your data, and it is not shared with any third-party services.
-
Data Privacy 🔐: Since the application operates entirely offline, there is no risk of data breaches or unauthorized access to your information through network vulnerabilities.
By keeping all operations and data storage local, Text Assistant provides a secure environment for enhancing your text without compromising your privacy.