ChatGPT Marco

ChatGPT Marco 2.2.0

No tiene permiso para descargar
Compatibilidad con XF
  1. 2.2.x
Descripción breve
Enhance your ChatGPT experience with this add-on, offering helper functions and setting an API key for seamless integration. Fetch messages from threads, prepare bot content, and remove quotes efficiently.

Options.webp

Este add-on proporciona funciones auxiliares para trabajar con ChatGPT.

Permite que establezcas una clave de API para los add-ons que trabajan con ChatGPT y evitar la carga de dependencias duplicadas.

Guía de uso para desarrolladores

Obtén la clave de API de OpenAI
PHP:
$apiKey = \XF::options()->bsChatGptApiKey;
Obtener API de OpenAI
PHP:
/** \Orhanerday\OpenAi\OpenAi $api */
$api = \XF::app()->container('chatGPT');
Obtén respuesta de 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,
 ])
);
Mensaje repositoriofetchMessagesFromThread – Carga el contexto del bot desde la temática. Los citaciones del bot se transforman en sus mensajes para un contexto adecuado.
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 – Genera un array de mensaje, preparando contenido para el bot (elimina los BB codes innecesarios).
PHP:
public function wrapMessage(string $content, string $role = 'user'): array
/*
returns [
    'content' => $preparedContent,
    'role' => $role
]
*/
prepareContent – Prepara el contenido del mensaje para el bot (elimina los códigos BB innecesarios).
getQuotes – Parsea las citas del texto, poniéndolo en un formato conveniente.
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 – Quita comillas del texto. Puede quitar las comillas para post específicos o usuarios.
PHP:
public function removeQuotes(
string $text,
int $userId = null,
int $postId = null,
string $postType = 'post'
): string
Autor
axtona
Vistas
522
Tipo de extensión
zip
Tamaño de archivo
2 MB
Primer lanzamiento
Última actualización
Valoraciones 0,00 estrella(s) 0 valoraciones
¿Enlace roto? Enviar mensaje al equipo NP y te ayudaremos rápidamente!
Apoia al desarrollador i estás satisfecho con la prueba o tu proyecto te ha generado ganancias, haz clic en el botón «Más información» para apoyar al desarrollador comprando.

Últimas actualizaciones

  1. 2.2.0 - change log
    Fix: Exception when creating alias for class \BS\ChatGPTFramework\Enums\JsonSchema\Type...
  2. 2.1.1 - changelog
    Fix: Backward compatibility
  3. 1.6.0 - changelog
    Support for function calling

Más recursos de axtona

[ITD] Ocultar Avatar (Lite) A
un añadido sencillo pero poderoso diseñado para administradores de foros
DEBtech Portal AI Suite Pro A
Portal AI Suite transforma tu foro XenForo en una portada moderna.
Suite de Anuncios Pro A
El sistema de publicidad y monetización para XenForo 2.3

Recursos similares

[021] ChatGPT Reply Assistant A
this add-on uses ChatGPT to generate replies to posts automatically
[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.
[BS] ChatGPT Autoresponder A
allows you to embed a ChatGPT-based bot in the forum that will reply to your users in certain sectio
Superior