[021] ChatGPT Bots

[021] ChatGPT Bots 1.1.0

No permission to download
Joined
Jun 28, 2020
Messages
3,269
Reaction score
1,309
Credits
$6,879
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...
 
Top