ChatGPT-Entwurf

ChatGPT-Entwurf 2.2.0

Registrieren Sie sich oder melden Sie sich an für kostenlosen Download
XF-Kompatibilität
  1. 2.2.x

Options.webp

Dieses Add-On bietet Hilfsfunktionen für die Arbeit mit ChatGPT.

Es ermöglicht es, einen API-Schlüssel für Add-ONS zu setzen, die mit ChatGPT arbeiten und die Duplikate der Abhängigkeiten zu laden.

Entwicklernutzungsanleitung

Erhalte den OpenAI-API-Schlüssel
PHP:
$apiKey = \XF::options()->bsChatGptApiKey;
Kauf ichn OpenAI-API
PHP:
/** \Orhanerday\OpenAi\OpenAi $api */
$api = \XF::app()->container('chatGPT');
Ersparen Sie mir die Frage an 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,
 ])
);
NachrichtenrepositoryfetchMessagesFromThread – Liefert den Kontext für das Betriebssystem aus der Thematik. Die Nachrichten des Bots werden in seine eigenen Nachrichten umgewandelt, um den richtigen Kontext zu haben.
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 – Generiert eine Nachrichtenarray, bereitet Inhalte für das Bot vor (entfernt unnötige BB Codes).
PHP:
public function wrapMessage(string $content, string $role = 'user'): array
/*
returns [
    'content' => $preparedContent,
    'role' => $role
]
*/
bereitstellenInhalt– Nachrichteninhalt für das Bot bereitstellen (lösche unnötige BB Codes).
abfragenZitate– Text aus Quoten parsen, ihn in eine bequeme Form bringen.
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 – Entferne Anführungszeichen von dem Text. Kann für spezifische Posts oder Nutzer verwendet werden.
PHP:
public function removeQuotes(
string $text,
int $userId = null,
int $postId = null,
string $postType = 'post'
): string
Autor
axtona
Ansichten
560
Erweiterungstyp
zip
Dateigröße
2 MB
Erste Veröffentlichung
Letzte Aktualisierung
Bewertungen 0.00 Sterne 0 Bewertungen
Weitere Ressourcen von axtona
Sorcererprozoom
Sorcererprozoom
Platz PHP und alle Art von HTML, CSS und JavaScript-Code direkt in dein Inhalt!
Alle Video Share Pro
Alle Video Share Pro
Hier sind die Funktionen, die All Video Share zu dem stärksten und benutzerfreundlichsten Joomla macht.
Balbooa Forms Builder Pro
Balbooa Forms Builder Pro
Erstelle mit Balbooa Forms ansprechend gestaltete Kontaktformulare für Joomla.

Neueste Aktualisierungen

  1. change log

    Fix: Exception when creating alias for class \BS\ChatGPTFramework\Enums\JsonSchema\Type...
  2. changelog

    Fix: Backward compatibility
  3. changelog

    Support for function calling

Ähnliche Ressourcen

[021] ChatGPT Reply Assistant A
this add-on uses ChatGPT to generate replies to posts automatically
Ansichten
506
Aktualisiert
[021] Fools Day with ChatGPT A
This is an example of an article posted by a bot on the topic "Science" in a humorous style.
Ansichten
472
Aktualisiert
[BS] ChatGPT Autoresponder A
allows you to embed a ChatGPT-based bot in the forum that will reply to your users in certain sectio
Ansichten
305
Aktualisiert
Zurück
Oben