• All Passwords for this resource will be in "Updates" tab below.

    We only publish files for testing purpose. Consider buying licenses to support original developers.

[021] ChatGPT Bots
  • Author Author kashif
  • Creation date Creation date
Compatible XF 2.x versions
  • 2.0
  • 2.1
  • 2.2
Visible branding: No

This add-on provides helper functions for working with ChatGPT.
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
PHP:
$apiKey = \XF::options()->bsChatGptApiKey;
Get OpenAI API
PHP:
/** \Orhanerday\OpenAi\OpenAi $api */
$api = \XF::app()->container('chatGPT');
Get reply from ChatGPT
PHP:
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,
])
);
Author
kashif
Downloads
368
Views
476
First release
Last update

Ratings

0.00 star(s) 0 ratings

More resources from

Latest updates

  1. [021] ChatGPT Bots v1.2.0 Free

    \BS\ChatGPTBots\Response class features getReplyWithLogErrors(OpenAi $api, array $params)...
  2. [021] ChatGPT Bots v1.1.0 Free

    Message repository fetchMessagesFromThread – Loads the context for the bot from the topic. Bot...
Top