• You MUST read the Babiato Rules before making your first post otherwise you may get permanent warning points or a permanent Ban.

    Our resources on Babiato Forum are CLEAN and SAFE. So you can use them for development and testing purposes. If your are on Windows and have an antivirus that alerts you about a possible infection: Know it's a false positive because all scripts are double checked by our experts. We advise you to add Babiato to trusted sites/sources or disable your antivirus momentarily while downloading a resource. "Enjoy your presence on Babiato"

Resource icon

[021] ChatGPT Framework v1.50

No permission to download
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,
    ])
);
Options.png
Author
GhostKiller
Downloads
82
Views
1,082
First release
Last update
Rating
0.00 star(s) 0 ratings

Latest updates

  1. v1.5.0 (Thanks @ubaid)

    Message repo: Ability to fetch comments from profile post tks @ubaid
  2. v1.4.0

    Stream replies support (Will be updated in dev guide later)
  3. The add-on has been renamed to [021] ChatGPT Framework.

    \BS\ChatGPTBots\Response class features getReplyWithLogErrors(OpenAi $api, array $params)...
AdBlock Detected

We get it, advertisements are annoying!

However in order to keep our huge array of resources free of charge we need to generate income from ads so to use the site you will need to turn off your adblocker.

If you'd like to have an ad free experience you can become a Babiato Lover by donating as little as $5 per month. Click on the Donate menu tab for more info.

I've Disabled AdBlock