[021] ChatGPT Framework

xF2 Add-on [021] ChatGPT Framework 1.6.0

No permission to download

ENXF NET

Administrator
Staff member
Administrator
Moderator
+Lifetime VIP+
S.V.I.P.S Member
S.V.I.P Member
V.I.P Member
Collaborate
Registered
Joined
Nov 13, 2018
Messages
24,710
Points
823

Reputation:

ENXF NET 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
PHP:
use...

Read more about this resource...
 

jim

Well-known member
Registered
Joined
Aug 20, 2021
Messages
126
Points
38

Reputation:

@ENXF NET

Update 1.1.0

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 transformed into his messages
    int $startPosition = null, // Thread post position from which to load the context
    bool $removeQuotesFromAssistantMessages = true // Removes user post quotes from bot posts
)

wrapMessage – Generates a message array, preparing content for the bot (removes unnecessary BB codes).
PHP:
public function wrapMessage(string $content, string $role = 'user'): array
   
/*
returns [
    'content' => $preparedContent,
    'role' => $role
]
*/
prepareContent – Prepare message content for the bot (removes unnecessary BB codes).
getQuotes – Parses quotes from the text, bringing it to a convenient form.

PHP:
public function getQuotes(
    string $text,
    int $userId = null, // filter quotes by user id
    int $postId = null, // filter quotes by post id
    string $postType = 'post' // post type in quotes
): array
/*
returns [
    [
        'post_id' => int|null,
        'user_id' => int|null,
        'content' => string|null, (quote content)
        'message' => string|null, (reply on quote, text which located below quote)
        'match'   => string (full quote match)
    ]
]
*/

removeQuotes – Remove quotes from the text. Can be remove quotes for specific posts or users.


PHP:
public function removeQuotes(
    string $text,
    int $userId = null,
    int $postId = null,
    string $postType = 'post'
): string
 
Last edited by a moderator:

UNKNOWN PH

RUSH ARMY
+Lifetime VIP+
Registered
Joined
Jun 9, 2019
Messages
648
Points
73

Reputation:

@ENXF NET

Update 1.1.0

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 transformed into his messages
    int $startPosition = null, // Thread post position from which to load the context
    bool $removeQuotesFromAssistantMessages = true // Removes user post quotes from bot posts
)

wrapMessage – Generates a message array, preparing content for the bot (removes unnecessary BB codes).
PHP:
public function wrapMessage(string $content, string $role = 'user'): array
    
/*
returns [
    'content' => $preparedContent,
    'role' => $role
]
*/
prepareContent – Prepare message content for the bot (removes unnecessary BB codes).
getQuotes – Parses quotes from the text, bringing it to a convenient form.

PHP:
public function getQuotes(
    string $text,
    int $userId = null, // filter quotes by user id
    int $postId = null, // filter quotes by post id
    string $postType = 'post' // post type in quotes
): array
/*
returns [
    [
        'post_id' => int|null,
        'user_id' => int|null,
        'content' => string|null, (quote content)
        'message' => string|null, (reply on quote, text which located below quote)
        'match'   => string (full quote match)
    ]
]
*/

removeQuotes – Remove quotes from the text. Can be remove quotes for specific posts or users.


PHP:
public function removeQuotes(
    string $text,
    int $userId = null,
    int $postId = null,
    string $postType = 'post'
): string
jimany guide how this addons works?
 
View previous replies…

ENXF NET

Administrator
Staff member
Administrator
Moderator
+Lifetime VIP+
S.V.I.P.S Member
S.V.I.P Member
V.I.P Member
Collaborate
Registered
Joined
Nov 13, 2018
Messages
24,710
Points
823

Reputation:

ENXF NET 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 message quote...

Read the rest of this update entry...
 

ENXF NET

Administrator
Staff member
Administrator
Moderator
+Lifetime VIP+
S.V.I.P.S Member
S.V.I.P Member
V.I.P Member
Collaborate
Registered
Joined
Nov 13, 2018
Messages
24,710
Points
823

Reputation:

ENXF NET 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,
    'frequency_penalty' => 0...

Read the rest of this update entry...
 

BattleKing

Spirit of darkness
Staff member
Administrator
Moderator
+Lifetime VIP+
S.V.I.P Member
Collaborate
Registered
Joined
May 24, 2020
Messages
3,529
Points
523

Reputation:

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

proxybunker

Member
Registered
Joined
Aug 5, 2021
Messages
23
Points
13

Reputation:

any know why im always getting this I have added the API
and installed the ChatGPT Reply Assistant

all I keep getting is
Sorry I couldn't contact the ChatGPT think tank

any help

using xenforo 2.2.12
 

thomsa

Moderator
Staff member
Moderator
S.V.I.P Member
Collaborate
Registered
Joined
Jun 22, 2019
Messages
1,160
Points
173

Reputation:

any know why im always getting this I have added the API
and installed the ChatGPT Reply Assistant

all I keep getting is
Sorry I couldn't contact the ChatGPT think tank

any help

using xenforo 2.2.12
proxybunkersame time ChatGPT can not response because high traffic.
 
View previous replies…

Zer01ne

Collaborate
Collaborate
Registered
Joined
Nov 25, 2022
Messages
720
Points
253

Reputation:

same time ChatGPT can not response because high traffic.
thomsaThe author said - There is currently a known bug in the add-on where the bot may not respond to messages or respond with "Sorry I couldn't contact the ChatGPT think tank".

This can happen when too much context is loaded into the bot, so try to limit the number of posts in topics where the bot can reply. This issue should be fixed on 1.2.0 update.

I think this is not an issue ChatGPT high traffic.
 

thomsa

Moderator
Staff member
Moderator
S.V.I.P Member
Collaborate
Registered
Joined
Jun 22, 2019
Messages
1,160
Points
173

Reputation:

The author said - There is currently a known bug in the add-on where the bot may not respond to messages or respond with "Sorry I couldn't contact the ChatGPT think tank".

This can happen when too much context is loaded into the bot, so try to limit the number of posts in topics where the bot can reply. This issue should be fixed on 1.2.0 update.

I think this is not an issue ChatGPT high traffic.
Zer01neif bug fix on 1.2.0 why it error on 1.3.1

ithink it an ChatGPT high traffic.

2023-04-07_19-15-25.png
 
Top