ai-engine
Last commit date
app
2 years ago
classes
2 years ago
common
2 years ago
constants
2 years ago
images
2 years ago
languages
3 years ago
themes
2 years ago
vendor
2 years ago
ai-engine.php
2 years ago
blueprint.json
2 years ago
readme.txt
2 years ago
uninstall.php
2 years ago
ai-engine.php
46 lines
| 1 | <?php |
| 2 | /* |
| 3 | Plugin Name: AI Engine |
| 4 | Plugin URI: https://wordpress.org/plugins/ai-engine/ |
| 5 | Description: AI for WordPress. Chatbot, Content/Image Generator, CoPilot, Finetuning, Internal API, GPT, Gemini, etc! Sleek UI and ultra-customizable. |
| 6 | Version: 2.4.3 |
| 7 | Author: Jordy Meow |
| 8 | Author URI: https://jordymeow.com |
| 9 | Text Domain: ai-engine |
| 10 | |
| 11 | Dual licensed under the MIT and GPL licenses: |
| 12 | http://www.opensource.org/licenses/mit-license.php |
| 13 | http://www.gnu.org/licenses/gpl.html |
| 14 | */ |
| 15 | |
| 16 | define( 'MWAI_VERSION', '2.4.3' ); |
| 17 | define( 'MWAI_PREFIX', 'mwai' ); |
| 18 | define( 'MWAI_DOMAIN', 'ai-engine' ); |
| 19 | define( 'MWAI_ENTRY', __FILE__ ); |
| 20 | define( 'MWAI_PATH', dirname( __FILE__ ) ); |
| 21 | define( 'MWAI_URL', plugin_dir_url( __FILE__ ) ); |
| 22 | define( 'MWAI_ITEM_ID', 17631833 ); |
| 23 | define( 'MWAI_TIMEOUT', 60 * 5 ); |
| 24 | define( 'MWAI_FALLBACK_MODEL', 'gpt-4o' ); |
| 25 | define( 'MWAI_FALLBACK_MODEL_VISION', 'gpt-4o' ); |
| 26 | define( 'MWAI_FALLBACK_MODEL_JSON', 'gpt-4o' ); |
| 27 | |
| 28 | require_once( MWAI_PATH . '/classes/init.php' ); |
| 29 | |
| 30 | add_filter( 'mwai_ai_exception', function ( $exception ) { |
| 31 | try { |
| 32 | if ( strpos( $exception, "OpenAI" ) !== false ) { |
| 33 | if ( strpos( $exception, "API URL was not found" ) !== false ) { |
| 34 | return "Received the 'API URL was not found' error from OpenAI. This actually means that your OpenAI account has not been enabled for the Chat API. You need to either add some credits to OpenAI account, or link a credit card to it."; |
| 35 | } |
| 36 | } |
| 37 | return $exception; |
| 38 | } |
| 39 | catch ( Exception $e ) { |
| 40 | error_log( $e->getMessage() ); |
| 41 | } |
| 42 | return $exception; |
| 43 | } ); |
| 44 | |
| 45 | ?> |
| 46 |