[*] добавил классы ML. промежуточная фиксация
This commit is contained in:
1 parent
43861e52ab
commit
059aebe4e2
10 files changed
+432
-232
No files matched your search
+7
-3
@@ -2,12 +2,13 @@
|
||||
|
||||
use Core\CoreException;
|
||||
use Core\ExternalServices\Telegram2;
|
||||
use Core\ExternalServices\ChatGPT;
|
||||
|
||||
require_once __DIR__ . '/core/bootstrap.php';
|
||||
|
||||
$data = file_get_contents('php://input');
|
||||
if(empty($data)) {
|
||||
die('Данные не получены');
|
||||
//die('Данные не получены');
|
||||
}
|
||||
$data = json_decode($data, true);
|
||||
|
||||
@@ -15,7 +16,10 @@
|
||||
$tg = new Telegram2(TELEGRAM_BOT_TOKEN);
|
||||
$tg->setRemoteRequest($data);
|
||||
|
||||
$gptObject = new ChatGPT();
|
||||
|
||||
$response = $gptObject->ask($tg->getMessage())['choices'][0]['message']['content'];
|
||||
$response = htmlspecialchars($response);
|
||||
$tg->sendMessage($response);
|
||||
//$res = $tg->setChat(TELEGRAM_ADMIN_CHAT_ID)->updateMessage(121, '');
|
||||
|
||||
|
||||
//sendTelegram(print_r($data, true));
|
||||
Reference in new issue
Block a user