Developer usage guide
Get the OpenAI API key
PHP:
Kod:
$apiKey = \XF::options()->bsChatGptApiKey;
PHP:
Kod:
/** \Orhanerday\OpenAi\OpenAi $api */
$api = \XF::app()->container('chatGPT');
PHP:
Kod:
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,
])
);
İşte bunu gösteriyor, ne yapabilirim? Bunları nereye ve nasıl eklemeliyim?
Eklentiyi kurdum ancak bunlar nereye eklemem konusunda bir fikrim yok.
Hakkında konum: Nasıl yapılır ? - Xenforo ve ChatGPT entegresi