It allows you to set an API key for add-ons that work with ChatGPT and avoid loading duplicate dependencies.
Developer usage guide
Get the OpenAI API key
$apiKey = \XF::options()->bsChatGptApiKey;
/** \Orhanerday\OpenAi\OpenAi $api */
$api = \XF::app()->container('chatGPT');
use BS\ChatGPTBots\Response;
/** \Orhanerday\OpenAi\OpenAi $api */
$api = \XF::app()->container('chatGPT');
$messages = [
['role' => 'user', 'content' => 'Hello!']
];
$reply = Response::getReply(
$api->chat([
'model' => 'gpt-3.5-turbo',
'messages' => $messages,
'temperature' => 1.0,
'max_tokens' => 420,
'frequency_penalty' => 0,
'presence_penalty' => 0,
])
);