ai-engine
Last commit date
app
2 years ago
classes
2 years ago
common
2 years ago
constants
2 years ago
images
3 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
48 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.2.90 |
| 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.2.90' ); |
| 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-3.5-turbo' ); |
| 25 | define( 'MWAI_FALLBACK_MODEL_VISION', 'gpt-4-vision-preview' ); |
| 26 | define( 'MWAI_FALLBACK_MODEL_JSON', 'gpt-4-1106-preview' ); |
| 27 | |
| 28 | require_once( MWAI_PATH . '/classes/init.php' ); |
| 29 | |
| 30 | // NOTE: This should be removed when GPT-4 is released to everyone. |
| 31 | add_filter( 'mwai_ai_exception', function ( $exception ) { |
| 32 | try { |
| 33 | if ( substr( $exception, 0, 56 ) === "Error model_not_found: The model: `gpt-4` does not exist" ) { |
| 34 | return "The GPT-4 model is currently not available for your OpenAI account. Luckily, you can join the <a target='_blank' href='https://openai.com/waitlist/gpt-4-api'>waitlist</a> to get access to it! ✌️"; |
| 35 | } |
| 36 | else if ( substr( $exception, 0, 60 ) === "Error model_not_found: The model: `gpt-4-32k` does not exist" ) { |
| 37 | return "The GPT-4 32k model is currently not available for your OpenAI account. Luckily, you can join the <a target='_blank' href='https://openai.com/waitlist/gpt-4-api'>waitlist</a> to get access to it! ✌️"; |
| 38 | } |
| 39 | return $exception; |
| 40 | } |
| 41 | catch ( Exception $e ) { |
| 42 | error_log( $e->getMessage() ); |
| 43 | } |
| 44 | return $exception; |
| 45 | } ); |
| 46 | |
| 47 | ?> |
| 48 |