ai-engine
Last commit date
app
1 year ago
classes
1 year ago
common
1 year ago
constants
1 year ago
images
1 year ago
languages
3 years ago
themes
1 year ago
vendor
2 years ago
ai-engine.php
1 year ago
blueprint.json
2 years ago
readme.txt
1 year 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: Kick off your AI journey with a brilliant chatbot, then take advantage of AI-driven content, automation, and multi-model support. |
| 6 | Version: 2.7.4 |
| 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.7.4' ); |
| 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-mini' ); |
| 25 | define( 'MWAI_FALLBACK_MODEL_VISION', 'gpt-4o-mini' ); |
| 26 | define( 'MWAI_FALLBACK_MODEL_JSON', 'gpt-4o-mini' ); |
| 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 |