[021] ChatGPT Bots

[021] ChatGPT Bots 1.1.0

No permission to download
jessy Master Sergeant
Staff member
Moderating
badge id 1 1 Year of Membership badge id 13 100 Messages badge id 2 2 Years of Membership badge id 14 500 Messages
Jun 28, 2020
2,917
1,228
$5,838
thanks to dear member @jessy submitted a new resource:

[021] ChatGPT Bots - This add-on provides helper functions for working with ChatGPT.

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 dependencie
Get OpenAI API
PHP:
$apiKey = \XF::options()->bsChatGptApiKey;
Get reply from ChatGPT
PHP:
use BS\ChatGPTBots\Response;

/** \Orhanerday\OpenAi\OpenAi $api */
$api = \XF::app()->container('chatGPT');

$messages = [
    ['role' => 'user', 'content' => 'Hello!']
];
$reply =...

Read more about this resource...
 
thanks to dear member @jessy updated [021] ChatGPT Bots with a new update entry:

changelog

Message repository

fetchMessagesFromThread – Loads the context for the bot from the topic. Bot quotes are transformed into his messages for the correct context.

PHP:
public function fetchMessagesFromThread(
Thread $thread,
int $stopPosition = null, // Thread post position to which to load the context
?User $assistant = null, // Bot user to mark his messages in context
bool $transformAssistantQuotesToMessages = true, // If false, bot message quote messages will not be...

Read the rest of this update entry...
 
Back
Top