ai-engine
Last commit date
app
3 years ago
classes
3 years ago
common
3 years ago
constants
3 years ago
images
3 years ago
languages
3 years ago
themes
3 years ago
vendor
3 years ago
ai-engine.php
3 years ago
readme.txt
3 years ago
ai-engine.php
44 lines
| 1 | <?php |
| 2 | /* |
| 3 | Plugin Name: AI Engine: ChatGPT Chatbot, Content Generator, GPT 3 & 4, Ultra-Customizable |
| 4 | Plugin URI: https://wordpress.org/plugins/ai-engine/ |
| 5 | Description: GPT for WordPress! Chatbot (ChatGPT), content and images generator, copilot, model training and much more! Highly customizable, sleek UI. You will love it! |
| 6 | Version: 1.6.96 |
| 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', '1.6.96' ); |
| 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_TIMEOUT', 60 * 5 ); |
| 23 | |
| 24 | require_once( MWAI_PATH . '/classes/init.php' ); |
| 25 | |
| 26 | // NOTE: This should be removed when GPT-4 is released to everyone. |
| 27 | add_filter( 'mwai_ai_exception', function ( $exception ) { |
| 28 | try { |
| 29 | if ( substr( $exception, 0, 60 ) === "Error while calling OpenAI: The model `gpt-4` does not exist" ) { |
| 30 | 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! ✌️"; |
| 31 | } |
| 32 | else if ( substr( $exception, 0, 64 ) === "Error while calling OpenAI: The model `gpt-4-32K` does not exist" ) { |
| 33 | 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! ✌️"; |
| 34 | } |
| 35 | return $exception; |
| 36 | } |
| 37 | catch ( Exception $e ) { |
| 38 | error_log( $e->getMessage() ); |
| 39 | } |
| 40 | return $exception; |
| 41 | } ); |
| 42 | |
| 43 | ?> |
| 44 |