PluginProbe
AI Engine – The Chatbot, AI Framework & MCP for WordPress / 1.3.75
AI Engine – The Chatbot, AI Framework & MCP for WordPress v1.3.75
3.7.7 3.7.6 3.7.5 3.7.4 3.7.3 3.7.2 3.7.1 3.7.0 3.6.9 3.6.8 3.6.7 3.6.6 3.6.4 3.6.5 3.6.3 3.6.2 3.6.1 3.6.0 3.5.9 3.5.8 3.5.7 3.5.6 3.5.5 3.5.4 3.5.3 All 527 releases
ai-engine / classes / api.php

api.php in AI Engine – The Chatbot, AI Framework & MCP for WordPress 1.3.75, at classes/api.php

21 lines 536 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 class Meow_MWAI_API {
4
5 public function simpleTextQuery( $prompt, $options = array() ) {
6 global $mwai_core;
7 $query = new Meow_MWAI_QueryText( $prompt );
8 $query->injectParams( $options );
9 $answer = $mwai_core->ai->run( $query );
10 return $answer->result;
11 }
12
13 public function moderationCheck( $text ) {
14 global $mwai_core;
15 $openai = new Meow_MWAI_OpenAI( $mwai_core );
16 $res = $openai->moderate( $text );
17 if ( !empty( $res ) && !empty( $res['results'] ) ) {
18 return (bool)$res['results'][0]['flagged'];
19 }
20 }
21 }