ChatGPT Framework

ChatGPT Framework 1.6.0

Upgrade No permission to download
Premium
Developer
Jun 11, 2020
544
436
63
021 submitted a new resource:

[021] ChatGPT Bots - Bot framework for ChatGPT API.

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...

Read more about this resource...
 
Premium
Developer
Jun 11, 2020
544
436
63
021 updated [021] ChatGPT Bots with a new update entry:

1.1.0

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...

Read the rest of this update entry...
 
Premium
Developer
Jun 11, 2020
544
436
63
021 updated [021] ChatGPT Bots with a new update entry:

1.2.0

\BS\ChatGPTBots\Response class features

getReplyWithLogErrors(OpenAi $api, array $params): string – Receives a response and parse it to reply from the OpenAI API, logging the failure and adding the necessary information to the log.

Usage example
PHP:
$reply = Response::getReplyWithLogErrors($api, [
    'model'             => 'gpt-3.5-turbo',
    'messages'          => [],
    'temperature'       => 1.0...

Read the rest of this update entry...
 
  • Like
Reactions: ProWeb
Premium
Developer
Jun 11, 2020
544
436
63
021 updated [021] ChatGPT Framework with a new update entry:

1.3.0

The group of settings has been renamed in accordance with the name of the add-on
New method removeMessageDuplicates in message repo
New method fetchMessagesFromConversation in message repo
Now \BS\ChatGPTBots\Response::getReplyWithLogErrors accept $throwExceptions argument to throw exceptions on error instead of returning default reply
Now the prepareContent method in message also converts mentions into hits

Read the rest of this update entry...
 
Last edited:
  • Like
Reactions: Rhody401
Apr 5, 2023
1
0
1

Initialize the OpenAI API​

The ChatGPT API Framework provides a convenient way to initialize the OpenAI API. To get started, you can use the following code:



PHP:

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


I have the API key. Where exactly would I run that PHP code from, or where does the code get inserted? I'm already lost.
 
Premium
Developer
Jun 11, 2020
544
436
63
I have the API key. Where exactly would I run that PHP code from, or where does the code get inserted? I'm already lost.
Hello,

This is a guide for developers.
You just need to follow the steps from the "Setup" section in the description :)

Regards,
021
 
Mar 12, 2023
2
0
1
So I have ChatGBT Framework 1.51 and ChatGBT Reply assistant 1.1.1 on two of my Xenforo platforms. All was working fine, then I performed a migration to a new server and now when I click on "ChatGBT Reply" I get

"Sorry I couldn't contact the ChatGPT think tank :("

errors on both sites. Is there something that I need to do to fix? API issue perhaps?
 
Premium
Developer
Jun 11, 2020
544
436
63
So I have ChatGBT Framework 1.51 and ChatGBT Reply assistant 1.1.1 on two of my Xenforo platforms. All was working fine, then I performed a migration to a new server and now when I click on "ChatGBT Reply" I get

"Sorry I couldn't contact the ChatGPT think tank :("

errors on both sites. Is there something that I need to do to fix? API issue perhaps?
Hello,

Please, could you provide the domains of the forums on which you use the add-on?

Regards,
021
 
Oct 10, 2020
9
0
1
So I have ChatGBT Framework 1.51 and ChatGBT Reply assistant 1.1.1 on two of my Xenforo platforms. All was working fine, then I performed a migration to a new server and now when I click on "ChatGBT Reply" I get

"Sorry I couldn't contact the ChatGPT think tank :("

errors on both sites. Is there something that I need to do to fix? API issue perhaps?
I have same issue - nzwarriors.com
 
Oct 30, 2022
4
2
3
Where can I see the settings for creating functions using "function calling"?
I asked this question to ChatGPT 4.0, and it responded that I need to modify the addon.json file as follows:

{
"legacy_addon_id": "",
"title": "[021] ChatGPT Framework",
"description": "Framework for ChatGPT API.",
"version_id": 1060070,
"version_string": "1.6.0",
"dev": "021",
"dev_url": "https://devsell.io/",
"faq_url": "",
"support_url": "https://devsell.io/threads/021-chatgpt-bots.66/",
"extra_urls": [],
"require": [],
"icon": "icon.png",
"composer_autoload": "vendor/composer",
"options": {
"function_calling_enabled": true
},
"callback": {
"class": "YourAddon\\Callback\\OpenAiHandler",
"method": "handleRequest"
}
}
 
Last edited:
  • Like
Reactions: ViperCorp