Hi,
What is the exact error? Can you check your PHP Error Logs?
Thread Starter
phil69
(@phil69)
Mon site est complètement planté. heureusement un site de test !
Voici ce qu’il affiche:
core = $core; add_shortcode( ‘mwai_chat’, array( $this, ‘chat’ ) ); add_action( ‘rest_api_init’, array( $this, ‘rest_api_init’ ) ); } function rest_api_init() { try { register_rest_route( $this->namespace, ‘/chat’, array( ‘methods’ => ‘POST’, ‘callback’ => array( $this, ‘rest_chat’ ), ‘permission_callback’ => ‘__return_true’ ) ); } catch ( Exception $e ) { var_dump( $e ); } } function rest_chat( $request ) { try { $params = $request->get_json_params(); $prompt = $params[‘prompt’]; $model = $params[‘model’]; $temperature = $params[‘temperature’]; $query = new Meow_MWAI_Query( $prompt, 1024 ); if ( $model ) { $query->setModel( $model ); } if ( $temperature ) { $query->setTemperature( $temperature ); } $answer = $this->core->ai->run( $query ); return new WP_REST_Response([ ‘success’ => true, ‘data’ => $answer->result, ‘usage’ => $answer->usage ], 200 ); } catch ( Exception $e ) { return new WP_REST_Response([ ‘success’ => false, ‘message’ => $e->getMessage() ], 500 ); } } function chat( $atts ) { $atts = shortcode_atts([ ‘context’ => “Converse as if you were Michael Jackson, talking from the afterlife. Be friendly, creative.”, ‘ai_prompt’ => “Michael: “, ‘user_prompt’ => “You: “, ‘sys_prompt’ => “System: “, ‘start_sentence’ => “Hi, my friend.”, ‘model’ => ‘text-davinci-003’, ‘temperature’ => 0.8 ], $atts, ‘meow_ai’ ); $id = uniqid(); $apiUrl = get_rest_url( null, ‘ai-engine/v1/chat’ ); $onSentClickFn = “mwai_{$id}_onSendClick”; $addReplyFn = “mwai_{$id}_addReply”; $convertToHtmlFn = “mwai_{$id}_convertToHtml”; ob_start(); ?>Send
Une erreur critique est survenue sur ce site. Veuillez consulter la boite de réception de l’e-mail d’administration de votre site pour plus d’informations.
En apprendre plus sur le débogage de WordPress.
Oh, I know exactly why! That’s because some servers don’t understand when there is only “<?” at the beginning of a PHP file, they absolutely require “<?php”.
I will release a new version right away.
Thread Starter
phil69
(@phil69)
nouvelle installation et nouvelle erreur:
Une erreur critique est survenue sur ce site. Veuillez consulter la boite de réception de l’e-mail d’administration de votre site pour plus d’informations.
En apprendre plus sur le débogage de WordPress.
Sorry about this, absolutely use the version 0.0.6 from now. I just released it a few seconds ago, so before clicking install, make sure it’s really written 0.0.6. And it should be fine 🙂
Thread Starter
phil69
(@phil69)
C’est bon l’installation est ok.
je vais pouvoir tester.
Merci et bonne continuation
Super! No problem 🙂 Let me know how it goes! I will try to make this as useful as possible.
N’hésitez surtout pas à me dire ce que en pensez. Je ferai évoluer le plugin selon les besoins. Amusez-vous bien ! 🙂
