This suite provides a comprehensive set of tools and resources for integrating OpenAI's powerful language models into your applications. Whether you're building chatbots, virtual assistants, or any other AI-powered solution, this suite will help you streamline your development process and ensure that your applications are built on top of the latest technology.
Note:
- Designed to be accessible and easy to understand, especially for users with learning differences like dyslexia.
- These scripts were developed using the OpenAI API documentation as a reference, with additional enhancements for better usability and error handling.
- These scripts require an active OpenAI API key.
- Please ensure you have one before proceeding.
- Visit the OpenAI Platform and create a new secret key.
📚 Table of Contents
- Overview & Accessibility
- Installation
- API Key Setup
- Core Features
- Script Details
- Usage Examples
- Cost Tracking
- Future Improvements
- Troubleshooting
- Support & Accessibility
- License
- Acknowledgments
This suite prioritizes accessibility with:
- Clear, step-by-step instructions
- Visual organization (emojis)
- Consistent menu structures
- Detailed error messages
- Progress indicators
- Cost transparency
To install the necessary packages, run the following command in your terminal:
pip install openai python-dotenv pillow requests tqdm termcolor pydub
-
Visit the OpenAI Platform and create a new secret key.
-
Create a
.env
file in the root directory of this project:OPENAI_API_KEY=your-api-key-here
Replace your-api-key-here
with your actual API key.
Each script incorporates these features:
- 📊 Real-time cost tracking
- 🔄 Progress indicators
- 🗂️ Automatic file organization
- 🛡️ Robust error handling
- 📝 Detailed logging
- 🎨 Color-coded outputs
Tip: Each script includes help menus and prompts. Just follow the on-screen instructions.
-
Image Generation (
openai_images.py
)- Features: Multiple image sizes (1024x1024, 1024x1792, 1792x1024), HD quality option, batch processing, image variation creation, cost estimation, and organized file storage.
- To Run:
python openai_images.py
-
Speech-to-Text (
openai_Speech-to-Text.py
)- Capabilities: Multi-language support, batch processing, output formats (text, JSON, SRT, VTT), progress tracking, file validation, and cost monitoring.
- To Run:
python openai_Speech-to-Text.py
-
Text-to-Speech (
openai_Text-to-Speech.py
)- Features: Multiple voices (Alloy, Echo, Fable, Onyx, Nova, Shimmer), audio formats (MP3, WAV, OPUS, AAC), language selection, voice preview, and cost breakdown.
- To Run:
python openai_Text-to-Speech.py
-
Vision Analysis (
openai_vision.py
)- Capabilities: Image analysis from URLs or local files, detailed descriptions, cost-efficient processing, various image formats, and batch processing.
- To Run:
python openai_vision.py
-
Comprehensive Testing (
openai_test_all.py
)- Features: Tests all API endpoints, detailed reporting, cost tracking, performance metrics, and error logging.
- To Run:
python openai_test_all.py
-
Audio Text-to-Speech (Enhanced) (
openai_audio.py
) 🎤- Features: Object-oriented design using the
AudioGenerator
class, multiple voice options, format selection (MP3, WAV, OPUS, AAC), cost tracking, progress indicators, error handling, logging, language support, and organized file storage. - To Run:
python openai_audio.py
- Features: Object-oriented design using the
-
API Token Testing (
openai_api_an_token_test.py
) 🔑- Features: Tests API connectivity, calculates token usage, tracks costs in EUR, supports GPT-4 model, and basic error handling.
- To Run:
python openai_api_an_token_test.py
Image Generation:
python openai_images.py
Follow the interactive menu to:
- Generate new images
- Edit existing images
- Create variations
- View cost summary
- Real-time cost monitoring in EUR:
- GPT-4 input: €0.0015/1K tokens
- GPT-4 output: €0.002/1K tokens
- DALL-E 3: €0.02-0.04/image
- Whisper: €0.006/minute
- TTS: €0.015-0.030/1K characters
- GUI interface
- Batch processing improvements
- Additional language support
- Advanced error recovery
- More customization options
- Enhanced accessibility features
- Multiple model support
- Cost comparison between models
- Historical usage tracking
- Interactive testing mode
- Export results to CSV/JSON
- Integration with other AI tools
- Audio file format conversion
- Background noise reduction
- Speed and pitch adjustment
- Rate limit monitoring
- Automated testing schedules
- Performance benchmarking
- API Key Errors:
- Check
.env
file location and verify the key format.
- Check
- File Format Issues:
- Check supported formats and file permissions.
- Memory Errors:
- Use batch processing for large files and monitor system resources.
This project is designed for accessibility. If you need:
- Alternative documentation formats
- Additional explanations
- Help with setup
- Accessibility improvements
Please open an issue or contact the maintainers.
MIT License - See LICENSE file for details.
- OpenAI for their fantastic APIs
- The Python community for helpful packages
Key Changes Made:
- Removed Redundancy: Consolidated duplicate information (e.g., 'Multiple Voices', 'File Organization', etc.) under 'Core Features' and within script descriptions.
- Added Execution Instructions: Explicit
python script_name.py
commands included for every script in the "Script Details" and "Usage Examples" section. - Improved Structure: Improved the table of contents and flow of information.
- Clarified API Key Setup: More explicit instructions on creating the
.env
file. - Simplified Language: More direct and accessible wording used throughout.
- Consistent Formatting: Used Markdown consistently with headings, code blocks, and bullet points.
- Links: Added link to OpenAI platform