You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
81 lines
1.5 KiB
81 lines
1.5 KiB
<?php
|
|
/* For license terms, see /license.txt */
|
|
|
|
/**
|
|
* Description of AiHelperPlugin.
|
|
*
|
|
* @author Christian Beeznest <christian.fasanando@beeznest.com>
|
|
*/
|
|
class AiHelperPlugin extends Plugin
|
|
{
|
|
public const OPENAI_API = 'openai';
|
|
|
|
protected function __construct()
|
|
{
|
|
$version = '1.0';
|
|
$author = 'Christian Fasanando';
|
|
|
|
$message = 'Description';
|
|
|
|
$settings = [
|
|
$message => 'html',
|
|
'tool_enable' => 'boolean',
|
|
'api_name' => [
|
|
'type' => 'select',
|
|
'options' => $this->getApiList(),
|
|
],
|
|
'api_key' => 'text',
|
|
'organization_id' => 'text',
|
|
];
|
|
|
|
parent::__construct($version, $author, $settings);
|
|
}
|
|
|
|
/**
|
|
* Get the list of apis availables.
|
|
*
|
|
* @return array
|
|
*/
|
|
public function getApiList()
|
|
{
|
|
$list = [
|
|
self::OPENAI_API => 'OpenAI',
|
|
];
|
|
|
|
return $list;
|
|
}
|
|
|
|
/**
|
|
* Get the plugin directory name.
|
|
*/
|
|
public function get_name(): string
|
|
{
|
|
return 'ai_helper';
|
|
}
|
|
|
|
/**
|
|
* Get the class instance.
|
|
*
|
|
* @staticvar AiHelperPlugin $result
|
|
*/
|
|
public static function create(): AiHelperPlugin
|
|
{
|
|
static $result = null;
|
|
|
|
return $result ?: $result = new self();
|
|
}
|
|
|
|
/**
|
|
* Install the plugin. Set the database up.
|
|
*/
|
|
public function install()
|
|
{
|
|
}
|
|
|
|
/**
|
|
* Unistall plugin. Clear the database.
|
|
*/
|
|
public function uninstall()
|
|
{
|
|
}
|
|
}
|
|
|