SleekAI 1.6 has arrived, bringing powerful new features focused on broader integration and developer flexibility! This release introduces automatic AI-powered Alt Text generation, a PHP function for direct AI interaction, new hooks for deeper customization, and support for the latest OpenAI models. Let's get into the details.
AI-Powered Alt Text Generation
Enhance your site's accessibility and SEO effortlessly with our new AI Alt Text generation feature. SleekAI can now automatically analyze images uploaded to your Media Library and generate descriptive Alt Text, Captions, and Descriptions.
Key features include:
- Automatic Generation: Enable the feature to process new uploads automatically.
- Selective Output: Choose whether to populate Alt Text, Caption, Description fields, or any combination.
- Bulk Processing: Select existing images in the Media Library table view and generate descriptions for them in bulk.
- Model Selection: Choose the vision-capable AI model that best suits your needs (depending on your configured API keys).
This feature saves significant time and ensures your images are properly described for users and search engines.
Learn more about Alt Text Generation
PHP Function for Direct AI Interaction
For developers needing programmatic access to AI models, we've introduced the
sleekAi_generate_response
function. This allows you to directly call
configured language models from your PHP code, abstracting away the complexities
of individual provider APIs.
Simply provide the model ID (prefixed with the provider, e.g., openai_gpt-4o
)
and a standard message array.
$response = sleekAi_generate_response([ 'model' => 'openai_gpt-4o', // Or 'anthropic_claude-3-opus-20240229', etc. 'messages' => [ ['role' => 'system', 'content' => 'You are a helpful assistant.'], ['role' => 'user', 'content' => 'Summarize the main benefits of AI Alt Text.'], ], ]); if (isset($response['response']['message'])) { $summary = $response['response']['message']; // Use the summary... } else { // Handle error... error_log('SleekAI API Error: ' . print_r($response, true)); }
Copy
This function standardizes interaction across different providers like OpenAI and Anthropic, allowing you to switch models easily without changing your core logic.
New PHP Hooks for Settings Customization
Gain finer control over SleekAI's configuration with two new PHP filters:
sleekAi/settings
: Modify the global plugin settings before they are applied. Useful for enforcing specific configurations site-wide or integrating with other systems.sleekAi/settings/user
: Adjust settings specifically for the current user. Ideal for tailoring the AI experience based on user roles or preferences.
Here's a minimal example for the user settings hook:
add_filter('sleekAi/settings/user', function ($settings) { // Example: Force disable streaming for all users $settings['streaming'] = false; return $settings; });
Copy
Other Enhancements and Fixes
This release also includes:
- OpenAI o4 Model Support: Added OpenAI's latest 'o4' model to the available options.
- Model Filtering: Incompatible models are now filtered out from the plugin generation model dropdown for clarity.
- Logging Fix: Resolved issues where chatbot logging wasn't saving correctly in some cases.
That wraps up the highlights for SleekAI 1.6! We're excited to see how you leverage these new tools to enhance your WordPress sites and development workflows. As always, your feedback is invaluable, so please reach out with any questions or suggestions. Happy building! 🚀