{"id":357569,"date":"2024-05-20T23:53:38","date_gmt":"2024-05-20T23:53:38","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=357569"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2024-05-20T23:53:38","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=357569","title":{"rendered":"<span>\u0421\u0432\u043e\u0439 ChatGPT \u0431\u043e\u0442 \u0432 Telegram \u0432 2024<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0417\u043d\u0430\u043c\u0435\u043d\u0438\u0442\u044b\u0439 AI \u0447\u0430\u0442-\u0431\u043e\u0442 ChatGPT \u0437\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d \u0432 \u0420\u043e\u0441\u0441\u0438\u0438. \u041e\u0442\u043b\u0438\u0447\u043d\u044b\u043c \u0432\u044b\u0445\u043e\u0434\u043e\u043c \u0438\u0437 \u044d\u0442\u043e\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 \u0431\u044b\u043b\u0438 \u0438 \u0435\u0441\u0442\u044c Telegram-\u0431\u043e\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u043e\u0431\u0445\u043e\u0434\u0438\u0442\u044c \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0443, \u043d\u043e \u0438 \u0432 \u0446\u0435\u043b\u043e\u043c \u0434\u0435\u043b\u0430\u044e\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0431\u043e\u0442\u0430 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0431\u043e\u043b\u0435\u0435 \u0443\u0434\u043e\u0431\u043d\u044b\u043c \u043f\u0440\u044f\u043c\u043e \u0438\u0437 \u043c\u0435\u0441\u0441\u0435\u043d\u0434\u0436\u0435\u0440\u0430.<\/p>\n<p>\u042f \u0440\u0435\u0448\u0438\u043b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u0432\u043e\u044e \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044e ChatGPT \u0432 Telegram, \u0447\u0442\u043e\u0431\u044b \u043b\u0443\u0447\u0448\u0435 \u043f\u043e\u043d\u044f\u0442\u044c, \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 ChatGPT API, \u043a\u0430\u043a\u0438\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043c\u043d\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0431\u043e\u0442\u043e\u043c \u0431\u0435\u0437 \u0432\u0441\u044f\u043a\u0438\u0445 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0439, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0438\u043c\u0435\u0442\u044c \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u044b\u0439 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043c\u043e\u0434\u0435\u043b\u0438 GPT-4.<\/p>\n<p>\u041c\u043d\u0435 \u043d\u0435 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0434\u0435\u0440\u0436\u0430\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0435\u0440, \u043f\u043e\u043a\u0443\u043f\u0430\u0442\u044c \u0434\u043e\u043c\u0435\u043d \u0438 \u0434\u0435\u043b\u0430\u0442\u044c \u043f\u043e\u0434 \u043d\u0435\u0433\u043e SSL \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 Telegram \u0434\u043b\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 WebHook. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u0440\u0435\u0448\u0438\u043b \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0432\u0441\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e serverless-\u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0439.<\/p>\n<h2>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430<\/h2>\n<p>\u0414\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043c\u043d\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f:<\/p>\n<h3>API-\u043a\u043b\u044e\u0447 \u0434\u043b\u044f ChatGPT API<\/h3>\n<p>\u0414\u043e\u0441\u0442\u0443\u043f \u043a API, \u043a\u0430\u043a \u0438 \u043a \u0441\u0430\u043c\u043e\u043c\u0443 ChatGPT \u0437\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d \u0432 \u0420\u043e\u0441\u0441\u0438\u0438. \u041a \u0441\u0447\u0430\u0441\u0442\u044c\u044e, \u0435\u0441\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u044d\u0442\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b &#8212; <a href=\"https:\/\/proxyapi.ru\/m\/h2\" rel=\"noopener noreferrer nofollow\">ChatGPT API \u0432 \u0420\u043e\u0441\u0441\u0438\u0438<\/a> \u043e\u0442 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 ProxyAPI. \u041d\u0435 \u043d\u0443\u0436\u0435\u043d \u043d\u0438 \u0438\u043d\u043e\u0441\u0442\u0440\u0430\u043d\u043d\u044b\u0439 \u0442\u0435\u043b\u0435\u0444\u043e\u043d, \u043d\u0438 VPN, \u043d\u0438 \u043a\u0430\u0440\u0442\u0430 \u0438\u043d\u043e\u0441\u0442\u0440\u0430\u043d\u043d\u043e\u0433\u043e \u0431\u0430\u043d\u043a\u0430.\u00a0<\/p>\n<p>\u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u043c\u0441\u044f, \u0438\u0434\u0451\u043c \u0432 \u0440\u0430\u0437\u0434\u0435\u043b \u041a\u043b\u044e\u0447\u0438 API \u0438 \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u043a\u043b\u044e\u0447. \u041e\u0434\u043d\u0430 \u043c\u0438\u043d\u0443\u0442\u0430 \u0438 \u0433\u043e\u0442\u043e\u0432\u043e. \u041a\u0440\u0430\u0441\u043e\u0442\u0430!<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/b69\/dbd\/c71\/b69dbdc7135c1be7f4e6a64b043cd02b.png\" alt=\"\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u0435 \u043a\u043b\u044e\u0447 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f! \u0412 \u043f\u043e\u043b\u043d\u043e\u043c \u0432\u0438\u0434\u0435 \u0432\u044b \u0435\u0433\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u0443\u0432\u0438\u0434\u0438\u0442\u0435\" title=\"\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u0435 \u043a\u043b\u044e\u0447 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f! \u0412 \u043f\u043e\u043b\u043d\u043e\u043c \u0432\u0438\u0434\u0435 \u0432\u044b \u0435\u0433\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u0443\u0432\u0438\u0434\u0438\u0442\u0435\" width=\"1658\" height=\"950\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b69\/dbd\/c71\/b69dbdc7135c1be7f4e6a64b043cd02b.png\"\/><\/p>\n<div><figcaption>\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u0435 \u043a\u043b\u044e\u0447 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f! \u0412 \u043f\u043e\u043b\u043d\u043e\u043c \u0432\u0438\u0434\u0435 \u0432\u044b \u0435\u0433\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u0443\u0432\u0438\u0434\u0438\u0442\u0435<\/figcaption><\/div>\n<\/figure>\n<h3>\u0410\u043a\u043a\u0430\u0443\u043d\u0442 \u0432 \u042f\u043d\u0434\u0435\u043a\u0441.\u041e\u0431\u043b\u0430\u043a\u043e<\/h3>\n<p>\u0415\u0441\u043b\u0438 \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u0430 \u0435\u0449\u0451 \u043d\u0435\u0442 \u0435\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c<a href=\"https:\/\/console.cloud.yandex.ru\/\" rel=\"noopener noreferrer nofollow\"> \u0437\u0434\u0435\u0441\u044c<\/a>. \u0423\u0431\u0435\u0434\u0438\u0442\u0435\u0441\u044c, \u0447\u0442\u043e \u0443 \u0432\u0430\u0441 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0451\u043d \u043f\u043b\u0430\u0442\u0451\u0436\u043d\u044b\u0439 \u0430\u043a\u043a\u0430\u0443\u043d\u0442, \u0438 \u043e\u043d \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0441\u0442\u0430\u0442\u0443\u0441\u0435 <code>ACTIVE<\/code> \u0438\u043b\u0438 <code>TRIAL_ACTIVE<\/code>.<\/p>\n<p>\u0412\u0441\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c, \u0438\u043c\u0435\u044e\u0442 \u0435\u0436\u0435\u043c\u0435\u0441\u044f\u0447\u043d\u044b\u0439 \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b\u0439 \u043b\u0438\u043c\u0438\u0442 \u043f\u043e\u0442\u0440\u0435\u0431\u043b\u0435\u043d\u0438\u044f. \u041e\u0431 \u044d\u0442\u043e\u043c \u044f \u043d\u0430\u043f\u0438\u0448\u0443 \u043d\u0438\u0436\u0435 \u0438, \u0447\u0435\u0441\u0442\u043d\u043e \u0433\u043e\u0432\u043e\u0440\u044f, \u0432\u0440\u044f\u0434 \u043b\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0438\u0441\u0447\u0435\u0440\u043f\u0430\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u043b\u0438\u043c\u0438\u0442\u044b, \u0435\u0441\u043b\u0438 \u0431\u043e\u0442 \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u043b\u0438\u0447\u043d\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f. \u0422\u0430\u043a \u0447\u0442\u043e \u0432\u0441\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u043d\u0430\u043c \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e, \u043a\u0440\u043e\u043c\u0435 \u0440\u0430\u0441\u0445\u043e\u0434\u043e\u0432 \u043d\u0430 ProxyAPI.\u00a0<\/p>\n<h3>Telegram-\u0431\u043e\u0442<\/h3>\n<p>\u0414\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0432\u043e\u0438\u043c\u0438 \u0431\u043e\u0442\u0430\u043c\u0438 \u0432 Telegram \u0435\u0441\u0442\u044c, \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u0431\u043e\u0442 \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c<a href=\"https:\/\/t.me\/BotFather\" rel=\"noopener noreferrer nofollow\"> BotFather<\/a>. \u041e\u043d \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0432\u0430\u043c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0431\u043e\u0442\u0430 \u0438 \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0434\u0430\u0441\u0442 \u0442\u043e\u043a\u0435\u043d &#8212; \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u0435 \u0435\u0433\u043e, \u043e\u043d \u043d\u0430\u043c \u0435\u0449\u0451 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f.<\/p>\n<h3>\u041e\u0431\u043b\u0430\u0447\u043d\u044b\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b<\/h3>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u0441\u044f \u0432 \u042f\u043d\u0434\u0435\u043a\u0441 \u041e\u0431\u043b\u0430\u043a\u043e \u0438 \u0437\u0430\u0432\u043e\u0434\u0438\u043c \u0432\u0441\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<\/p>\n<ol>\n<li>\n<p><strong>\u0421\u0435\u0440\u0432\u0438\u0441\u043d\u044b\u0439 \u0430\u043a\u043a\u0430\u0443\u043d\u0442<\/strong><\/p>\n<\/li>\n<\/ol>\n<p>\u041d\u0430 \u0434\u043e\u043c\u0430\u0448\u043d\u0435\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u0432 \u0432\u0435\u0440\u0445\u043d\u0435\u043c \u043c\u0435\u043d\u044e \u0435\u0441\u0442\u044c \u0432\u043a\u043b\u0430\u0434\u043a\u0430 &#171;\u0421\u0435\u0440\u0432\u0438\u0441\u043d\u044b\u0435 \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u044b&#187;. \u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0442\u0443\u0434\u0430 \u0438 \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u043d\u043e\u0432\u044b\u0439 \u0430\u043a\u043a\u0430\u0443\u043d\u0442. \u0417\u0434\u0435\u0441\u044c \u0438 \u0432\u0435\u0437\u0434\u0435 \u0434\u0430\u043b\u0435\u0435 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u043e\u0434\u043d\u043e \u0438 \u0442\u043e \u0436\u0435 \u0438\u043c\u044f \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 &#171;chatgpt-telegram-bot&#187; \u043f\u0440\u043e\u0441\u0442\u043e, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0437\u0430\u043f\u0443\u0442\u0430\u0442\u044c\u0441\u044f. \u0410\u043a\u043a\u0430\u0443\u043d\u0442\u0443 \u043d\u0430\u0434\u043e \u043f\u0440\u0438\u0441\u0432\u043e\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0440\u043e\u043b\u0438:<br \/><code>serverless.functions.invoker<\/code><br \/><code>storage.uploader<\/code><\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/fb6\/36e\/2c4\/fb636e2c4670b26a0b34242881ab2a95.png\" width=\"1462\" height=\"706\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/fb6\/36e\/2c4\/fb636e2c4670b26a0b34242881ab2a95.png\"\/><\/figure>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e \u043a\u0430\u043a \u0430\u043a\u043a\u0430\u0443\u043d\u0442 \u0441\u043e\u0437\u0434\u0430\u043d, \u043f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u0432 \u043d\u0435\u0433\u043e \u0438 \u0441\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043a\u043b\u044e\u0447 \u0434\u043e\u0441\u0442\u0443\u043f\u0430, \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0438 \u0441\u0435\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u043a\u043b\u044e\u0447, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0441\u0430\u043c\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u043d\u043e\u0433\u043e \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u0430.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/a35\/ef6\/767\/a35ef6767681b1e506ac7a6e8e8a13e3.png\" width=\"1360\" height=\"528\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a35\/ef6\/767\/a35ef6767681b1e506ac7a6e8e8a13e3.png\"\/><\/figure>\n<ol start=\"2\">\n<li>\n<p><strong>\u0411\u0430\u043a\u0435\u0442<\/strong><\/p>\n<\/li>\n<\/ol>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432 \u0440\u0430\u0437\u0434\u0435\u043b &#171;Object Storage&#187; \u0438 \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u043d\u043e\u0432\u044b\u0439 \u0431\u0430\u043a\u0435\u0442. \u042f \u043d\u0435 \u043c\u0435\u043d\u044f\u043b \u043d\u0438\u043a\u0430\u043a\u0438\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/6a3\/f32\/97f\/6a3f3297f9040064abdbc1c80d4807c8.png\" width=\"1212\" height=\"904\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/6a3\/f32\/97f\/6a3f3297f9040064abdbc1c80d4807c8.png\"\/><\/figure>\n<ol start=\"3\">\n<li>\n<p><strong>\u041e\u0431\u043b\u0430\u0447\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f<\/strong><\/p>\n<\/li>\n<\/ol>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0448\u0430\u0433 \u2014 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043e\u0431\u043b\u0430\u0447\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u0418\u043c\u0435\u043d\u043d\u043e \u043e\u043d\u0430 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0432\u0430\u0448\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043e\u0442 Telegram, \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0438\u0445 \u0432 ProxyAPI \u0438 \u043f\u043e\u0441\u044b\u043b\u0430\u0442\u044c \u043e\u0442\u0432\u0435\u0442 \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u0432 Telegram-\u0431\u043e\u0442.<\/p>\n<p>\u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432 \u0440\u0430\u0437\u0434\u0435\u043b &#171;Cloud Functions&#187; \u0438 \u0436\u043c\u0451\u043c &#171;\u0421\u043e\u0437\u0434\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e&#187;.<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u0440\u0430\u0437\u0443 \u043e\u0442\u043a\u0440\u043e\u0435\u0442\u0441\u044f \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0438 \u043f\u043e\u043b\u043e\u0436\u0438\u043c \u043a\u043e\u0434 \u0444\u0443\u043d\u043a\u0446\u0438\u0438.\u00a0<\/p>\n<p>\u0412\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u0441\u0440\u0435\u0434\u0443 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f Python 3.12:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/d14\/d60\/8b7\/d14d608b74f868e729c4e8a2ac73f4e8.png\" width=\"1470\" height=\"940\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d14\/d60\/8b7\/d14d608b74f868e729c4e8a2ac73f4e8.png\"\/><\/figure>\n<p>\u0412 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0435 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u043e\u0432\u044b\u0439 \u0444\u0430\u0439\u043b, \u043d\u0430\u0437\u043e\u0432\u0451\u043c \u0435\u0433\u043e <code>requirements.txt<\/code> \u0438 \u043f\u043e\u043b\u043e\u0436\u0438\u043c \u0442\u0443\u0434\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"python\">openai==1.3.7 pyTelegramBotAPI==4.14.0 boto3==1.33.7<\/code><\/pre>\n<p>\u042d\u0442\u043e \u0441\u043f\u0438\u0441\u043e\u043a \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0434\u043b\u044f Python, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0431\u043b\u0430\u043a\u043e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u043e\u0434\u0433\u0440\u0443\u0437\u0438\u0442 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043c\u044b \u043c\u043e\u0433\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0438\u043c\u0438 \u0432 \u043a\u043e\u0434\u0435 \u0441\u0430\u043c\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0438\u043c\u0441\u044f \u043d\u0430 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 <code>index.py<\/code> \u0438 \u0437\u0430\u043f\u0438\u0448\u0435\u043c \u0432 \u043d\u0435\u0433\u043e \u044d\u0442\u043e\u0442 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"python\">import logging import telebot import os import openai import json import boto3 import time import multiprocessing  TG_BOT_TOKEN = os.environ.get(\"TG_BOT_TOKEN\") TG_BOT_CHATS = os.environ.get(\"TG_BOT_CHATS\").lower().split(\",\") PROXY_API_KEY = os.environ.get(\"PROXY_API_KEY\") YANDEX_KEY_ID = os.environ.get(\"YANDEX_KEY_ID\") YANDEX_KEY_SECRET = os.environ.get(\"YANDEX_KEY_SECRET\") YANDEX_BUCKET = os.environ.get(\"YANDEX_BUCKET\")   logger = telebot.logger telebot.logger.setLevel(logging.INFO)  bot = telebot.TeleBot(TG_BOT_TOKEN, threaded=False)  client = openai.Client(     api_key=PROXY_API_KEY,     base_url=\"https:\/\/api.proxyapi.ru\/openai\/v1\", )   def get_s3_client():     session = boto3.session.Session(         aws_access_key_id=YANDEX_KEY_ID, aws_secret_access_key=YANDEX_KEY_SECRET     )     return session.client(         service_name=\"s3\", endpoint_url=\"https:\/\/storage.yandexcloud.net\"     )   def typing(chat_id):     while True:         bot.send_chat_action(chat_id, \"typing\")         time.sleep(5)   @bot.message_handler(commands=[\"help\", \"start\"]) def send_welcome(message):     bot.reply_to(         message,         (\"\u041f\u0440\u0438\u0432\u0435\u0442! \u042f ChatGPT \u0431\u043e\u0442. \u0421\u043f\u0440\u043e\u0441\u0438 \u043c\u0435\u043d\u044f \u0447\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c!\"),     )   @bot.message_handler(commands=[\"new\"]) def clear_history(message):     clear_history_for_chat(message.chat.id)     bot.reply_to(message, \"\u0418\u0441\u0442\u043e\u0440\u0438\u044f \u0447\u0430\u0442\u0430 \u043e\u0447\u0438\u0449\u0435\u043d\u0430!\")   @bot.message_handler(func=lambda message: True, content_types=[\"text\"]) def echo_message(message):     typing_process = multiprocessing.Process(target=typing, args=(message.chat.id,))     typing_process.start()      try:         text = message.text         ai_response = process_text_message(text, message.chat.id)     except Exception as e:         bot.reply_to(message, f\"\u041f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0430 \u043e\u0448\u0438\u0431\u043a\u0430, \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u043f\u043e\u0437\u0436\u0435! {e}\")         return      typing_process.terminate()     bot.reply_to(message, ai_response)   def process_text_message(text, chat_id) -> str:     model = \"gpt-3.5-turbo\"      # read current chat history     s3client = get_s3_client()     history = []     try:         history_object_response = s3client.get_object(             Bucket=YANDEX_BUCKET, Key=f\"{chat_id}.json\"         )         history = json.loads(history_object_response[\"Body\"].read())     except:         pass      history.append({\"role\": \"user\", \"content\": text})      try:         chat_completion = client.chat.completions.create(             model=model, messages=history         )     except Exception as e:         if type(e).__name__ == \"BadRequestError\":             clear_history_for_chat(chat_id)             return process_text_message(text, chat_id)         else:             raise e      ai_response = chat_completion.choices[0].message.content     history.append({\"role\": \"assistant\", \"content\": ai_response})      # save current chat history     s3client.put_object(         Bucket=YANDEX_BUCKET,         Key=f\"{chat_id}.json\",         Body=json.dumps(history),     )      return ai_response   def clear_history_for_chat(chat_id):     try:         s3client = get_s3_client()         s3client.put_object(             Bucket=YANDEX_BUCKET,             Key=f\"{chat_id}.json\",             Body=json.dumps([]),         )     except:         pass   def handler(event, context):     message = json.loads(event[\"body\"])     update = telebot.types.Update.de_json(message)      if (         update.message is not None         and update.message.from_user.username.lower() in TG_BOT_CHATS     ):         bot.process_new_updates([update])      return {         \"statusCode\": 200,         \"body\": \"ok\",     }<\/code><\/pre>\n<p>\u0420\u0430\u0437\u0431\u0435\u0440\u0451\u043c, \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u044d\u0442\u043e\u0442 \u043a\u043e\u0434.<\/p>\n<p>\u0421\u043f\u0435\u0440\u0432\u0430 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0438 \u0447\u0438\u0442\u0430\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f.<\/p>\n<p>\u0418\u043d\u0438\u0446\u0438\u0438\u0440\u0443\u0435\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 Telegram:<\/p>\n<pre><code class=\"python\">bot = telebot.TeleBot(TG_BOT_TOKEN, threaded=False)<\/code><\/pre>\n<p><strong>\u0412\u0430\u0436\u043d\u043e!<\/strong> \u041e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0443\u043a\u0430\u0436\u0438\u0442\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <code>threaded=False<\/code>, \u0438\u043d\u0430\u0447\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u043e\u0442 Telegram \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c\u0441\u044f \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u043c \u043f\u043e\u0442\u043e\u043a\u0435, \u043e\u0434\u043d\u0430\u043a\u043e \u0432 \u0441\u0432\u044f\u0437\u0438 \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e \u044d\u0442\u043e \u043d\u0435 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0435\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u043a\u043b\u044e\u0447\u0451\u043d \u0432\u0441\u0435\u0433\u0434\u0430, \u0430 \u043e\u0431\u043b\u0430\u0447\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u043e\u043d\u0430 \u043f\u0440\u0435\u043a\u0440\u0430\u0442\u0438\u0442 \u0441\u0432\u043e\u044e \u0440\u0430\u0431\u043e\u0442\u0443 \u043a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0435\u043d \u043e\u0442\u0432\u0435\u0442 \u043e\u0442 \u043c\u0435\u0442\u043e\u0434\u0430 <code>handler<\/code> \u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u043e\u0438\u0433\u043d\u043e\u0440\u0438\u0440\u0443\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u044e\u0449\u0438\u0439\u0441\u044f \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u043c \u043f\u043e\u0442\u043e\u043a\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0432\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 \u043e\u0442\u0432\u0435\u0442.<\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c API-\u043a\u043b\u044e\u0447 \u0438 \u043f\u0443\u0442\u044c \u043a API \u0434\u043b\u044f OpenAI SDK, \u0447\u0442\u043e\u0431\u044b \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043e\u0431\u0440\u0430\u0449\u0430\u043b\u0430\u0441\u044c \u043a \u043d\u0430\u0448\u0435\u043c\u0443 ProxyAPI, \u0430 \u043d\u0435 \u043a OpenAI \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e:<\/p>\n<pre><code class=\"python\">openai.api_key = os.getenv(\"PROXY_API_KEY\") openai.api_base = \"https:\/\/api.proxyapi.ru\/openai\/v1\"<\/code><\/pre>\n<p>\u00a0<code>def get_s3_client()<\/code><\/p>\n<p>\u041c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 Object Storage. \u0412 \u043d\u0430\u0448 \u0431\u0430\u043a\u0435\u0442 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u0438\u0441\u0442\u043e\u0440\u0438\u044e \u0431\u0435\u0441\u0435\u0434\u044b.<\/p>\n<p><code>def typing(chat_id)<\/code><\/p>\n<p>\u041c\u0435\u0442\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0441\u044b\u043b\u0430\u0442\u044c \u0432 Telegram \u0441\u0442\u0430\u0442\u0443\u0441 &#171;\u041d\u0430\u0431\u0438\u0440\u0430\u0435\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435\u2026&#187;, \u0447\u0442\u043e\u0431\u044b \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u0435 \u043e\u0442\u0432\u0435\u0442\u0430 \u043d\u0435 \u0431\u044b\u043b\u043e \u0442\u0430\u043a\u0438\u043c \u0442\u043e\u043c\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c \ud83d\ude42<\/p>\n<p><code>@bot.message_handler(commands=[\"help\", \"start\"])<\/code><\/p>\n<p>\u041f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u0440\u0438\u0448\u043b\u0451\u0442 \u0431\u043e\u0442 \u0432 \u043e\u0442\u0432\u0435\u0442 \u043d\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u044b <code>\/start<\/code> \u0438\u043b\u0438 <code>\/help<\/code><\/p>\n<p><code>@bot.message_handler(commands=[\"new\"])<\/code><\/p>\n<p>\u041a\u043e\u043c\u0430\u043d\u0434\u0430 <code>\/new<\/code> \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043e\u0447\u0438\u0441\u0442\u0438\u0442\u044c \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u0438\u0441\u0442\u043e\u0440\u0438\u044e \u0447\u0430\u0442\u0430, \u0447\u0442\u043e\u0431\u044b ChatGPT \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u043d\u0435\u0440\u0435\u043b\u0435\u0432\u0430\u043d\u0442\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442, \u043a\u043e\u0433\u0434\u0430 \u0432\u044b, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0445\u043e\u0442\u0438\u0442\u0435 \u043d\u0430\u0447\u0430\u0442\u044c \u043e\u0431\u0441\u0443\u0436\u0434\u0430\u0442\u044c \u043d\u043e\u0432\u0443\u044e \u0442\u0435\u043c\u0443 \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u0431\u043e\u0442 \u043d\u0435 &#171;\u043e\u0442\u0432\u043b\u0435\u043a\u0430\u043b\u0441\u044f&#187; \u043d\u0430 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0443\u044e \u0431\u0435\u0441\u0435\u0434\u0443.<\/p>\n<p><code>@bot.message_handler(func=lambda message: True, content_types=[\"text\"])<\/code><\/p>\n<p>\u041e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0432\u0445\u043e\u0434\u044f\u0449\u0435\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f.<\/p>\n<p><code>def process_text_message(text, chat_id)<\/code><\/p>\n<p>\u041c\u0435\u0442\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0432\u0430\u0448\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435, \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u0435\u0433\u043e \u0432 \u0438\u0441\u0442\u043e\u0440\u0438\u044e, \u043f\u043e\u0441\u044b\u043b\u0430\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 \u0432 ProxyAPI \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043e\u0442\u0432\u0435\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0442\u043e\u0436\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u0432 \u0438\u0441\u0442\u043e\u0440\u0438\u044e. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 <code>BadRequestError<\/code> \u043c\u044b \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0447\u0438\u0449\u0430\u0435\u043c \u0438\u0441\u0442\u043e\u0440\u0438\u044e \u0438 \u0441\u043d\u043e\u0432\u0430 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441. \u0425\u043e\u0442\u044f \u044d\u0442\u0430 \u043e\u0448\u0438\u0431\u043a\u0430 \u043c\u043e\u0436\u0435\u0442 \u043e\u0437\u043d\u0430\u0447\u0430\u0442\u044c \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043d\u043e\u0433\u043e \u043e\u043a\u043d\u0430, \u0443 \u043c\u0435\u043d\u044f \u043e\u043d\u0430 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u043b\u0430 \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u0437-\u0437\u0430 \u044d\u0442\u043e\u0433\u043e.<\/p>\n<p><code>def handler(event, context)<\/code><\/p>\n<p>\u042d\u0442\u043e &#171;\u0432\u0445\u043e\u0434\u043d\u0430\u044f \u0442\u043e\u0447\u043a\u0430&#187; \u0434\u043b\u044f \u0432\u044b\u0437\u043e\u0432\u0430 \u043e\u0431\u043b\u0430\u0447\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u0417\u0434\u0435\u0441\u044c \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u0435\u043a\u043e\u0434\u0438\u0440\u0443\u0435\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0432 JSON, \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c, \u0447\u0442\u043e \u043e\u043d\u043e \u043f\u043e\u0441\u0442\u0443\u043f\u0438\u043b\u043e \u0438\u0437 \u0441\u043f\u0438\u0441\u043a\u0430 \u0447\u0430\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c, \u0442\u043e \u0435\u0441\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441 \u043f\u0440\u0438\u0441\u043b\u0430\u043b\u0438 \u0432\u044b, \u0430 \u043d\u0435 \u043a\u0442\u043e-\u0442\u043e \u0434\u0440\u0443\u0433\u043e\u0439 \u0438 \u043e\u0442\u0434\u0430\u0451\u043c \u0435\u0433\u043e \u043d\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 Telegram-\u0431\u043e\u0442\u0430.<\/p>\n<hr\/>\n<p>\u0412 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u043c \u0442\u0430\u0439\u043c\u0430\u0443\u0442 60 \u0441\u0435\u043a\u0443\u043d\u0434 &#8212; \u043e\u0442\u0432\u0435\u0442\u044b \u043e\u0442 ChatGPT \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043e\u0431\u044b\u0447\u043d\u043e \u0436\u0434\u0430\u0442\u044c \u043a\u0430\u043a\u043e\u0435-\u0442\u043e \u0432\u0440\u0435\u043c\u044f, 60 \u0441\u0435\u043a\u0443\u043d\u0434 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e.<\/p>\n<p>\u0410 \u0442\u0430\u043a\u0436\u0435 \u043d\u0430\u0434\u043e \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0432\u0441\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043d\u0430\u0448\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/1cd\/44f\/7f0\/1cd44f7f02ab33b5440220ff50273129.png\" width=\"1188\" height=\"1390\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/1cd\/44f\/7f0\/1cd44f7f02ab33b5440220ff50273129.png\"\/><\/figure>\n<p><code>TG_BOT_TOKEN<\/code><\/p>\n<p>\u0422\u043e\u043a\u0435\u043d Telegram-\u0431\u043e\u0442\u0430<\/p>\n<p><code>TG_BOT_CHATS<\/code><\/p>\n<p>\u0418\u043c\u0435\u043d\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0445\u043e\u0442\u0438\u0442\u0435 \u0434\u0430\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0431\u043e\u0442\u0443, \u0440\u0430\u0437\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0445 \u0447\u0435\u0440\u0435\u0437 \u0437\u0430\u043f\u044f\u0442\u0443\u044e<\/p>\n<p><code>PROXY_API_KEY<\/code><\/p>\n<p>API-\u043a\u043b\u044e\u0447 \u043e\u0442 ProxyAPI<\/p>\n<p><code>YANDEX_KEY_ID<\/code><\/p>\n<p><code>YANDEX_KEY_SECRET<\/code><\/p>\n<p>\u0418\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0438 \u0441\u0435\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u043a\u043b\u044e\u0447 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043a\u043b\u044e\u0447\u0430 \u0441\u0435\u0440\u0432\u0438\u0441\u043d\u043e\u0433\u043e \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u0430 \u042f\u043d\u0434\u0435\u043a\u0441<\/p>\n<p><code>YANDEX_BUCKET<\/code><\/p>\n<p>\u0418\u043c\u044f \u0431\u0430\u043a\u0435\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u0432 Object Storage<\/p>\n<hr\/>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u043d\u0430\u0448\u0430 \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 \u0437\u0430\u043a\u043e\u043d\u0447\u0435\u043d\u0430. \u0416\u043c\u0451\u043c &#171;\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f&#187; \u0438 \u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u041e\u0431\u043b\u0430\u043a\u043e \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442 \u043d\u0430\u0448\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e. \u0414\u043b\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0448\u0430\u0433\u0430 \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u041f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u0432\u043e \u0432\u043a\u043b\u0430\u0434\u043a\u0443 &#171;\u041e\u0431\u0437\u043e\u0440&#187; \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438 \u0441\u043a\u043e\u043f\u0438\u0440\u0443\u0439\u0442\u0435 \u0435\u0433\u043e \u043e\u0442\u0442\u0443\u0434\u0430.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/b50\/b2b\/321\/b50b2b3214db22af215072e5213e5471.png\" width=\"1050\" height=\"562\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b50\/b2b\/321\/b50b2b3214db22af215072e5213e5471.png\"\/><\/figure>\n<h3>\u0410\u041f\u0418 \u0448\u043b\u044e\u0437<\/h3>\n<p>\u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u043f\u043e\u0441\u044b\u043b\u0430\u0435\u043c \u0432 Telegram-\u0431\u043e\u0442, \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u043b\u0438 \u043d\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0432 \u043d\u0430\u0448\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u0443 \u043d\u0435\u0451 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439 \u0430\u0434\u0440\u0435\u0441. \u0421\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u043b\u0435\u0433\u043a\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430 API-\u0448\u043b\u044e\u0437. \u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432 \u0440\u0430\u0437\u0434\u0435\u043b \u0438 \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u043d\u043e\u0432\u044b\u0439 \u0448\u043b\u044e\u0437. \u0412 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c:<\/p>\n<pre><code class=\"yaml\">openapi: 3.0.0 info:   title: Sample API   version: 1.0.0 paths:   \/:     post:       x-yc-apigateway-integration:         type: cloud-functions         function_id: &lt;FUNCTION-ID>         service_account_id: &lt;SERVICE-ACCOUNT-ID><\/code><\/pre>\n<p>\u0412 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u0441\u0432\u043e\u0439 \u0438\u043d\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u043d\u043e\u0433\u043e \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u0430 \u0434\u043b\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 <code>&lt;FUNCTION-ID><\/code> \u0438 <code>&lt;SERVICE-ACCOUNT-ID><\/code>. \u0412\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u043e\u0442 \u0442\u0430\u043a:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/548\/b4a\/ee3\/548b4aee39aba6af2573ed6d24a4da41.png\" width=\"1748\" height=\"820\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/548\/b4a\/ee3\/548b4aee39aba6af2573ed6d24a4da41.png\"\/><\/figure>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0432\u044b \u0443\u0432\u0438\u0434\u0438\u0442\u0435 \u0441\u0432\u043e\u0434\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0448\u043b\u044e\u0437\u0435. \u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u0435 \u043e\u0442\u0442\u0443\u0434\u0430 \u0441\u0442\u0440\u043e\u043a\u0443 &#171;\u0421\u043b\u0443\u0436\u0435\u0431\u043d\u044b\u0439 \u0434\u043e\u043c\u0435\u043d&#187;.<\/p>\n<h3>Telegram WebHook<\/h3>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0434\u043e \u0441\u043e\u043e\u0431\u0449\u0438\u0442\u044c Telegram-\u0431\u043e\u0442\u0443, \u043a\u0443\u0434\u0430 \u043f\u0435\u0440\u0435\u0441\u044b\u043b\u0430\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u043d \u043e\u0442 \u043d\u0430\u0441 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c POST-\u0437\u0430\u043f\u0440\u043e\u0441 \u043a API Telegram \u0442\u0430\u043a\u043e\u0433\u043e \u0444\u043e\u0440\u043c\u0430\u0442\u0430:<\/p>\n<pre><code class=\"bash\">curl \\   --request POST \\   --url https:\/\/api.telegram.org\/bot&lt;\u0442\u043e\u043a\u0435\u043d \u0431\u043e\u0442\u0430>\/setWebhook \\   --header 'content-type: application\/json' \\   --data '{\"url\": \"&lt;\u0434\u043e\u043c\u0435\u043d API-\u0448\u043b\u044e\u0437\u0430>\"}'<\/code><\/pre>\n<p><code>&lt;\u0442\u043e\u043a\u0435\u043d \u0431\u043e\u0442\u0430><\/code> \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u043c \u043d\u0430 \u0442\u043e\u043a\u0435\u043d Telegram-\u0431\u043e\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0435\u0449\u0435 \u043d\u0430 \u0442\u0440\u0435\u0442\u044c\u0435\u043c \u0448\u0430\u0433\u0435 \u044d\u0442\u043e\u0433\u043e \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u0430<\/p>\n<p><code>&lt;\u0434\u043e\u043c\u0435\u043d API-\u0448\u043b\u044e\u0437\u0430><\/code> \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u043c \u043d\u0430 \u0421\u043b\u0443\u0436\u0435\u0431\u043d\u044b\u0439 \u0434\u043e\u043c\u0435\u043d \u043d\u0430\u0448\u0435\u0433\u043e API-\u0448\u043b\u044e\u0437\u0430, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u043d\u0430 \u043f\u0440\u043e\u0448\u043b\u043e\u043c \u0448\u0430\u0433\u0435.<\/p>\n<p>\u042f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b Postman \u0434\u043b\u044f \u044d\u0442\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438, \u043f\u0440\u043e\u0441\u0442\u043e \u0443\u0434\u043e\u0431\u043d\u0435\u0435, \u043a\u043e\u0433\u0434\u0430 \u0432\u0441\u0451 \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e \u0438 \u0441 user-friendly \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u043c:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/acc\/523\/05f\/acc52305f983558df18c2a50cf06dac8.png\" width=\"1832\" height=\"628\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/acc\/523\/05f\/acc52305f983558df18c2a50cf06dac8.png\"\/><\/figure>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u0432\u0441\u044f \u043d\u0430\u0448\u0430 \u0440\u0430\u0431\u043e\u0442\u0430 \u0437\u0430\u043a\u043e\u043d\u0447\u0435\u043d\u0430, \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c.<\/p>\n<h2>\u0422\u0435\u0441\u0442<\/h2>\n<p>\u0421\u043f\u0440\u043e\u0448\u0443 \u0443 \u0441\u0432\u043e\u0435\u0433\u043e \u0447\u0430\u0442-\u0431\u043e\u0442\u0430 \u0442\u043e\u043f-10 \u0441\u0442\u0440\u0430\u043d \u043f\u043e \u0447\u0438\u0441\u043b\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u043d\u0430\u0441\u0435\u043b\u0435\u043d\u0438\u044f, \u0430 \u043f\u043e\u0442\u043e\u043c \u0443\u0442\u043e\u0447\u043d\u044e, \u0447\u0442\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0442 \u0441\u0442\u0440\u0430\u043d\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0415\u0432\u0440\u043e\u043f\u0435. \u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043c, \u0441\u043c\u043e\u0436\u0435\u0442 \u043b\u0438 \u043e\u043d \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u0434\u0438\u0430\u043b\u043e\u0433 \u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0443\u0442\u043e\u0447\u043d\u0435\u043d\u0438\u044f\u043c\u0438.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/7eb\/e5b\/d50\/7ebe5bd5092111cffeedaeb6c0a1e729.png\" width=\"1270\" height=\"1800\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/7eb\/e5b\/d50\/7ebe5bd5092111cffeedaeb6c0a1e729.png\"\/><\/figure>\n<p>\u0423\u0440\u0430! \u0412\u0441\u0451 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442!<\/p>\n<h2>\u0421\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432<\/h2>\n<p>\u041c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0442\u0440\u0438 \u0442\u0438\u043f\u0430 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u043d\u0430 \u042f\u043d\u0434\u0435\u043a\u0441 \u041e\u0431\u043b\u0430\u043a\u0435. \u0412\u043e\u0442 \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b\u0435 \u043b\u0438\u043c\u0438\u0442\u044b \u043f\u043e\u0442\u0440\u0435\u0431\u043b\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0437 \u043d\u0438\u0445 \u0437\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u043c\u0435\u0441\u044f\u0446.<\/p>\n<p><strong>Cloud Functions<\/strong><\/p>\n<p>1 \u043c\u0438\u043b\u043b\u0438\u043e\u043d \u0432\u044b\u0437\u043e\u0432\u043e\u0432;<br \/>10 \u0413\u0431\/\u0447\u0430\u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438<\/p>\n<p>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435:<br \/><a href=\"https:\/\/cloud.yandex.ru\/docs\/functions\/pricing\" rel=\"noopener noreferrer nofollow\">https:\/\/cloud.yandex.ru\/docs\/functions\/pricing<\/a><\/p>\n<p><strong>Object Storage<\/strong><\/p>\n<p>\u043f\u0435\u0440\u0432\u044b\u0439 1 \u0413\u0411 \u0432 \u043c\u0435\u0441\u044f\u0446 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f;<br \/>\u043f\u0435\u0440\u0432\u044b\u0435 10 000 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 PUT, POST;<br \/>\u043f\u0435\u0440\u0432\u044b\u0435 100 000 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 GET, HEAD, OPTIONS<\/p>\n<p>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435:<br \/><a href=\"https:\/\/cloud.yandex.ru\/docs\/storage\/pricing\" rel=\"noopener noreferrer nofollow\">https:\/\/cloud.yandex.ru\/docs\/storage\/pricing<\/a><\/p>\n<p><strong>API-\u0448\u043b\u044e\u0437<\/strong><\/p>\n<p>\u041a\u0430\u0436\u0434\u044b\u0439 \u043c\u0435\u0441\u044f\u0446 \u043d\u0435 \u0442\u0430\u0440\u0438\u0444\u0438\u0446\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u043f\u0435\u0440\u0432\u044b\u0435 100 000 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043a API-\u0448\u043b\u044e\u0437\u0430\u043c.<\/p>\n<p>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435:<br \/><a href=\"https:\/\/cloud.yandex.ru\/docs\/api-gateway\/pricing\" rel=\"noopener noreferrer nofollow\">https:\/\/cloud.yandex.ru\/docs\/api-gateway\/pricing<\/a><\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, \u043f\u0440\u0438 \u043f\u0440\u043e\u0441\u0442\u043e\u043c \u043b\u0438\u0447\u043d\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0431\u043e\u0442\u0430, \u0432 \u044d\u0442\u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u0443\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u043a\u0430\u0436\u0434\u044b\u0439 \u043c\u0435\u0441\u044f\u0446 \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u0437\u0430\u043f\u0430\u0441\u043e\u043c. \u0422\u043e \u0435\u0441\u0442\u044c \u0432\u0441\u044f \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u0431\u043e\u0442\u0430 \u043d\u0430\u043c \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e.<\/p>\n<p>\u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0440\u0430\u0441\u0445\u043e\u0434\u044b \u0431\u0443\u0434\u0443\u0442 \u0441\u0432\u044f\u0437\u0430\u043d\u044b \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c ChatGPT API. \u0426\u0435\u043d\u044b <a href=\"https:\/\/proxyapi.ru\/pricing\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<hr\/>\n<h2>\u0418\u0442\u043e\u0433<\/h2>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0441\u0432\u043e\u0439 \u043b\u0438\u0447\u043d\u044b\u0439 ChatGPT \u0431\u043e\u0442 \u0432 Telegram, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u0442\u043e\u043b\u044c\u043a\u043e serverless-\u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438 \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 <a href=\"https:\/\/proxyapi.ru\/m\/h2\" rel=\"noopener noreferrer nofollow\">ProxyAPI<\/a> \u0434\u043b\u044f \u0431\u044b\u0441\u0442\u0440\u043e\u0433\u043e \u0438 \u043b\u0451\u0433\u043a\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a ChatGPT API \u0432 \u0420\u043e\u0441\u0441\u0438\u0438.<\/p>\n<hr\/>\n<h2>\u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u0435<\/h2>\n<ul>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/articles\/773528\/\" rel=\"noopener noreferrer nofollow\">\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c DALL-E 3 \u0432 \u0441\u0432\u043e\u0439 ChatGPT \u0431\u043e\u0442 \u0432 Telegram<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/articles\/779742\/\" rel=\"noopener noreferrer nofollow\">\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0437\u0440\u0435\u043d\u0438\u0435, \u0441\u043b\u0443\u0445 \u0438 \u0433\u043e\u043b\u043e\u0441 \u0432 \u0441\u0432\u043e\u0439 ChatGPT \u0431\u043e\u0442 \u0432 Telegram<\/a><\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/767694\/\"> https:\/\/habr.com\/ru\/articles\/767694\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0417\u043d\u0430\u043c\u0435\u043d\u0438\u0442\u044b\u0439 AI \u0447\u0430\u0442-\u0431\u043e\u0442 ChatGPT \u0437\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d \u0432 \u0420\u043e\u0441\u0441\u0438\u0438. \u041e\u0442\u043b\u0438\u0447\u043d\u044b\u043c \u0432\u044b\u0445\u043e\u0434\u043e\u043c \u0438\u0437 \u044d\u0442\u043e\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 \u0431\u044b\u043b\u0438 \u0438 \u0435\u0441\u0442\u044c Telegram-\u0431\u043e\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u043e\u0431\u0445\u043e\u0434\u0438\u0442\u044c \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0443, \u043d\u043e \u0438 \u0432 \u0446\u0435\u043b\u043e\u043c \u0434\u0435\u043b\u0430\u044e\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0431\u043e\u0442\u0430 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0431\u043e\u043b\u0435\u0435 \u0443\u0434\u043e\u0431\u043d\u044b\u043c \u043f\u0440\u044f\u043c\u043e \u0438\u0437 \u043c\u0435\u0441\u0441\u0435\u043d\u0434\u0436\u0435\u0440\u0430.<\/p>\n<p>\u042f \u0440\u0435\u0448\u0438\u043b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u0432\u043e\u044e \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044e ChatGPT \u0432 Telegram, \u0447\u0442\u043e\u0431\u044b \u043b\u0443\u0447\u0448\u0435 \u043f\u043e\u043d\u044f\u0442\u044c, \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 ChatGPT API, \u043a\u0430\u043a\u0438\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043c\u043d\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0431\u043e\u0442\u043e\u043c \u0431\u0435\u0437 \u0432\u0441\u044f\u043a\u0438\u0445 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0439, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0438\u043c\u0435\u0442\u044c \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u044b\u0439 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043c\u043e\u0434\u0435\u043b\u0438 GPT-4.<\/p>\n<p>\u041c\u043d\u0435 \u043d\u0435 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0434\u0435\u0440\u0436\u0430\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0435\u0440, \u043f\u043e\u043a\u0443\u043f\u0430\u0442\u044c \u0434\u043e\u043c\u0435\u043d \u0438 \u0434\u0435\u043b\u0430\u0442\u044c \u043f\u043e\u0434 \u043d\u0435\u0433\u043e SSL \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 Telegram \u0434\u043b\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 WebHook. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u0440\u0435\u0448\u0438\u043b \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0432\u0441\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e serverless-\u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0439.<\/p>\n<h2>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430<\/h2>\n<p>\u0414\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043c\u043d\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f:<\/p>\n<h3>API-\u043a\u043b\u044e\u0447 \u0434\u043b\u044f ChatGPT API<\/h3>\n<p>\u0414\u043e\u0441\u0442\u0443\u043f \u043a API, \u043a\u0430\u043a \u0438 \u043a \u0441\u0430\u043c\u043e\u043c\u0443 ChatGPT \u0437\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d \u0432 \u0420\u043e\u0441\u0441\u0438\u0438. \u041a \u0441\u0447\u0430\u0441\u0442\u044c\u044e, \u0435\u0441\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u044d\u0442\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b &#8212; <a href=\"https:\/\/proxyapi.ru\/m\/h2\" rel=\"noopener noreferrer nofollow\">ChatGPT API \u0432 \u0420\u043e\u0441\u0441\u0438\u0438<\/a> \u043e\u0442 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 ProxyAPI. \u041d\u0435 \u043d\u0443\u0436\u0435\u043d \u043d\u0438 \u0438\u043d\u043e\u0441\u0442\u0440\u0430\u043d\u043d\u044b\u0439 \u0442\u0435\u043b\u0435\u0444\u043e\u043d, \u043d\u0438 VPN, \u043d\u0438 \u043a\u0430\u0440\u0442\u0430 \u0438\u043d\u043e\u0441\u0442\u0440\u0430\u043d\u043d\u043e\u0433\u043e \u0431\u0430\u043d\u043a\u0430.\u00a0<\/p>\n<p>\u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u043c\u0441\u044f, \u0438\u0434\u0451\u043c \u0432 \u0440\u0430\u0437\u0434\u0435\u043b \u041a\u043b\u044e\u0447\u0438 API \u0438 \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u043a\u043b\u044e\u0447. \u041e\u0434\u043d\u0430 \u043c\u0438\u043d\u0443\u0442\u0430 \u0438 \u0433\u043e\u0442\u043e\u0432\u043e. \u041a\u0440\u0430\u0441\u043e\u0442\u0430!<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u0435 \u043a\u043b\u044e\u0447 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f! \u0412 \u043f\u043e\u043b\u043d\u043e\u043c \u0432\u0438\u0434\u0435 \u0432\u044b \u0435\u0433\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u0443\u0432\u0438\u0434\u0438\u0442\u0435<\/figcaption><\/div>\n<\/figure>\n<h3>\u0410\u043a\u043a\u0430\u0443\u043d\u0442 \u0432 \u042f\u043d\u0434\u0435\u043a\u0441.\u041e\u0431\u043b\u0430\u043a\u043e<\/h3>\n<p>\u0415\u0441\u043b\u0438 \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u0430 \u0435\u0449\u0451 \u043d\u0435\u0442 \u0435\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c<a href=\"https:\/\/console.cloud.yandex.ru\/\" rel=\"noopener noreferrer nofollow\"> \u0437\u0434\u0435\u0441\u044c<\/a>. \u0423\u0431\u0435\u0434\u0438\u0442\u0435\u0441\u044c, \u0447\u0442\u043e \u0443 \u0432\u0430\u0441 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0451\u043d \u043f\u043b\u0430\u0442\u0451\u0436\u043d\u044b\u0439 \u0430\u043a\u043a\u0430\u0443\u043d\u0442, \u0438 \u043e\u043d \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0441\u0442\u0430\u0442\u0443\u0441\u0435 <code>ACTIVE<\/code> \u0438\u043b\u0438 <code>TRIAL_ACTIVE<\/code>.<\/p>\n<p>\u0412\u0441\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c, \u0438\u043c\u0435\u044e\u0442 \u0435\u0436\u0435\u043c\u0435\u0441\u044f\u0447\u043d\u044b\u0439 \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b\u0439 \u043b\u0438\u043c\u0438\u0442 \u043f\u043e\u0442\u0440\u0435\u0431\u043b\u0435\u043d\u0438\u044f. \u041e\u0431 \u044d\u0442\u043e\u043c \u044f \u043d\u0430\u043f\u0438\u0448\u0443 \u043d\u0438\u0436\u0435 \u0438, \u0447\u0435\u0441\u0442\u043d\u043e \u0433\u043e\u0432\u043e\u0440\u044f, \u0432\u0440\u044f\u0434 \u043b\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0438\u0441\u0447\u0435\u0440\u043f\u0430\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u043b\u0438\u043c\u0438\u0442\u044b, \u0435\u0441\u043b\u0438 \u0431\u043e\u0442 \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u043b\u0438\u0447\u043d\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f. \u0422\u0430\u043a \u0447\u0442\u043e \u0432\u0441\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u043d\u0430\u043c \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e, \u043a\u0440\u043e\u043c\u0435 \u0440\u0430\u0441\u0445\u043e\u0434\u043e\u0432 \u043d\u0430 ProxyAPI.\u00a0<\/p>\n<h3>Telegram-\u0431\u043e\u0442<\/h3>\n<p>\u0414\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0432\u043e\u0438\u043c\u0438 \u0431\u043e\u0442\u0430\u043c\u0438 \u0432 Telegram \u0435\u0441\u0442\u044c, \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u0431\u043e\u0442 \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c<a href=\"https:\/\/t.me\/BotFather\" rel=\"noopener noreferrer nofollow\"> BotFather<\/a>. \u041e\u043d \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0432\u0430\u043c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0431\u043e\u0442\u0430 \u0438 \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0434\u0430\u0441\u0442 \u0442\u043e\u043a\u0435\u043d &#8212; \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u0435 \u0435\u0433\u043e, \u043e\u043d \u043d\u0430\u043c \u0435\u0449\u0451 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f.<\/p>\n<h3>\u041e\u0431\u043b\u0430\u0447\u043d\u044b\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b<\/h3>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u0441\u044f \u0432 \u042f\u043d\u0434\u0435\u043a\u0441 \u041e\u0431\u043b\u0430\u043a\u043e \u0438 \u0437\u0430\u0432\u043e\u0434\u0438\u043c \u0432\u0441\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<\/p>\n<ol>\n<li>\n<p><strong>\u0421\u0435\u0440\u0432\u0438\u0441\u043d\u044b\u0439 \u0430\u043a\u043a\u0430\u0443\u043d\u0442<\/strong><\/p>\n<\/li>\n<\/ol>\n<p>\u041d\u0430 \u0434\u043e\u043c\u0430\u0448\u043d\u0435\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u0432 \u0432\u0435\u0440\u0445\u043d\u0435\u043c \u043c\u0435\u043d\u044e \u0435\u0441\u0442\u044c \u0432\u043a\u043b\u0430\u0434\u043a\u0430 &#171;\u0421\u0435\u0440\u0432\u0438\u0441\u043d\u044b\u0435 \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u044b&#187;. \u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0442\u0443\u0434\u0430 \u0438 \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u043d\u043e\u0432\u044b\u0439 \u0430\u043a\u043a\u0430\u0443\u043d\u0442. \u0417\u0434\u0435\u0441\u044c \u0438 \u0432\u0435\u0437\u0434\u0435 \u0434\u0430\u043b\u0435\u0435 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u043e\u0434\u043d\u043e \u0438 \u0442\u043e \u0436\u0435 \u0438\u043c\u044f \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 &#171;chatgpt-telegram-bot&#187; \u043f\u0440\u043e\u0441\u0442\u043e, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0437\u0430\u043f\u0443\u0442\u0430\u0442\u044c\u0441\u044f. \u0410\u043a\u043a\u0430\u0443\u043d\u0442\u0443 \u043d\u0430\u0434\u043e \u043f\u0440\u0438\u0441\u0432\u043e\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0440\u043e\u043b\u0438:<br \/><code>serverless.functions.invoker<\/code><br \/><code>storage.uploader<\/code><\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e \u043a\u0430\u043a \u0430\u043a\u043a\u0430\u0443\u043d\u0442 \u0441\u043e\u0437\u0434\u0430\u043d, \u043f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u0432 \u043d\u0435\u0433\u043e \u0438 \u0441\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043a\u043b\u044e\u0447 \u0434\u043e\u0441\u0442\u0443\u043f\u0430, \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0438 \u0441\u0435\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u043a\u043b\u044e\u0447, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0441\u0430\u043c\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u043d\u043e\u0433\u043e \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u0430.<\/p>\n<figure class=\"full-width\"><\/figure>\n<ol start=\"2\">\n<li>\n<p><strong>\u0411\u0430\u043a\u0435\u0442<\/strong><\/p>\n<\/li>\n<\/ol>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432 \u0440\u0430\u0437\u0434\u0435\u043b &#171;Object Storage&#187; \u0438 \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u043d\u043e\u0432\u044b\u0439 \u0431\u0430\u043a\u0435\u0442. \u042f \u043d\u0435 \u043c\u0435\u043d\u044f\u043b \u043d\u0438\u043a\u0430\u043a\u0438\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438.<\/p>\n<figure class=\"full-width\"><\/figure>\n<ol start=\"3\">\n<li>\n<p><strong>\u041e\u0431\u043b\u0430\u0447\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f<\/strong><\/p>\n<\/li>\n<\/ol>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0448\u0430\u0433 \u2014 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043e\u0431\u043b\u0430\u0447\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u0418\u043c\u0435\u043d\u043d\u043e \u043e\u043d\u0430 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0432\u0430\u0448\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043e\u0442 Telegram, \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0438\u0445 \u0432 ProxyAPI \u0438 \u043f\u043e\u0441\u044b\u043b\u0430\u0442\u044c \u043e\u0442\u0432\u0435\u0442 \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u0432 Telegram-\u0431\u043e\u0442.<\/p>\n<p>\u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432 \u0440\u0430\u0437\u0434\u0435\u043b &#171;Cloud Functions&#187; \u0438 \u0436\u043c\u0451\u043c &#171;\u0421\u043e\u0437\u0434\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e&#187;.<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u0440\u0430\u0437\u0443 \u043e\u0442\u043a\u0440\u043e\u0435\u0442\u0441\u044f \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0438 \u043f\u043e\u043b\u043e\u0436\u0438\u043c \u043a\u043e\u0434 \u0444\u0443\u043d\u043a\u0446\u0438\u0438.\u00a0<\/p>\n<p>\u0412\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u0441\u0440\u0435\u0434\u0443 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f Python 3.12:<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0412 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0435 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u043e\u0432\u044b\u0439 \u0444\u0430\u0439\u043b, \u043d\u0430\u0437\u043e\u0432\u0451\u043c \u0435\u0433\u043e <code>requirements.txt<\/code> \u0438 \u043f\u043e\u043b\u043e\u0436\u0438\u043c \u0442\u0443\u0434\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"python\">openai==1.3.7 pyTelegramBotAPI==4.14.0 boto3==1.33.7<\/code><\/pre>\n<p>\u042d\u0442\u043e \u0441\u043f\u0438\u0441\u043e\u043a \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0434\u043b\u044f Python, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0431\u043b\u0430\u043a\u043e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u043e\u0434\u0433\u0440\u0443\u0437\u0438\u0442 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043c\u044b \u043c\u043e\u0433\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0438\u043c\u0438 \u0432 \u043a\u043e\u0434\u0435 \u0441\u0430\u043c\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0438\u043c\u0441\u044f \u043d\u0430 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 <code>index.py<\/code> \u0438 \u0437\u0430\u043f\u0438\u0448\u0435\u043c \u0432 \u043d\u0435\u0433\u043e \u044d\u0442\u043e\u0442 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"python\">import logging import telebot import os import openai import json import boto3 import time import multiprocessing  TG_BOT_TOKEN = os.environ.get(\"TG_BOT_TOKEN\") TG_BOT_CHATS = os.environ.get(\"TG_BOT_CHATS\").lower().split(\",\") PROXY_API_KEY = os.environ.get(\"PROXY_API_KEY\") YANDEX_KEY_ID = os.environ.get(\"YANDEX_KEY_ID\") YANDEX_KEY_SECRET = os.environ.get(\"YANDEX_KEY_SECRET\") YANDEX_BUCKET = os.environ.get(\"YANDEX_BUCKET\")   logger = telebot.logger telebot.logger.setLevel(logging.INFO)  bot = telebot.TeleBot(TG_BOT_TOKEN, threaded=False)  client = openai.Client(     api_key=PROXY_API_KEY,     base_url=\"https:\/\/api.proxyapi.ru\/openai\/v1\", )   def get_s3_client():     session = boto3.session.Session(         aws_access_key_id=YANDEX_KEY_ID, aws_secret_access_key=YANDEX_KEY_SECRET     )     return session.client(         service_name=\"s3\", endpoint_url=\"https:\/\/storage.yandexcloud.net\"     )   def typing(chat_id):     while True:         bot.send_chat_action(chat_id, \"typing\")         time.sleep(5)   @bot.message_handler(commands=[\"help\", \"start\"]) def send_welcome(message):     bot.reply_to(         message,         (\"\u041f\u0440\u0438\u0432\u0435\u0442! \u042f ChatGPT \u0431\u043e\u0442. \u0421\u043f\u0440\u043e\u0441\u0438 \u043c\u0435\u043d\u044f \u0447\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c!\"),     )   @bot.message_handler(commands=[\"new\"]) def clear_history(message):     clear_history_for_chat(message.chat.id)     bot.reply_to(message, \"\u0418\u0441\u0442\u043e\u0440\u0438\u044f \u0447\u0430\u0442\u0430 \u043e\u0447\u0438\u0449\u0435\u043d\u0430!\")   @bot.message_handler(func=lambda message: True, content_types=[\"text\"]) def echo_message(message):     typing_process = multiprocessing.Process(target=typing, args=(message.chat.id,))     typing_process.start()      try:         text = message.text         ai_response = process_text_message(text, message.chat.id)     except Exception as e:         bot.reply_to(message, f\"\u041f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0430 \u043e\u0448\u0438\u0431\u043a\u0430, \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u043f\u043e\u0437\u0436\u0435! {e}\")         return      typing_process.terminate()     bot.reply_to(message, ai_response)   def process_text_message(text, chat_id) -> str:     model = \"gpt-3.5-turbo\"      # read current chat history     s3client = get_s3_client()     history = []     try:         history_object_response = s3client.get_object(             Bucket=YANDEX_BUCKET, Key=f\"{chat_id}.json\"         )         history = json.loads(history_object_response[\"Body\"].read())     except:         pass      history.append({\"role\": \"user\", \"content\": text})      try:         chat_completion = client.chat.completions.create(             model=model, messages=history         )     except Exception as e:         if type(e).__name__ == \"BadRequestError\":             clear_history_for_chat(chat_id)             return process_text_message(text, chat_id)         else:             raise e      ai_response = chat_completion.choices[0].message.content     history.append({\"role\": \"assistant\", \"content\": ai_response})      # save current chat history     s3client.put_object(         Bucket=YANDEX_BUCKET,         Key=f\"{chat_id}.json\",         Body=json.dumps(history),     )      return ai_response   def clear_history_for_chat(chat_id):     try:         s3client = get_s3_client()         s3client.put_object(             Bucket=YANDEX_BUCKET,             Key=f\"{chat_id}.json\",             Body=json.dumps([]),         )     except:         pass   def handler(event, context):     message = json.loads(event[\"body\"])     update = telebot.types.Update.de_json(message)      if (         update.message is not None         and update.message.from_user.username.lower() in TG_BOT_CHATS     ):         bot.process_new_updates([update])      return {         \"statusCode\": 200,         \"body\": \"ok\",     }<\/code><\/pre>\n<p>\u0420\u0430\u0437\u0431\u0435\u0440\u0451\u043c, \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u044d\u0442\u043e\u0442 \u043a\u043e\u0434.<\/p>\n<p>\u0421\u043f\u0435\u0440\u0432\u0430 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0438 \u0447\u0438\u0442\u0430\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f.<\/p>\n<p>\u0418\u043d\u0438\u0446\u0438\u0438\u0440\u0443\u0435\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 Telegram:<\/p>\n<pre><code class=\"python\">bot = telebot.TeleBot(TG_BOT_TOKEN, threaded=False)<\/code><\/pre>\n<p><strong>\u0412\u0430\u0436\u043d\u043e!<\/strong> \u041e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0443\u043a\u0430\u0436\u0438\u0442\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <code>threaded=False<\/code>, \u0438\u043d\u0430\u0447\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u043e\u0442 Telegram \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c\u0441\u044f \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u043c \u043f\u043e\u0442\u043e\u043a\u0435, \u043e\u0434\u043d\u0430\u043a\u043e \u0432 \u0441\u0432\u044f\u0437\u0438 \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e \u044d\u0442\u043e \u043d\u0435 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0435\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u043a\u043b\u044e\u0447\u0451\u043d \u0432\u0441\u0435\u0433\u0434\u0430, \u0430 \u043e\u0431\u043b\u0430\u0447\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u043e\u043d\u0430 \u043f\u0440\u0435\u043a\u0440\u0430\u0442\u0438\u0442 \u0441\u0432\u043e\u044e \u0440\u0430\u0431\u043e\u0442\u0443 \u043a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0435\u043d \u043e\u0442\u0432\u0435\u0442 \u043e\u0442 \u043c\u0435\u0442\u043e\u0434\u0430 <code>handler<\/code> \u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u043e\u0438\u0433\u043d\u043e\u0440\u0438\u0440\u0443\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u044e\u0449\u0438\u0439\u0441\u044f \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u043c \u043f\u043e\u0442\u043e\u043a\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0432\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 \u043e\u0442\u0432\u0435\u0442.<\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c API-\u043a\u043b\u044e\u0447 \u0438 \u043f\u0443\u0442\u044c \u043a API \u0434\u043b\u044f OpenAI SDK, \u0447\u0442\u043e\u0431\u044b \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043e\u0431\u0440\u0430\u0449\u0430\u043b\u0430\u0441\u044c \u043a \u043d\u0430\u0448\u0435\u043c\u0443 ProxyAPI, \u0430 \u043d\u0435 \u043a OpenAI \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e:<\/p>\n<pre><code class=\"python\">openai.api_key = os.getenv(\"PROXY_API_KEY\") openai.api_base = \"https:\/\/api.proxyapi.ru\/openai\/v1\"<\/code><\/pre>\n<p>\u00a0<code>def get_s3_client()<\/code><\/p>\n<p>\u041c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 Object Storage. \u0412 \u043d\u0430\u0448 \u0431\u0430\u043a\u0435\u0442 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u0438\u0441\u0442\u043e\u0440\u0438\u044e \u0431\u0435\u0441\u0435\u0434\u044b.<\/p>\n<p><code>def typing(chat_id)<\/code><\/p>\n<p>\u041c\u0435\u0442\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0441\u044b\u043b\u0430\u0442\u044c \u0432 Telegram \u0441\u0442\u0430\u0442\u0443\u0441 &#171;\u041d\u0430\u0431\u0438\u0440\u0430\u0435\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435\u2026&#187;, \u0447\u0442\u043e\u0431\u044b \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u0435 \u043e\u0442\u0432\u0435\u0442\u0430 \u043d\u0435 \u0431\u044b\u043b\u043e \u0442\u0430\u043a\u0438\u043c \u0442\u043e\u043c\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c \ud83d\ude42<\/p>\n<p><code>@bot.message_handler(commands=[\"help\", \"start\"])<\/code><\/p>\n<p>\u041f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u0440\u0438\u0448\u043b\u0451\u0442 \u0431\u043e\u0442 \u0432 \u043e\u0442\u0432\u0435\u0442 \u043d\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u044b <code>\/start<\/code> \u0438\u043b\u0438 <code>\/help<\/code><\/p>\n<p><code>@bot.message_handler(commands=[\"new\"])<\/code><\/p>\n<p>\u041a\u043e\u043c\u0430\u043d\u0434\u0430 <code>\/new<\/code> \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043e\u0447\u0438\u0441\u0442\u0438\u0442\u044c \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u0438\u0441\u0442\u043e\u0440\u0438\u044e \u0447\u0430\u0442\u0430, \u0447\u0442\u043e\u0431\u044b ChatGPT \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u043d\u0435\u0440\u0435\u043b\u0435\u0432\u0430\u043d\u0442\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442, \u043a\u043e\u0433\u0434\u0430 \u0432\u044b, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0445\u043e\u0442\u0438\u0442\u0435 \u043d\u0430\u0447\u0430\u0442\u044c \u043e\u0431\u0441\u0443\u0436\u0434\u0430\u0442\u044c \u043d\u043e\u0432\u0443\u044e \u0442\u0435\u043c\u0443 \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u0431\u043e\u0442 \u043d\u0435 &#171;\u043e\u0442\u0432\u043b\u0435\u043a\u0430\u043b\u0441\u044f&#187; \u043d\u0430 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0443\u044e \u0431\u0435\u0441\u0435\u0434\u0443.<\/p>\n<p><code>@bot.message_handler(func=lambda message: True, content_types=[\"text\"])<\/code><\/p>\n<p>\u041e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0432\u0445\u043e\u0434\u044f\u0449\u0435\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f.<\/p>\n<p><code>def process_text_message(text, chat_id)<\/code><\/p>\n<p>\u041c\u0435\u0442\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0432\u0430\u0448\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435, \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u0435\u0433\u043e \u0432 \u0438\u0441\u0442\u043e\u0440\u0438\u044e, \u043f\u043e\u0441\u044b\u043b\u0430\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 \u0432 ProxyAPI \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043e\u0442\u0432\u0435\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0442\u043e\u0436\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u0432 \u0438\u0441\u0442\u043e\u0440\u0438\u044e. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 <code>BadRequestError<\/code> \u043c\u044b \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0447\u0438\u0449\u0430\u0435\u043c \u0438\u0441\u0442\u043e\u0440\u0438\u044e \u0438 \u0441\u043d\u043e\u0432\u0430 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441. \u0425\u043e\u0442\u044f \u044d\u0442\u0430 \u043e\u0448\u0438\u0431\u043a\u0430 \u043c\u043e\u0436\u0435\u0442 \u043e\u0437\u043d\u0430\u0447\u0430\u0442\u044c \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043d\u043e\u0433\u043e \u043e\u043a\u043d\u0430, \u0443 \u043c\u0435\u043d\u044f \u043e\u043d\u0430 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u043b\u0430 \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u0437-\u0437\u0430 \u044d\u0442\u043e\u0433\u043e.<\/p>\n<p><code>def handler(event, context)<\/code><\/p>\n<p>\u042d\u0442\u043e &#171;\u0432\u0445\u043e\u0434\u043d\u0430\u044f \u0442\u043e\u0447\u043a\u0430&#187; \u0434\u043b\u044f \u0432\u044b\u0437\u043e\u0432\u0430 \u043e\u0431\u043b\u0430\u0447\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u0417\u0434\u0435\u0441\u044c \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u0435\u043a\u043e\u0434\u0438\u0440\u0443\u0435\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0432 JSON, \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c, \u0447\u0442\u043e \u043e\u043d\u043e \u043f\u043e\u0441\u0442\u0443\u043f\u0438\u043b\u043e \u0438\u0437 \u0441\u043f\u0438\u0441\u043a\u0430 \u0447\u0430\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c, \u0442\u043e \u0435\u0441\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441 \u043f\u0440\u0438\u0441\u043b\u0430\u043b\u0438 \u0432\u044b, \u0430 \u043d\u0435 \u043a\u0442\u043e-\u0442\u043e \u0434\u0440\u0443\u0433\u043e\u0439 \u0438 \u043e\u0442\u0434\u0430\u0451\u043c \u0435\u0433\u043e \u043d\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 Telegram-\u0431\u043e\u0442\u0430.<\/p>\n<hr\/>\n<p>\u0412 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u043c \u0442\u0430\u0439\u043c\u0430\u0443\u0442 60 \u0441\u0435\u043a\u0443\u043d\u0434 &#8212; \u043e\u0442\u0432\u0435\u0442\u044b \u043e\u0442 ChatGPT \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043e\u0431\u044b\u0447\u043d\u043e \u0436\u0434\u0430\u0442\u044c \u043a\u0430\u043a\u043e\u0435-\u0442\u043e \u0432\u0440\u0435\u043c\u044f, 60 \u0441\u0435\u043a\u0443\u043d\u0434 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e.<\/p>\n<p>\u0410 \u0442\u0430\u043a\u0436\u0435 \u043d\u0430\u0434\u043e \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0432\u0441\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043d\u0430\u0448\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f.<\/p>\n<figure class=\"full-width\"><\/figure>\n<p><code>TG_BOT_TOKEN<\/code><\/p>\n<p>\u0422\u043e\u043a\u0435\u043d Telegram-\u0431\u043e\u0442\u0430<\/p>\n<p><code>TG_BOT_CHATS<\/code><\/p>\n<p>\u0418\u043c\u0435\u043d\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0445\u043e\u0442\u0438\u0442\u0435 \u0434\u0430\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0431\u043e\u0442\u0443, \u0440\u0430\u0437\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0445 \u0447\u0435\u0440\u0435\u0437 \u0437\u0430\u043f\u044f\u0442\u0443\u044e<\/p>\n<p><code>PROXY_API_KEY<\/code><\/p>\n<p>API-\u043a\u043b\u044e\u0447 \u043e\u0442 ProxyAPI<\/p>\n<p><code>YANDEX_KEY_ID<\/code><\/p>\n<p><code>YANDEX_KEY_SECRET<\/code><\/p>\n<p>\u0418\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0438 \u0441\u0435\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u043a\u043b\u044e\u0447 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043a\u043b\u044e\u0447\u0430 \u0441\u0435\u0440\u0432\u0438\u0441\u043d\u043e\u0433\u043e \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u0430 \u042f\u043d\u0434\u0435\u043a\u0441<\/p>\n<p><code>YANDEX_BUCKET<\/code><\/p>\n<p>\u0418\u043c\u044f \u0431\u0430\u043a\u0435\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u0432 Object Storage<\/p>\n<hr\/>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u043d\u0430\u0448\u0430 \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 \u0437\u0430\u043a\u043e\u043d\u0447\u0435\u043d\u0430. \u0416\u043c\u0451\u043c &#171;\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f&#187; \u0438 \u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u041e\u0431\u043b\u0430\u043a\u043e \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442 \u043d\u0430\u0448\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e. \u0414\u043b\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0448\u0430\u0433\u0430 \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u041f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u0432\u043e \u0432\u043a\u043b\u0430\u0434\u043a\u0443 &#171;\u041e\u0431\u0437\u043e\u0440&#187; \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438 \u0441\u043a\u043e\u043f\u0438\u0440\u0443\u0439\u0442\u0435 \u0435\u0433\u043e \u043e\u0442\u0442\u0443\u0434\u0430.<\/p>\n<figure class=\"full-width\"><\/figure>\n<h3>\u0410\u041f\u0418 \u0448\u043b\u044e\u0437<\/h3>\n<p>\u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b <\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-357569","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/357569","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=357569"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/357569\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=357569"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=357569"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=357569"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}