{"id":398764,"date":"2024-06-29T14:15:55","date_gmt":"2024-06-29T14:15:55","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=398764"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2024-06-29T14:15:55","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=398764","title":{"rendered":"<span>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0430\u044f \u043f\u043e\u0448\u0430\u0433\u043e\u0432\u0430\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u043a\u0430\u043a \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440 \u043d\u0430 Linux \u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043f\u043e API \u043a ChatGPT. \u0414\u043b\u044f Python \u0438 Node.js<\/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>ChatGPT \u043d\u0430\u0431\u0438\u0440\u0430\u0435\u0442 \u0432\u0441\u0435 \u0431\u043e\u043b\u044c\u0448\u0443\u044e \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u0441\u0442\u044c, \u0432\u0435\u0434\u044c \u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043c\u043e\u0447\u044c \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0443 \u0438\u043b\u0438 \u0434\u0430\u0436\u0435 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0435\u0433\u043e \u0432 \u0440\u044f\u0434\u0435 \u0437\u0430\u0434\u0430\u0447. \u0421 \u043d\u0438\u043c \u043c\u043e\u0436\u043d\u043e \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0435\u0440\u0435\u0437 \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441, \u043d\u043e \u0438 \u043f\u043e API. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u0432 \u0441\u0432\u043e\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u0447\u0442\u043e\u0431\u044b \u0440\u0435\u0448\u0430\u0442\u044c \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u0431\u0438\u0437\u043d\u0435\u0441\u0430. \u0421\u0435\u0439\u0447\u0430\u0441 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442. \u0420\u0435\u0448\u0438\u043b \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0442\u0430\u0442\u044c\u044e, \u0433\u0434\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0438 \u043f\u043e\u0448\u0430\u0433\u043e\u0432\u043e \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e, \u043a\u0430\u043a \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440 Linux (Ubuntu) \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u043f\u043e API \u0441 \u0434\u0430\u043d\u043d\u043e\u0439 \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u044c\u044e, \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 Python (Flask) \u0438 Node.js (Next.js). \u041e\u043f\u044f\u0442\u044c \u0436\u0435, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0435 Ubuntu, \u043d\u0435 Flask \u0438 \u043d\u0435 Next.js, \u043f\u0440\u043e\u0441\u0442\u043e \u0430\u0434\u0430\u043f\u0442\u0438\u0440\u043e\u0432\u0430\u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043f\u043e\u0434 \u0441\u0435\u0431\u044f.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/6e0\/82f\/728\/6e082f728dd900dde23337c8201dcada.png\" width=\"780\" height=\"440\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/6e0\/82f\/728\/6e082f728dd900dde23337c8201dcada.png\"\/><\/figure>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u043e, \u043a\u0430\u043a \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0434\u0435\u043c\u043e \u043f\u0440\u043e\u0435\u043a\u0442 \u043e\u0442 OpenAI (\u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0437\u0434\u0435\u0441\u044c: <a href=\"https:\/\/platform.openai.com\/docs\/quickstart\/build-your-application\" rel=\"noopener noreferrer nofollow\"><u>Build your application<\/u><\/a>), \u0430 \u0437\u0430\u0442\u0435\u043c \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0435\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0438 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u044b, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0438 \u043d\u0430 \u0440\u0443\u0441\u0441\u043a\u043e\u043c. \u0422\u0430\u043a\u0436\u0435 \u0432 \u043a\u043e\u043d\u0446\u0435 \u0441\u0442\u0430\u0442\u044c\u0438 \u0441\u043a\u0430\u0436\u0443 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u0440\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b API \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u043c\u043e\u0434\u0435\u043b\u0438. \u0412\u0441\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0431\u0443\u0434\u0443\u0442 \u0438\u0437 \u043a\u043e\u043d\u0441\u043e\u043b\u0438.<\/p>\n<p>\u0421\u0442\u0430\u0442\u044c\u044f \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0440\u0430\u0437\u0434\u0435\u043b\u043e\u0432:<\/p>\n<ol>\n<li>\n<p><strong>\u041f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Linux.<\/strong> \u0422\u043e \u0435\u0441\u0442\u044c \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u0437\u044f\u0442\u044c \u0447\u0438\u0441\u0442\u044b\u0439 Linux \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u043e \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0434\u043b\u044f \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<\/p>\n<\/li>\n<li>\n<p><strong>\u041f\u0440\u043e\u0435\u043a\u0442 \u0434\u043b\u044f Python.<\/strong> \u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0434\u0435\u043c\u043e \u043f\u0440\u043e\u0435\u043a\u0442 \u0434\u043b\u044f Python (Flask). \u0410 \u0437\u0430\u0442\u0435\u043c \u043a\u0430\u043a \u0435\u0433\u043e \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0434\u043b\u044f \u0441\u0432\u043e\u0438\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432.<\/p>\n<\/li>\n<li>\n<p><strong>\u041f\u0440\u043e\u0435\u043a\u0442 \u0434\u043b\u044f Node.js.<\/strong> \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043f\u043e \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044e \u0434\u0435\u043c\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0443\u0436\u0435 \u0434\u043b\u044f Node.js (Next.js). \u0418 \u0437\u0430\u0442\u0435\u043c \u0442\u0430\u043a\u0436\u0435 \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043f\u043e\u0434 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b.<\/p>\n<\/li>\n<li>\n<p><strong>\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b API \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u043c\u043e\u0434\u0435\u043b\u0435\u0439.<\/strong> \u041f\u043e\u043b\u0435\u0437\u043d\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043d\u0443\u0436\u043d\u0430 \u0434\u043b\u044f \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f ChatGPT, \u043f\u0440\u0438 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u0441 \u043d\u0438\u043c \u043f\u043e API.<\/p>\n<\/li>\n<li>\n<p>\u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u043d\u043e\u0441\u0442\u0438 \u0442\u0435\u043c \u043a\u0442\u043e \u0434\u043e\u0447\u0438\u0442\u0430\u043b. \u041c\u043e\u0438 \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u044b, \u0435\u0441\u043b\u0438 \u0445\u043e\u0442\u0438\u0442\u0435 \u0437\u0430\u0434\u0430\u0442\u044c \u0432\u043e\u043f\u0440\u043e\u0441.<\/p>\n<\/li>\n<\/ol>\n<p>\u0427\u0442\u043e\u0431\u044b \u043d\u0430\u0447\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 ChatGPT, \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 <a href=\"https:\/\/openai.com\/\" rel=\"noopener noreferrer nofollow\"><u>OpenAI<\/u><\/a>. \u041f\u0440\u0438 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u043f\u0440\u0438\u0434\u0435\u0442 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0435 \u043f\u043e \u0441\u043c\u0441. OpenAI \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432 \u0420\u043e\u0441\u0441\u0438\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f VPN \u0438 \u0442\u0435\u043b\u0435\u0444\u043e\u043d \u0441 \u043d\u043e\u043c\u0435\u0440\u043e\u043c \u0432\u043d\u0435 \u0420\u0424. \u0426\u0435\u043b\u044c \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u044e &#8212; \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0438\u043c\u0435\u043d\u043d\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043f\u043e API, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u043d\u0435 \u0431\u0443\u0434\u0443 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0440\u0430\u0441\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c, \u043a\u0430\u043a \u0440\u0435\u0448\u0438\u0442\u044c \u0432\u043e\u043f\u0440\u043e\u0441 \u0441 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0435\u0439. \u0415\u0441\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u0441\u0442\u0430\u0442\u0435\u0439, \u043a\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u0442\u044c VPN, \u043c\u043e\u0436\u043d\u043e \u0434\u0430\u0436\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u0432\u043e\u0439 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u043c. \u0441\u0442\u0430\u0442\u044c\u044e <a href=\"https:\/\/dtf.ru\/howto\/1268692-delaem-svoy-vpn-server-s-trafikom-32-tb-odnoy-komandoy\" rel=\"noopener noreferrer nofollow\"><u>\u0414\u0435\u043b\u0430\u0435\u043c \u0441\u0432\u043e\u0439 VPN-\u0441\u0435\u0440\u0432\u0435\u0440<\/u><\/a>). \u0421 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u043e\u043c \u0441\u043b\u043e\u0436\u043d\u0435\u0435. \u041b\u0438\u0431\u043e \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u043e\u043c\u0435\u0440 \u0432 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0435, \u0438\u043b\u0438 \u043f\u043e\u043f\u0440\u043e\u0441\u0438\u0442\u044c \u0437\u043d\u0430\u043a\u043e\u043c\u044b\u0445 \u0437\u0430 \u0433\u0440\u0430\u043d\u0438\u0446\u0435\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u0445 \u043d\u043e\u043c\u0435\u0440. \u0412 \u043a\u0440\u0430\u0439\u043d\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f (\u043d\u0435 \u043f\u0440\u043e\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u043e\u0439 \u044d\u043a\u0441\u043f\u043b\u0443\u0430\u0442\u0430\u0446\u0438\u0438) \u043c\u043e\u0436\u043d\u043e \u0430\u0440\u0435\u043d\u0434\u043e\u0432\u0430\u0442\u044c \u043d\u043e\u043c\u0435\u0440 (\u043f\u0440\u0438\u043c\u0435\u0440 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 <a href=\"https:\/\/habr.com\/ru\/articles\/704600\/\" rel=\"noopener noreferrer nofollow\"><u>\u041a\u0430\u043a \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a ChatGPT \u0432 \u0420\u043e\u0441\u0441\u0438\u0438<\/u><\/a>).<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438, \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u0439\u0442\u0438 \u0432 \u0432\u0430\u0448 \u0430\u043a\u043a\u0430\u0443\u043d\u0442 \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c OPENAI_API_KEY. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0443\u0439\u0442\u0435\u0441\u044c \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 OpenAI, \u0437\u0430\u0439\u0434\u0438\u0442\u0435 \u0432 \u0440\u0430\u0437\u0434\u0435\u043b \u043c\u0435\u043d\u044e \u201cView API keys\u201d.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/180\/052\/835\/1800528357aac79afabd077556d75eb1.png\" width=\"534\" height=\"397\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/180\/052\/835\/1800528357aac79afabd077556d75eb1.png\"\/><\/figure>\n<p>\u0417\u0430\u0442\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u0438 \u0441\u043a\u043e\u043f\u0438\u0440\u0443\u0439\u0442\u0435 \u043a\u043b\u044e\u0447. \u041a\u043b\u044e\u0447 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a:\u00a0 <\/p>\n<p><strong>sk-n0123456789buNKlMOOs1AEnIPQgUuoYeL0s9a1PG8mKe3xN<\/strong><\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/0e4\/75e\/19c\/0e475e19c0fb9855134fc01e67e74824.png\" width=\"919\" height=\"454\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/0e4\/75e\/19c\/0e475e19c0fb9855134fc01e67e74824.png\"\/><\/figure>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0434\u043b\u044f \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043d\u0430\u043c \u043d\u0443\u0436\u0435\u043d \u0441\u0435\u0440\u0432\u0435\u0440 (\u043e\u0431\u043b\u0430\u0447\u043d\u044b\u0439, \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439, \u0438\u043b\u0438 \u0441\u0432\u043e\u0439), \u0433\u0434\u0435 \u043c\u044b \u0438 \u0431\u0443\u0434\u0435\u043c \u0432\u0441\u0435 \u0434\u0435\u043b\u0430\u0442\u044c. \u041f\u0440\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0430\u0441\u044c \u0432\u0435\u0440\u0441\u0438\u044f &#171;Ubuntu 22.04.2 LTS&#187;. \u0412\u0437\u044f\u043b \u043e\u0431\u043b\u0430\u0447\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 \u043d\u0430 Timeweb. \u041f\u0440\u0438\u0447\u0438\u043d \u0434\u0432\u0435: \u0442\u0430\u043c \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440 \u0432 \u0415\u0432\u0440\u043e\u043f\u0435 (\u0442\u0435\u043c \u0441\u0430\u043c\u044b\u043c \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 VPN), \u0438 \u0437\u0430 \u044d\u0442\u043e\u0442 \u0441\u0435\u0440\u0432\u0435\u0440 \u043c\u043e\u0436\u043d\u043e \u043f\u043b\u0430\u0442\u0438\u0442\u044c \u0440\u0443\u0431\u043b\u044f\u043c\u0438 (\u0442\u043e \u0435\u0441\u0442\u044c \u043d\u0435 \u043d\u0443\u0436\u043d\u0430 \u0438\u043d\u043e\u0441\u0442\u0440\u0430\u043d\u043d\u0430\u044f \u043a\u0430\u0440\u0442\u043e\u0447\u043a\u0430). \u042f \u0437\u043d\u0430\u044e \u0447\u0442\u043e \u0435\u0441\u0442\u044c \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0442\u0430\u043a\u0438\u0435 \u0436\u0435 \u0443\u0441\u043b\u0443\u0433\u0438 (\u0435\u0441\u043b\u0438 \u0437\u043d\u0430\u0435\u0442\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043b\u0443\u0447\u0448\u0435 Timeweb, \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u043d\u0430\u043f\u0438\u0448\u0438\u0442\u0435 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445).<\/p>\n<p>\u0418\u0442\u0430\u043a, \u043d\u0430\u0447\u043d\u0435\u043c.<\/p>\n<h2>\u041f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Linux<\/h2>\n<p>\u0417\u0430\u0439\u0434\u0435\u043c \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 (\u0434\u043b\u044f \u0432\u0430\u0448\u0435\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043f\u0443\u043d\u043a\u0442 \u043c\u043e\u0436\u0435\u0442 \u043e\u0442\u043b\u0438\u0447\u0430\u0442\u044c\u0441\u044f).<\/p>\n<pre><code>ssh root@123.444.555.666 -p 22<\/code><\/pre>\n<p>\u041e\u0431\u043d\u043e\u0432\u0438\u043c \u0432\u0441\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u044b\u0435 \u043f\u0430\u043a\u0435\u0442\u044b \u0434\u043b\u044f apt.<\/p>\n<pre><code>apt update &amp;&amp; apt upgrade -y<\/code><\/pre>\n<p>\u0418 \u0434\u043b\u044f apt-get.<\/p>\n<pre><code>apt-get update &amp;&amp; apt-get upgrade -y<\/code><\/pre>\n<p>\u041d\u0430\u0441\u0442\u0440\u043e\u0438\u043c \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440 Nginx. \u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043c, \u0447\u0442\u043e \u043e\u043d \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d (\u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u0441\u044f \u0435\u0433\u043e \u0432\u0435\u0440\u0441\u0438\u044f).<\/p>\n<pre><code>nginx -v<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u043e\u043d \u043d\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d, \u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c.<\/p>\n<pre><code>apt install nginx -y<\/code><\/pre>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043c, \u0447\u0442\u043e \u043e\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442.<\/p>\n<pre><code>systemctl status nginx<\/code><\/pre>\n<p>\u0414\u043e\u043b\u0436\u043d\u043e \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c\u0441\u044f: <strong>Active: active (running)<\/strong>. <\/p>\n<p>\u041e\u0442\u043a\u0440\u043e\u0435\u043c \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 <strong>http:\/\/123.444.555.666\/<\/strong> \u0414\u043e\u043b\u0436\u043d\u043e \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c\u0441\u044f:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/525\/561\/19f\/52556119f5486bb60581043575606d48.png\" width=\"546\" height=\"235\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/525\/561\/19f\/52556119f5486bb60581043575606d48.png\"\/><\/figure>\n<h2>\u041f\u0440\u043e\u0435\u043a\u0442 \u0434\u043b\u044f Python (Flask)<\/h2>\n<p><em>\u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u043d\u0443\u0436\u0435\u043d Node.js (Next.js), \u0442\u043e \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u0440\u0430\u0437\u0443 \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u0440\u0430\u0437\u0434\u0435\u043b \u043f\u0440\u043e Python (Flask).<\/em><\/p>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043c, \u0447\u0442\u043e Python \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d. \u041e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c\u0441\u044f \u0435\u0433\u043e \u0432\u0435\u0440\u0441\u0438\u044f (\u0443 \u043c\u0435\u043d\u044f 3.10.6).<\/p>\n<pre><code>python3 --version<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u043d\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d &#8212; \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u044d\u0442\u043e.<\/p>\n<pre><code>apt install python3 -y<\/code><\/pre>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043c, \u0447\u0442\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d pip.<\/p>\n<pre><code>pip --version<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u043d\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d:<\/p>\n<pre><code>apt install python3-pip -y<\/code><\/pre>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u043c\u043e\u0434\u0443\u043b\u044c venv (\u0440\u0430\u0431\u043e\u0442\u0430 \u0432 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0440\u0435\u0434\u0435).<\/p>\n<pre><code>apt install python3-venv -y<\/code><\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0440\u043e\u0435\u043a\u0442 \u0432 \u043f\u0430\u043f\u043a\u0435 <strong>\/home<\/strong>. \u041f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u0432 \u044d\u0442\u0443 \u043f\u0430\u043f\u043a\u0443.<\/p>\n<pre><code>cd \/home<\/code><\/pre>\n<p>\u041a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u0434\u0435\u043c\u043e \u043f\u0440\u043e\u0435\u043a\u0442.<\/p>\n<pre><code>git clone https:\/\/github.com\/openai\/openai-quickstart-python.git<\/code><\/pre>\n<p>\u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432 \u043f\u0430\u043f\u043a\u0443 \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<\/p>\n<pre><code>cd openai-quickstart-python<\/code><\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u0443\u044e \u0441\u0440\u0435\u0434\u0443.<\/p>\n<pre><code>python -m venv venvopenai<\/code><\/pre>\n<p>\u0410\u043a\u0442\u0438\u0432\u0438\u0440\u0443\u0435\u043c \u0435\u0435.<\/p>\n<pre><code>. venvopenai\/bin\/activate<\/code><\/pre>\n<p>\u0412 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c\u0441\u044f (venvopenai).<\/p>\n<p>\u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u043f\u0430\u043a\u0435\u0442\u044b.<\/p>\n<pre><code>pip install -r requirements.txt<\/code><\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0444\u0430\u0439\u043b, \u043a\u0443\u0434\u0430 \u0432\u0441\u0442\u0430\u0432\u0438\u043c OPENAI_API_KEY<\/p>\n<pre><code>cp .env.example .env<\/code><\/pre>\n<p>\u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0435\u0433\u043e.<\/p>\n<pre><code>nano .env<\/code><\/pre>\n<p>\u0412\u043d\u0443\u0442\u0440\u0438 \u043d\u0435\u0433\u043e \u0431\u0443\u0434\u0435\u0442:<\/p>\n<pre><code class=\"bash\">FLASK_APP=app FLASK_ENV=development  # Once you add your API key below, make sure to not share it with anyone! The API key should remain private. OPENAI_API_KEY=<\/code><\/pre>\n<p>\u0412\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c OPENAI_API_KEY<\/p>\n<pre><code class=\"bash\">FLASK_APP=app FLASK_ENV=development  # Once you add your API key below, make sure to not share it with anyone! The API key should remain private. OPENAI_API_KEY=sk-n0123456789buNKlMOOs1AEnIPQgUuoYeL0s9a1PG8mKe3xN<\/code><\/pre>\n<p>\u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c: F2 -> Y -> Enter<\/p>\n<p>\u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c IP \u0438 \u043f\u043e\u0440\u0442 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430. \u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0444\u0430\u0439\u043b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<pre><code>nano app.py<\/code><\/pre>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u043a\u043e\u043d\u0446\u0435 \u0444\u0430\u0439\u043b\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"python\">\u2026  if __name__ == \"__main__\":     app.run(host='123.444.555.666', port=5000)<\/code><\/pre>\n<p>\u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c: F2 -> Y -> Enter<\/p>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0441\u0435\u0440\u0432\u0438\u0441.<\/p>\n<pre><code>python app.py<\/code><\/pre>\n<p>\u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 <strong>http:\/\/123.444.555.666:5000<\/strong><\/p>\n<p>\u041f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u043a\u043d\u043e \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430:<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/54b\/0e8\/50f\/54b0e850f5d3bc96ef6396fa0fcc8023.png\" width=\"355\" height=\"284\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/54b\/0e8\/50f\/54b0e850f5d3bc96ef6396fa0fcc8023.png\"\/><\/figure>\n<p>\u0421\u0443\u0442\u044c \u0434\u0435\u043c\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430: \u043c\u044b \u0432\u0432\u043e\u0434\u0438\u043c \u0438\u043c\u044f \u0436\u0438\u0432\u043e\u0442\u043d\u043e\u0433\u043e (\u043d\u0430 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u043e\u043c) \u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u043d\u0430\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0433\u0435\u0440\u043e\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0438\u043c\u0435\u043d \u0434\u043b\u044f \u043d\u0435\u0433\u043e.<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/ad8\/473\/1bc\/ad84731bc7a0a2510b994a5c86f31aa7.png\" width=\"495\" height=\"352\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ad8\/473\/1bc\/ad84731bc7a0a2510b994a5c86f31aa7.png\"\/><\/figure>\n<hr\/>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/497\/53e\/cd1\/49753ecd1199863e233ef10833f90220.png\" width=\"389\" height=\"345\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/497\/53e\/cd1\/49753ecd1199863e233ef10833f90220.png\"\/><\/figure>\n<hr\/>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/df8\/5b6\/0fd\/df85b60fda64edad89d28301693692cb.png\" width=\"391\" height=\"350\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/df8\/5b6\/0fd\/df85b60fda64edad89d28301693692cb.png\"\/><\/figure>\n<p>\u041e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0441\u0435\u0440\u0432\u0438\u0441 \u0438 \u0432\u044b\u0445\u043e\u0434\u0438\u043c \u0438\u0437 \u043d\u0435\u0433\u043e, \u043d\u0430\u0436\u0430\u0432 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0435 CTRL+C.<\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0434\u0435\u043c\u043e \u043f\u0440\u043e\u0435\u043a\u0442, \u0447\u0442\u043e\u0431\u044b \u0438\u043c\u0435\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0432\u0432\u043e\u0434\u0438\u0442\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u044b.<\/p>\n<p>\u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0444\u0430\u0439\u043b \u0441 html \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u043c.<\/p>\n<pre><code>nano templates\/index.html<\/code><\/pre>\n<p>\u041d\u0430\u0445\u043e\u0434\u0438\u043c \u0431\u043b\u043e\u043a:<\/p>\n<pre><code class=\"xml\">  &lt;img src=\"{{ url_for('static', filename='dog.png') }}\" class=\"icon\" \/>   &lt;h3>Name my pet&lt;\/h3>   &lt;form action=\"\/\" method=\"post\">     &lt;input type=\"text\" name=\"animal\" placeholder=\"Enter an animal\" required \/>     &lt;input type=\"submit\" value=\"Generate names\" \/>   &lt;\/form><\/code><\/pre>\n<p>\u0423\u0434\u0430\u043b\u044f\u0435\u043c \u0435\u0433\u043e. \u0412\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0432\u043c\u0435\u0441\u0442\u043e \u043d\u0435\u0433\u043e:<\/p>\n<pre><code class=\"xml\">  &lt;h3>\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0442\u0435\u043a\u0441\u0442&lt;\/h3>   &lt;form action=\"\/\" method=\"post\">     &lt;textarea rows=\"20\" cols=\"200\" name=\"animal\" placeholder=\"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0442\u0435\u043a\u0441\u0442\" required>&lt;\/textarea>     &lt;input type=\"submit\" value=\"Generate\" \/>   &lt;\/form><\/code><\/pre>\n<p>\u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c: F2 -> Y -> Enter<\/p>\n<p>\u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0444\u0430\u0439\u043b \u0441 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c.<\/p>\n<pre><code>nano app.py<\/code><\/pre>\n<p>\u041d\u0430\u0445\u043e\u0434\u0438\u043c \u0431\u043b\u043e\u043a:<\/p>\n<pre><code class=\"python\">        response = openai.Completion.create(             model=\"text-davinci-003\",             prompt=generate_prompt(animal),             temperature=0.6,         )<\/code><\/pre>\n<p>\u0412\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u043d\u0435\u0433\u043e \u0441\u0442\u0440\u043e\u043a\u0443: <strong>max_tokens=4000,<\/strong><\/p>\n<pre><code class=\"python\">        response = openai.Completion.create(             model=\"text-davinci-003\",             prompt=generate_prompt(animal),             temperature=0.6,             max_tokens=4000,         )<\/code><\/pre>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0436\u0435 \u0444\u0430\u0439\u043b\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e:<\/p>\n<pre><code class=\"python\">def generate_prompt(animal):     return \"\"\"Suggest three names for an animal that is a superhero.  Animal: Cat Names: Captain Sharpclaw, Agent Fluffball, The Incredible Feline Animal: Dog Names: Ruff the Protector, Wonder Canine, Sir Barks-a-Lot Animal: {} Names:\"\"\".format(         animal.capitalize()     )<\/code><\/pre>\n<p>\u0423\u0434\u0430\u043b\u044f\u0435\u043c \u0435\u0435. \u0412\u043c\u0435\u0441\u0442\u043e \u043d\u0435\u0451 \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c:<\/p>\n<pre><code class=\"python\">def generate_prompt(animal):     return \"\"\"{} \"\"\".format(         animal.capitalize()     )<\/code><\/pre>\n<p>\u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c: F2 -> Y -> Enter<\/p>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0441\u0435\u0440\u0432\u0438\u0441.<\/p>\n<pre><code>python app.py<\/code><\/pre>\n<p>\u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 <strong>http:\/\/123.444.555.666:5000<\/strong><\/p>\n<p>\u0412\u0438\u0434\u0438\u043c \u043e\u043a\u043d\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u043d\u043e \u0441 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e \u0432\u0432\u043e\u0434\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u0430:<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/f82\/ab5\/bf5\/f82ab5bf576d3a2cc87a0c3d03738010.png\" width=\"376\" height=\"467\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f82\/ab5\/bf5\/f82ab5bf576d3a2cc87a0c3d03738010.png\"\/><\/figure>\n<p>\u0412\u0432\u043e\u0434\u0438\u043c \u0432\u043e\u043f\u0440\u043e\u0441 \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043e\u0442\u0432\u0435\u0442:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/291\/493\/bc9\/291493bc965988b2c4a0d13e08121b68.png\" width=\"981\" height=\"608\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/291\/493\/bc9\/291493bc965988b2c4a0d13e08121b68.png\"\/><\/figure>\n<p>\u0427\u0442\u043e\u0431\u044b \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441 \u0438 \u0432\u044b\u0439\u0442\u0438, \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u043c CTRL+C.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0432\u044b\u0439\u0442\u0438 \u0438\u0437 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0440\u0435\u0434\u044b \u0432\u0432\u043e\u0434\u0438\u043c:<\/p>\n<pre><code>deactivate<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0432 ChatGPT \u043f\u043e API, \u0438 \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430 Python.<\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0435\u043c \u0442\u0430\u043a\u043e\u0439 \u0436\u0435 \u043f\u0440\u043e\u0435\u043a\u0442 \u0434\u043b\u044f Node.js. \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u044f \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043f\u0440\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b API \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 (\u0435\u0441\u043b\u0438 Node.js \u0432\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u0435\u043d, \u0442\u043e \u0441\u0440\u0430\u0437\u0443 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442\u0435 \u043a \u0440\u0430\u0437\u0434\u0435\u043b\u0443 \u043f\u0440\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b).<\/p>\n<h2>\u041f\u0440\u043e\u0435\u043a\u0442 \u0434\u043b\u044f Node.js (Next.js)<\/h2>\n<p>\u0414\u043b\u044f \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u0430 Node.js \u0441 \u0432\u0435\u0440\u0441\u0438\u0435\u0439 >= 14.6.0.<\/p>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043c, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u043b\u0438 node.<\/p>\n<pre><code>node -v<\/code><\/pre>\n<p>\u0418 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u043b\u0438 npm.<\/p>\n<pre><code>npm -v<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f, \u043a\u0430\u043a \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c Node.js \u0432\u0435\u0440\u0441\u0438\u0438 18.<\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 NodeSource.<\/p>\n<pre><code>curl -fsSL https:\/\/deb.nodesource.com\/setup_18.x | sudo -E bash -<\/code><\/pre>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c node \u0438 npm.<\/p>\n<pre><code>apt-get install nodejs -y<\/code><\/pre>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043c, \u0447\u0442\u043e node \u043d\u0443\u0436\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d.<\/p>\n<pre><code>node -v<\/code><\/pre>\n<p>\u0418 \u0447\u0442\u043e npm \u0442\u043e\u0436\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d.<\/p>\n<pre><code>npm -v<\/code><\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0440\u043e\u0435\u043a\u0442 \u0432 \u043f\u0430\u043f\u043a\u0435 <strong>\/home<\/strong>. \u041f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u0432 \u044d\u0442\u0443 \u043f\u0430\u043f\u043a\u0443.<\/p>\n<pre><code>cd \/home<\/code><\/pre>\n<p>\u041a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u0434\u0435\u043c\u043e \u043f\u0440\u043e\u0435\u043a\u0442.<\/p>\n<pre><code>git clone https:\/\/github.com\/openai\/openai-quickstart-node.git<\/code><\/pre>\n<p>\u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432 \u043f\u0430\u043f\u043a\u0443 \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<\/p>\n<pre><code>cd openai-quickstart-node<\/code><\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0444\u0430\u0439\u043b, \u043a\u0443\u0434\u0430 \u0432\u0441\u0442\u0430\u0432\u0438\u043c OPENAI_API_KEY<\/p>\n<pre><code>cp .env.example .env<\/code><\/pre>\n<p>\u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0435\u0433\u043e.<\/p>\n<pre><code>nano .env<\/code><\/pre>\n<p>\u0412\u043d\u0443\u0442\u0440\u0438 \u043d\u0435\u0433\u043e \u0431\u0443\u0434\u0435\u0442:<\/p>\n<pre><code class=\"bash\"># Do not share your OpenAI API key with anyone! It should remain a secret. OPENAI_API_KEY=<\/code><\/pre>\n<p>\u0412\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c OPENAI_API_KEY<\/p>\n<pre><code class=\"bash\"># Do not share your OpenAI API key with anyone! It should remain a secret. OPENAI_API_KEY=sk-n0123456789buNKlMOOs1AEnIPQgUuoYeL0s9a1PG8mKe3xN<\/code><\/pre>\n<p>\u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c: F2 -> Y -> Enter<\/p>\n<p>\u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043d\u0443\u0436\u043d\u044b\u0439 IP \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430. \u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c:<\/p>\n<pre><code>nano package.json<\/code><\/pre>\n<p>\u041d\u0430\u0445\u043e\u0434\u0438\u043c \u0441\u0442\u0440\u043e\u043a\u0443: <strong>&#171;dev&#187;: &#171;next dev&#187;,<\/strong><\/p>\n<pre><code class=\"json\">{   \"name\": \"openai-quickstart-node\",   \"version\": \"0.1.0\",   \"private\": true,   \"scripts\": {     \"dev\": \"next dev\",     \"build\": \"next build\",     \"start\": \"next start\"   },   \"dependencies\": {     \"next\": \"^13.1.1\",     \"openai\": \"^3.1.0\",     \"react\": \"^18.2.0\",     \"react-dom\": \"^18.2.0\"   },   \"engines\": {     \"node\": \">=14.6.0\"   } }<\/code><\/pre>\n<p>\u0417\u0430\u043c\u0435\u043d\u044f\u0435\u043c \u0435\u0435 \u043d\u0430 <strong>&#171;dev&#187;: &#171;next dev -H 123.444.555.666&#187;,<\/strong><\/p>\n<pre><code class=\"json\">{   \"name\": \"openai-quickstart-node\",   \"version\": \"0.1.0\",   \"private\": true,   \"scripts\": {     \"dev\": \"next dev -H 123.444.555.666\",     \"build\": \"next build\",     \"start\": \"next start\"   },   \"dependencies\": {     \"next\": \"^13.1.1\",     \"openai\": \"^3.1.0\",     \"react\": \"^18.2.0\",     \"react-dom\": \"^18.2.0\"   },   \"engines\": {     \"node\": \">=14.6.0\"   } }<\/code><\/pre>\n<p>\u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c: F2 -> Y -> Enter<\/p>\n<p>\u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u043f\u0430\u043a\u0435\u0442\u044b.<\/p>\n<pre><code>npm install<\/code><\/pre>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0441\u0435\u0440\u0432\u0438\u0441.<\/p>\n<pre><code>npm run dev<\/code><\/pre>\n<p>\u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 <strong>http:\/\/123.444.555.666:3000<\/strong><\/p>\n<p>\u0412\u0438\u0434\u0438\u043c \u043e\u043a\u043d\u043e \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430:<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/cb8\/375\/a59\/cb8375a59e785bfafe5f94ab59fcfaec.png\" width=\"355\" height=\"284\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/cb8\/375\/a59\/cb8375a59e785bfafe5f94ab59fcfaec.png\"\/><\/figure>\n<p>\u0421\u0443\u0442\u044c \u0434\u0435\u043c\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 &#8212; \u043c\u044b \u0432\u0432\u043e\u0434\u0438\u043c \u0438\u043c\u044f \u0436\u0438\u0432\u043e\u0442\u043d\u043e\u0433\u043e (\u043d\u0430 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u043e\u043c) \u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u043d\u0430\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0433\u0435\u0440\u043e\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0438\u043c\u0435\u043d \u0434\u043b\u044f \u043d\u0435\u0433\u043e:<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/89b\/dcd\/118\/89bdcd1187f7f476b8817cc3cef5d651.png\" width=\"449\" height=\"352\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/89b\/dcd\/118\/89bdcd1187f7f476b8817cc3cef5d651.png\"\/><\/figure>\n<hr\/>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/cab\/319\/532\/cab319532485565de284b4c299f8e54e.png\" width=\"440\" height=\"352\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/cab\/319\/532\/cab319532485565de284b4c299f8e54e.png\"\/><\/figure>\n<hr\/>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/272\/d85\/dc5\/272d85dc5382238b9dfcbca9aa96a265.png\" width=\"387\" height=\"350\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/272\/d85\/dc5\/272d85dc5382238b9dfcbca9aa96a265.png\"\/><\/figure>\n<p>\u0427\u0442\u043e\u0431\u044b \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441 \u0438 \u0432\u044b\u0439\u0442\u0438, \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u0442 CTRL+C<\/p>\n<p>\u0414\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u043c \u0434\u0435\u043c\u043e \u043f\u0440\u043e\u0435\u043a\u0442, \u0447\u0442\u043e\u0431\u044b \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0432\u0432\u043e\u0434\u0438\u0442\u044c \u0441\u0432\u043e\u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b.<\/p>\n<p>\u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0444\u0430\u0439\u043b, \u0433\u0434\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u043c html \u0448\u0430\u0431\u043b\u043e\u043d.<\/p>\n<pre><code>nano pages\/index.js<\/code><\/pre>\n<p>\u041d\u0430\u0445\u043e\u0434\u0438\u043c \u0431\u043b\u043e\u043a<\/p>\n<pre><code class=\"javascript\">        &lt;img src=\"\/dog.png\" className={styles.icon} \/>         &lt;h3>Name my pet&lt;\/h3>         &lt;form onSubmit={onSubmit}>           &lt;input             type=\"text\"             name=\"animal\"             placeholder=\"Enter an animal\"             value={animalInput}             onChange={(e) => setAnimalInput(e.target.value)}           \/>           &lt;input type=\"submit\" value=\"Generate names\" \/>         &lt;\/form><\/code><\/pre>\n<p>\u0423\u0434\u0430\u043b\u044f\u0435\u043c \u0435\u0433\u043e. \u0412\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0432\u043c\u0435\u0441\u0442\u043e \u043d\u0435\u0433\u043e:<\/p>\n<pre><code class=\"javascript\">        &lt;h3>\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0442\u0435\u043a\u0441\u0442&lt;\/h3>         &lt;form onSubmit={onSubmit}>           &lt;textarea             name=\"animal\"             placeholder=\"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0442\u0435\u043a\u0441\u0442\"             value={animalInput}             onChange={(e) => setAnimalInput(e.target.value)}             rows=\"20\"             cols=\"200\"           \/>           &lt;input type=\"submit\" value=\"Generate\" \/>         &lt;\/form><\/code><\/pre>\n<p>\u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c: F2 -> Y -> Enter<\/p>\n<p>\u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0444\u0430\u0439\u043b, \u0433\u0434\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u043c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0434\u043b\u044f API \u0437\u0430\u043f\u0440\u043e\u0441\u0430.<\/p>\n<pre><code>nano pages\/api\/generate.js<\/code><\/pre>\n<p>\u041d\u0430\u0445\u043e\u0434\u0438\u043c \u0431\u043b\u043e\u043a:<\/p>\n<pre><code class=\"javascript\">    const completion = await openai.createCompletion({       model: \"text-davinci-003\",       prompt: generatePrompt(animal),       temperature: 0.6,     });<\/code><\/pre>\n<p>\u0412\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u043d\u0435\u0433\u043e \u0441\u0442\u0440\u043e\u043a\u0443: <strong>max_tokens: 4000,<\/strong><\/p>\n<pre><code class=\"javascript\">    const completion = await openai.createCompletion({       model: \"text-davinci-003\",       prompt: generatePrompt(animal),       temperature: 0.6,       max_tokens: 4000,     });<\/code><\/pre>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0436\u0435 \u0444\u0430\u0439\u043b\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e:<\/p>\n<pre><code class=\"javascript\">function generatePrompt(animal) {   const capitalizedAnimal =     animal[0].toUpperCase() + animal.slice(1).toLowerCase();   return `Suggest three names for an animal that is a superhero.  Animal: Cat Names: Captain Sharpclaw, Agent Fluffball, The Incredible Feline Animal: Dog Names: Ruff the Protector, Wonder Canine, Sir Barks-a-Lot Animal: ${capitalizedAnimal} Names:`; }<\/code><\/pre>\n<p>\u0423\u0434\u0430\u043b\u044f\u0435\u043c \u0435\u0435. \u0412\u043c\u0435\u0441\u0442\u043e \u043d\u0435 \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c:<\/p>\n<pre><code class=\"javascript\">function generatePrompt(animal) {   const capitalizedAnimal =     animal[0].toUpperCase() + animal.slice(1).toLowerCase();   return `${capitalizedAnimal}`; }<\/code><\/pre>\n<p>\u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c: F2 -> Y -> Enter<\/p>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0441\u0435\u0440\u0432\u0438\u0441.<\/p>\n<pre><code>npm run dev<\/code><\/pre>\n<p>\u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 <strong>http:\/\/123.444.555.666:3000<\/strong><\/p>\n<p>\u0412\u0438\u0434\u0438\u043c \u043e\u043a\u043d\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u043d\u043e \u0441 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e \u0432\u0432\u043e\u0434\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u0430:<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/70e\/f8a\/1ac\/70ef8a1acc686e959fb9d0f5fdaaff7e.png\" width=\"376\" height=\"467\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/70e\/f8a\/1ac\/70ef8a1acc686e959fb9d0f5fdaaff7e.png\"\/><\/figure>\n<p>\u0412\u0432\u043e\u0434\u0438\u043c \u0432\u043e\u043f\u0440\u043e\u0441 \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043e\u0442\u0432\u0435\u0442:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/77a\/f8b\/ab8\/77af8bab8031d9b41198cad814d032f0.png\" width=\"980\" height=\"583\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/77a\/f8b\/ab8\/77af8bab8031d9b41198cad814d032f0.png\"\/><\/figure>\n<p>\u0427\u0442\u043e\u0431\u044b \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441 \u0438 \u0432\u044b\u0439\u0442\u0438, \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u043c CTRL+C.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0432 ChatGPT \u043f\u043e API, \u0438 \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430 Node.js. \u0414\u0430\u043b\u0435\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b API \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u043c\u043e\u0434\u0435\u043b\u0435\u0439.<\/p>\n<h2>\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b API \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u043c\u043e\u0434\u0435\u043b\u0435\u0439<\/h2>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b API \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432.<\/p>\n<p>\u0414\u043b\u044f Python (Flask) \u044d\u0442\u043e \u0444\u0430\u0439\u043b <strong>openai-quickstart-python\/app.py<\/strong> \u0438 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"python\">        response = openai.Completion.create(             model=\"text-davinci-003\",             prompt=generate_prompt(animal),             temperature=0.6,             max_tokens=4000,         )<\/code><\/pre>\n<p>\u0414\u043b\u044f Node.js (Next.js) \u044d\u0442\u043e \u0444\u0430\u0439\u043b <strong>openai-quickstart-node\/pages\/api\/generate.js<\/strong> \u0438 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"javascript\">    const completion = await openai.createCompletion({       model: \"text-davinci-003\",       prompt: generatePrompt(animal),       temperature: 0.6,       max_tokens: 4000,     });<\/code><\/pre>\n<p>\u0423 ChatGPT \u0435\u0441\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438. \u0418\u0445 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0437\u0434\u0435\u0441\u044c: <a href=\"https:\/\/platform.openai.com\/docs\/models\" rel=\"noopener noreferrer nofollow\"><u>Models<\/u><\/a>. \u041a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0434\u0435\u043c\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043c\u043e\u0434\u0435\u043b\u044c <strong>text-davinci-003<\/strong>. \u0415\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435:<\/p>\n<ul>\n<li>\n<p>Can do any language task with better quality, longer output, and consistent instruction-following than the curie, babbage, or ada models. Also supports inserting completions within text.<\/p>\n<\/li>\n<li>\n<p>\u041c\u043e\u0436\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043b\u044e\u0431\u0443\u044e \u044f\u0437\u044b\u043a\u043e\u0432\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443 \u0441 \u043b\u0443\u0447\u0448\u0438\u043c \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e\u043c, \u0431\u043e\u043b\u0435\u0435 \u0434\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u0432\u044b\u0432\u043e\u0434\u043e\u043c \u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435\u043c \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439, \u0447\u0435\u043c \u043c\u043e\u0434\u0435\u043b\u0438 \u041a\u044e\u0440\u0438, \u0411\u044d\u0431\u0431\u0438\u0434\u0436\u0430 \u0438\u043b\u0438 \u0410\u0434\u0430. \u0422\u0430\u043a\u0436\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0432\u0441\u0442\u0430\u0432\u043a\u0443 \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0439 \u0432 \u0442\u0435\u043a\u0441\u0442.<\/p>\n<\/li>\n<\/ul>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0443 \u043c\u043e\u0434\u0435\u043b\u0438 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0442\u043e\u043a\u0435\u043d\u043e\u0432. \u0418\u0445 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0434\u043b\u0438\u043d\u0443 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0438 \u043e\u0442\u0432\u0435\u0442\u0430.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u043e\u0442\u0432\u0435\u0442\u0430 \u043f\u0440\u0438 <strong>max_tokens=4000<\/strong><\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/87c\/c36\/fce\/87cc36fced82bad267fab39cd59e63ec.png\" width=\"974\" height=\"557\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/87c\/c36\/fce\/87cc36fced82bad267fab39cd59e63ec.png\"\/><\/figure>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u043e\u0442\u0432\u0435\u0442\u0430 \u043f\u0440\u0438 <strong>max_tokens=100<\/strong><\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/683\/472\/076\/683472076aa254ebdae1dd3b4cc43cff.png\" width=\"971\" height=\"531\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/683\/472\/076\/683472076aa254ebdae1dd3b4cc43cff.png\"\/><\/figure>\n<p>\u0422\u043e\u0447\u043d\u0435\u0435, \u0435\u0441\u043b\u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043c\u0430\u043b\u043e \u0442\u043e\u043a\u0435\u043d\u043e\u0432, \u0432\u044b \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 \u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0439 \u043e\u0442\u0432\u0435\u0442. \u041e\u043d \u043f\u0440\u043e\u0441\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u0440\u0435\u0437\u0430\u043d, \u043a\u0430\u043a \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0432\u044b\u0448\u0435. \u041c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0442\u043e\u043a\u0435\u043d\u043e\u0432 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0437\u0434\u0435\u0441\u044c: <a href=\"https:\/\/platform.openai.com\/docs\/models\" rel=\"noopener noreferrer nofollow\"><u>Models<\/u><\/a>. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 <strong>text-davinci-003: MAX TOKENS = 4,097 tokens<\/strong>.<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 &#8212; temperature. \u041d\u0430 \u0441\u0430\u0439\u0442\u0435 OpenAI \u043f\u0440\u043e \u043d\u0435\u0433\u043e \u0441\u043a\u0430\u0437\u0430\u043d\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<ul>\n<li>\n<p>OpenAI models are non-deterministic, meaning that identical inputs can yield different outputs. Setting temperature to 0 will make the outputs mostly deterministic, but a small amount of variability may remain.<\/p>\n<\/li>\n<li>\n<p>\u041c\u043e\u0434\u0435\u043b\u0438 OpenAI \u043d\u0435\u0434\u0435\u0442\u0435\u0440\u043c\u0438\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u044b, \u0430 \u044d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0435 \u0432\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u0440\u0430\u0437\u043d\u044b\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u043c. \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u044b \u043d\u0430 0 \u0441\u0434\u0435\u043b\u0430\u0435\u0442 \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0434\u0435\u0442\u0435\u0440\u043c\u0438\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438, \u043d\u043e \u043c\u043e\u0436\u0435\u0442 \u043e\u0441\u0442\u0430\u0442\u044c\u0441\u044f \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0438\u0437\u043c\u0435\u043d\u0447\u0438\u0432\u043e\u0441\u0442\u044c.<\/p>\n<\/li>\n<\/ul>\n<p>\u0422\u043e \u0435\u0441\u0442\u044c \u0435\u0441\u043b\u0438 \u0443\u043a\u0430\u0436\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <strong>temperature=0<\/strong> \u0438 \u0437\u0430\u0434\u0430\u0434\u0438\u043c \u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435 \u0432\u043e\u043f\u0440\u043e\u0441 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437 \u043f\u043e\u0434\u0440\u044f\u0434, \u0442\u043e \u043e\u0442\u0432\u0435\u0442 \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u0431\u0443\u0434\u0435\u0442 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0439. \u0415\u0441\u043b\u0438 \u0443\u043a\u0430\u0436\u0435\u043c <strong>temperature=1<\/strong> &#8212; \u043d\u0430 \u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435 \u0432\u043e\u043f\u0440\u043e\u0441 \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u0432\u044b\u0434\u0430\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u0435 \u043e\u0442\u0432\u0435\u0442\u044b. \u0412 \u043d\u0430\u0448\u0435\u043c \u0434\u0435\u043c\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0443 \u043d\u0430\u0441 \u0431\u044b\u043b\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <strong>temperature=0.6<\/strong>.<\/p>\n<hr\/>\n<p>\u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043d\u0430 \u044d\u0442\u043e\u043c \u0432\u0441\u0435. \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044e \u0432\u0441\u0435\u0445, \u043a\u0442\u043e \u0443\u0434\u0435\u043b\u0438\u043b \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043c\u043e\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u0437\u043d\u0430\u0435\u0442\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u0440\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 API &#8212; \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u043d\u0430\u043f\u0438\u0448\u0438\u0442\u0435 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445 \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0445\u043e\u0440\u043e\u0448\u0438\u0435 \u0441\u0442\u0430\u0442\u044c\u0438 \u043e\u0431 \u044d\u0442\u043e\u043c (\u043d\u0430 \u0440\u0443\u0441\u0441\u043a\u043e\u043c \u0438\u043b\u0438 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u043e\u043c). \u0411\u0443\u0434\u0443 \u043e\u0447\u0435\u043d\u044c \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u0435\u043d.<\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0432\u043e\u043f\u0440\u043e\u0441\u044b &#8212; \u043f\u0438\u0448\u0438\u0442\u0435 \u0432 \u043b\u0438\u0447\u043a\u0443. \u041e\u0442\u0432\u0435\u0447\u0443 \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u0441\u0432\u043e\u0438\u0445 \u0437\u043d\u0430\u043d\u0438\u0439 \u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439.<\/p>\n<p>***<\/p>\n<p>\u0410\u043b\u0435\u043a\u0441\u0435\u0439 \u0427\u0438\u0436\u043e\u0432<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/vk.com\/chizhovav88\" rel=\"noopener noreferrer nofollow\"><u>vk.com\/chizhovav88<\/u><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/t.me\/chizhovav88\" rel=\"noopener noreferrer nofollow\"><u>t.me\/chizhovav88<\/u><\/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\/729438\/\"> https:\/\/habr.com\/ru\/articles\/729438\/<\/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>ChatGPT \u043d\u0430\u0431\u0438\u0440\u0430\u0435\u0442 \u0432\u0441\u0435 \u0431\u043e\u043b\u044c\u0448\u0443\u044e \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u0441\u0442\u044c, \u0432\u0435\u0434\u044c \u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043c\u043e\u0447\u044c \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0443 \u0438\u043b\u0438 \u0434\u0430\u0436\u0435 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0435\u0433\u043e \u0432 \u0440\u044f\u0434\u0435 \u0437\u0430\u0434\u0430\u0447. \u0421 \u043d\u0438\u043c \u043c\u043e\u0436\u043d\u043e \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0435\u0440\u0435\u0437 \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441, \u043d\u043e \u0438 \u043f\u043e API. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u0432 \u0441\u0432\u043e\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u0447\u0442\u043e\u0431\u044b \u0440\u0435\u0448\u0430\u0442\u044c \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u0431\u0438\u0437\u043d\u0435\u0441\u0430. \u0421\u0435\u0439\u0447\u0430\u0441 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442. \u0420\u0435\u0448\u0438\u043b \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0442\u0430\u0442\u044c\u044e, \u0433\u0434\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0438 \u043f\u043e\u0448\u0430\u0433\u043e\u0432\u043e \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e, \u043a\u0430\u043a \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440 Linux (Ubuntu) \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u043f\u043e API \u0441 \u0434\u0430\u043d\u043d\u043e\u0439 \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u044c\u044e, \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 Python (Flask) \u0438 Node.js (Next.js). \u041e\u043f\u044f\u0442\u044c \u0436\u0435, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0435 Ubuntu, \u043d\u0435 Flask \u0438 \u043d\u0435 Next.js, \u043f\u0440\u043e\u0441\u0442\u043e \u0430\u0434\u0430\u043f\u0442\u0438\u0440\u043e\u0432\u0430\u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043f\u043e\u0434 \u0441\u0435\u0431\u044f.<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u043e, \u043a\u0430\u043a \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0434\u0435\u043c\u043e \u043f\u0440\u043e\u0435\u043a\u0442 \u043e\u0442 OpenAI (\u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0437\u0434\u0435\u0441\u044c: <a href=\"https:\/\/platform.openai.com\/docs\/quickstart\/build-your-application\" rel=\"noopener noreferrer nofollow\"><u>Build your application<\/u><\/a>), \u0430 \u0437\u0430\u0442\u0435\u043c \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0435\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0438 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u044b, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0438 \u043d\u0430 \u0440\u0443\u0441\u0441\u043a\u043e\u043c. \u0422\u0430\u043a\u0436\u0435 \u0432 \u043a\u043e\u043d\u0446\u0435 \u0441\u0442\u0430\u0442\u044c\u0438 \u0441\u043a\u0430\u0436\u0443 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u0440\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b API \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u043c\u043e\u0434\u0435\u043b\u0438. \u0412\u0441\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0431\u0443\u0434\u0443\u0442 \u0438\u0437 \u043a\u043e\u043d\u0441\u043e\u043b\u0438.<\/p>\n<p>\u0421\u0442\u0430\u0442\u044c\u044f \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0440\u0430\u0437\u0434\u0435\u043b\u043e\u0432:<\/p>\n<ol>\n<li>\n<p><strong>\u041f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Linux.<\/strong> \u0422\u043e \u0435\u0441\u0442\u044c \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u0437\u044f\u0442\u044c \u0447\u0438\u0441\u0442\u044b\u0439 Linux \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u043e \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0434\u043b\u044f \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<\/p>\n<\/li>\n<li>\n<p><strong>\u041f\u0440\u043e\u0435\u043a\u0442 \u0434\u043b\u044f Python.<\/strong> \u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0434\u0435\u043c\u043e \u043f\u0440\u043e\u0435\u043a\u0442 \u0434\u043b\u044f Python (Flask). \u0410 \u0437\u0430\u0442\u0435\u043c \u043a\u0430\u043a \u0435\u0433\u043e \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0434\u043b\u044f \u0441\u0432\u043e\u0438\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432.<\/p>\n<\/li>\n<li>\n<p><strong>\u041f\u0440\u043e\u0435\u043a\u0442 \u0434\u043b\u044f Node.js.<\/strong> \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043f\u043e \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044e \u0434\u0435\u043c\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0443\u0436\u0435 \u0434\u043b\u044f Node.js (Next.js). \u0418 \u0437\u0430\u0442\u0435\u043c \u0442\u0430\u043a\u0436\u0435 \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043f\u043e\u0434 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b.<\/p>\n<\/li>\n<li>\n<p><strong>\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b API \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u043c\u043e\u0434\u0435\u043b\u0435\u0439.<\/strong> \u041f\u043e\u043b\u0435\u0437\u043d\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043d\u0443\u0436\u043d\u0430 \u0434\u043b\u044f \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f ChatGPT, \u043f\u0440\u0438 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u0441 \u043d\u0438\u043c \u043f\u043e API.<\/p>\n<\/li>\n<li>\n<p>\u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u043d\u043e\u0441\u0442\u0438 \u0442\u0435\u043c \u043a\u0442\u043e \u0434\u043e\u0447\u0438\u0442\u0430\u043b. \u041c\u043e\u0438 \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u044b, \u0435\u0441\u043b\u0438 \u0445\u043e\u0442\u0438\u0442\u0435 \u0437\u0430\u0434\u0430\u0442\u044c \u0432\u043e\u043f\u0440\u043e\u0441.<\/p>\n<\/li>\n<\/ol>\n<p>\u0427\u0442\u043e\u0431\u044b \u043d\u0430\u0447\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 ChatGPT, \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 <a href=\"https:\/\/openai.com\/\" rel=\"noopener noreferrer nofollow\"><u>OpenAI<\/u><\/a>. \u041f\u0440\u0438 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u043f\u0440\u0438\u0434\u0435\u0442 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0435 \u043f\u043e \u0441\u043c\u0441. OpenAI \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432 \u0420\u043e\u0441\u0441\u0438\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f VPN \u0438 \u0442\u0435\u043b\u0435\u0444\u043e\u043d \u0441 \u043d\u043e\u043c\u0435\u0440\u043e\u043c \u0432\u043d\u0435 \u0420\u0424. \u0426\u0435\u043b\u044c \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u044e &#8212; \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0438\u043c\u0435\u043d\u043d\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043f\u043e API, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u043d\u0435 \u0431\u0443\u0434\u0443 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0440\u0430\u0441\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c, \u043a\u0430\u043a \u0440\u0435\u0448\u0438\u0442\u044c \u0432\u043e\u043f\u0440\u043e\u0441 \u0441 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0435\u0439. \u0415\u0441\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u0441\u0442\u0430\u0442\u0435\u0439, \u043a\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u0442\u044c VPN, \u043c\u043e\u0436\u043d\u043e \u0434\u0430\u0436\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u0432\u043e\u0439 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u043c. \u0441\u0442\u0430\u0442\u044c\u044e <a href=\"https:\/\/dtf.ru\/howto\/1268692-delaem-svoy-vpn-server-s-trafikom-32-tb-odnoy-komandoy\" rel=\"noopener noreferrer nofollow\"><u>\u0414\u0435\u043b\u0430\u0435\u043c \u0441\u0432\u043e\u0439 VPN-\u0441\u0435\u0440\u0432\u0435\u0440<\/u><\/a>). \u0421 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u043e\u043c \u0441\u043b\u043e\u0436\u043d\u0435\u0435. \u041b\u0438\u0431\u043e \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u043e\u043c\u0435\u0440 \u0432 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0435, \u0438\u043b\u0438 \u043f\u043e\u043f\u0440\u043e\u0441\u0438\u0442\u044c \u0437\u043d\u0430\u043a\u043e\u043c\u044b\u0445 \u0437\u0430 \u0433\u0440\u0430\u043d\u0438\u0446\u0435\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u0445 \u043d\u043e\u043c\u0435\u0440. \u0412 \u043a\u0440\u0430\u0439\u043d\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f (\u043d\u0435 \u043f\u0440\u043e\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u043e\u0439 \u044d\u043a\u0441\u043f\u043b\u0443\u0430\u0442\u0430\u0446\u0438\u0438) \u043c\u043e\u0436\u043d\u043e \u0430\u0440\u0435\u043d\u0434\u043e\u0432\u0430\u0442\u044c \u043d\u043e\u043c\u0435\u0440 (\u043f\u0440\u0438\u043c\u0435\u0440 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 <a href=\"https:\/\/habr.com\/ru\/articles\/704600\/\" rel=\"noopener noreferrer nofollow\"><u>\u041a\u0430\u043a \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a ChatGPT \u0432 \u0420\u043e\u0441\u0441\u0438\u0438<\/u><\/a>).<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438, \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u0439\u0442\u0438 \u0432 \u0432\u0430\u0448 \u0430\u043a\u043a\u0430\u0443\u043d\u0442 \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c OPENAI_API_KEY. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0443\u0439\u0442\u0435\u0441\u044c \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 OpenAI, \u0437\u0430\u0439\u0434\u0438\u0442\u0435 \u0432 \u0440\u0430\u0437\u0434\u0435\u043b \u043c\u0435\u043d\u044e \u201cView API keys\u201d.<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0417\u0430\u0442\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u0438 \u0441\u043a\u043e\u043f\u0438\u0440\u0443\u0439\u0442\u0435 \u043a\u043b\u044e\u0447. \u041a\u043b\u044e\u0447 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a:\u00a0 <\/p>\n<p><strong>sk-n0123456789buNKlMOOs1AEnIPQgUuoYeL0s9a1PG8mKe3xN<\/strong><\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0434\u043b\u044f \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043d\u0430\u043c \u043d\u0443\u0436\u0435\u043d \u0441\u0435\u0440\u0432\u0435\u0440 (\u043e\u0431\u043b\u0430\u0447\u043d\u044b\u0439, \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439, \u0438\u043b\u0438 \u0441\u0432\u043e\u0439), \u0433\u0434\u0435 \u043c\u044b \u0438 \u0431\u0443\u0434\u0435\u043c \u0432\u0441\u0435 \u0434\u0435\u043b\u0430\u0442\u044c. \u041f\u0440\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0430\u0441\u044c \u0432\u0435\u0440\u0441\u0438\u044f &#171;Ubuntu 22.04.2 LTS&#187;. \u0412\u0437\u044f\u043b \u043e\u0431\u043b\u0430\u0447\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 \u043d\u0430 Timeweb. \u041f\u0440\u0438\u0447\u0438\u043d \u0434\u0432\u0435: \u0442\u0430\u043c \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440 \u0432 \u0415\u0432\u0440\u043e\u043f\u0435 (\u0442\u0435\u043c \u0441\u0430\u043c\u044b\u043c \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 VPN), \u0438 \u0437\u0430 \u044d\u0442\u043e\u0442 \u0441\u0435\u0440\u0432\u0435\u0440 \u043c\u043e\u0436\u043d\u043e \u043f\u043b\u0430\u0442\u0438\u0442\u044c \u0440\u0443\u0431\u043b\u044f\u043c\u0438 (\u0442\u043e \u0435\u0441\u0442\u044c \u043d\u0435 \u043d\u0443\u0436\u043d\u0430 \u0438\u043d\u043e\u0441\u0442\u0440\u0430\u043d\u043d\u0430\u044f \u043a\u0430\u0440\u0442\u043e\u0447\u043a\u0430). \u042f \u0437\u043d\u0430\u044e \u0447\u0442\u043e \u0435\u0441\u0442\u044c \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0442\u0430\u043a\u0438\u0435 \u0436\u0435 \u0443\u0441\u043b\u0443\u0433\u0438 (\u0435\u0441\u043b\u0438 \u0437\u043d\u0430\u0435\u0442\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043b\u0443\u0447\u0448\u0435 Timeweb, \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u043d\u0430\u043f\u0438\u0448\u0438\u0442\u0435 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445).<\/p>\n<p>\u0418\u0442\u0430\u043a, \u043d\u0430\u0447\u043d\u0435\u043c.<\/p>\n<h2>\u041f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Linux<\/h2>\n<p>\u0417\u0430\u0439\u0434\u0435\u043c \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 (\u0434\u043b\u044f \u0432\u0430\u0448\u0435\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043f\u0443\u043d\u043a\u0442 \u043c\u043e\u0436\u0435\u0442 \u043e\u0442\u043b\u0438\u0447\u0430\u0442\u044c\u0441\u044f).<\/p>\n<pre><code>ssh root@123.444.555.666 -p 22<\/code><\/pre>\n<p>\u041e\u0431\u043d\u043e\u0432\u0438\u043c \u0432\u0441\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u044b\u0435 \u043f\u0430\u043a\u0435\u0442\u044b \u0434\u043b\u044f apt.<\/p>\n<pre><code>apt update &amp;&amp; apt upgrade -y<\/code><\/pre>\n<p>\u0418 \u0434\u043b\u044f apt-get.<\/p>\n<pre><code>apt-get update &amp;&amp; apt-get upgrade -y<\/code><\/pre>\n<p>\u041d\u0430\u0441\u0442\u0440\u043e\u0438\u043c \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440 Nginx. \u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043c, \u0447\u0442\u043e \u043e\u043d \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d (\u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u0441\u044f \u0435\u0433\u043e \u0432\u0435\u0440\u0441\u0438\u044f).<\/p>\n<pre><code>nginx -v<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u043e\u043d \u043d\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d, \u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c.<\/p>\n<pre><code>apt install nginx -y<\/code><\/pre>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043c, \u0447\u0442\u043e \u043e\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442.<\/p>\n<pre><code>systemctl status nginx<\/code><\/pre>\n<p>\u0414\u043e\u043b\u0436\u043d\u043e \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c\u0441\u044f: <strong>Active: active (running)<\/strong>. <\/p>\n<p>\u041e\u0442\u043a\u0440\u043e\u0435\u043c \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 <strong>http:\/\/123.444.555.666\/<\/strong> \u0414\u043e\u043b\u0436\u043d\u043e \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c\u0441\u044f:<\/p>\n<figure class=\"full-width\"><\/figure>\n<h2>\u041f\u0440\u043e\u0435\u043a\u0442 \u0434\u043b\u044f Python (Flask)<\/h2>\n<p><em>\u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u043d\u0443\u0436\u0435\u043d Node.js (Next.js), \u0442\u043e \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u0440\u0430\u0437\u0443 \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u0440\u0430\u0437\u0434\u0435\u043b \u043f\u0440\u043e Python (Flask).<\/em><\/p>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043c, \u0447\u0442\u043e Python \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d. \u041e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c\u0441\u044f \u0435\u0433\u043e \u0432\u0435\u0440\u0441\u0438\u044f (\u0443 \u043c\u0435\u043d\u044f 3.10.6).<\/p>\n<pre><code>python3 --version<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u043d\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d &#8212; \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u044d\u0442\u043e.<\/p>\n<pre><code>apt install python3 -y<\/code><\/pre>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043c, \u0447\u0442\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d pip.<\/p>\n<pre><code>pip --version<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u043d\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d:<\/p>\n<pre><code>apt install python3-pip -y<\/code><\/pre>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u043c\u043e\u0434\u0443\u043b\u044c venv (\u0440\u0430\u0431\u043e\u0442\u0430 \u0432 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0440\u0435\u0434\u0435).<\/p>\n<pre><code>apt install python3-venv -y<\/code><\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0440\u043e\u0435\u043a\u0442 \u0432 \u043f\u0430\u043f\u043a\u0435 <strong>\/home<\/strong>. \u041f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u0432 \u044d\u0442\u0443 \u043f\u0430\u043f\u043a\u0443.<\/p>\n<pre><code>cd \/home<\/code><\/pre>\n<p>\u041a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u0434\u0435\u043c\u043e \u043f\u0440\u043e\u0435\u043a\u0442.<\/p>\n<pre><code>git clone https:\/\/github.com\/openai\/openai-quickstart-python.git<\/code><\/pre>\n<p>\u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432 \u043f\u0430\u043f\u043a\u0443 \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<\/p>\n<pre><code>cd openai-quickstart-python<\/code><\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u0443\u044e \u0441\u0440\u0435\u0434\u0443.<\/p>\n<pre><code>python -m venv venvopenai<\/code><\/pre>\n<p>\u0410\u043a\u0442\u0438\u0432\u0438\u0440\u0443\u0435\u043c \u0435\u0435.<\/p>\n<pre><code>. venvopenai\/bin\/activate<\/code><\/pre>\n<p>\u0412 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c\u0441\u044f (venvopenai).<\/p>\n<p>\u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u043f\u0430\u043a\u0435\u0442\u044b.<\/p>\n<pre><code>pip install -r requirements.txt<\/code><\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0444\u0430\u0439\u043b, \u043a\u0443\u0434\u0430 \u0432\u0441\u0442\u0430\u0432\u0438\u043c OPENAI_API_KEY<\/p>\n<pre><code>cp .env.example .env<\/code><\/pre>\n<p>\u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0435\u0433\u043e.<\/p>\n<pre><code>nano .env<\/code><\/pre>\n<p>\u0412\u043d\u0443\u0442\u0440\u0438 \u043d\u0435\u0433\u043e \u0431\u0443\u0434\u0435\u0442:<\/p>\n<pre><code class=\"bash\">FLASK_APP=app FLASK_ENV=development  # Once you add your API key below, make sure to not share it with anyone! The API key should remain private. OPENAI_API_KEY=<\/code><\/pre>\n<p>\u0412\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c OPENAI_API_KEY<\/p>\n<pre><code class=\"bash\">FLASK_APP=app FLASK_ENV=development  # Once you add your API key below, make sure to not share it with anyone! The API key should remain private. OPENAI_API_KEY=sk-n0123456789buNKlMOOs1AEnIPQgUuoYeL0s9a1PG8mKe3xN<\/code><\/pre>\n<p>\u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c: F2 -> Y -> Enter<\/p>\n<p>\u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c IP \u0438 \u043f\u043e\u0440\u0442 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430. \u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0444\u0430\u0439\u043b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<pre><code>nano app.py<\/code><\/pre>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u043a\u043e\u043d\u0446\u0435 \u0444\u0430\u0439\u043b\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"python\">\u2026  if __name__ == \"__main__\":     app.run(host='123.444.555.666', port=5000)<\/code><\/pre>\n<p>\u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c: F2 -> Y -> Enter<\/p>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0441\u0435\u0440\u0432\u0438\u0441.<\/p>\n<pre><code>python app.py<\/code><\/pre>\n<p>\u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 <strong>http:\/\/123.444.555.666:5000<\/strong><\/p>\n<p>\u041f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u043a\u043d\u043e \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430:<\/p>\n<figure class=\"\"><\/figure>\n<p>\u0421\u0443\u0442\u044c \u0434\u0435\u043c\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430: \u043c\u044b \u0432\u0432\u043e\u0434\u0438\u043c \u0438\u043c\u044f \u0436\u0438\u0432\u043e\u0442\u043d\u043e\u0433\u043e (\u043d\u0430 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u043e\u043c) \u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u043d\u0430\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0433\u0435\u0440\u043e\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0438\u043c\u0435\u043d \u0434\u043b\u044f \u043d\u0435\u0433\u043e.<\/p>\n<figure class=\"\"><\/figure>\n<hr\/>\n<figure class=\"\"><\/figure>\n<hr\/>\n<figure class=\"\"><\/figure>\n<p>\u041e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0441\u0435\u0440\u0432\u0438\u0441 \u0438 \u0432\u044b\u0445\u043e\u0434\u0438\u043c \u0438\u0437 \u043d\u0435\u0433\u043e, \u043d\u0430\u0436\u0430\u0432 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0435 CTRL+C.<\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0434\u0435\u043c\u043e \u043f\u0440\u043e\u0435\u043a\u0442, \u0447\u0442\u043e\u0431\u044b \u0438\u043c\u0435\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0432\u0432\u043e\u0434\u0438\u0442\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u044b.<\/p>\n<p>\u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0444\u0430\u0439\u043b \u0441 html \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u043c.<\/p>\n<pre><code>nano templates\/index.html<\/code><\/pre>\n<p>\u041d\u0430\u0445\u043e\u0434\u0438\u043c \u0431\u043b\u043e\u043a:<\/p>\n<pre><code class=\"xml\">  &lt;img src=\"{{ url_for('static', filename='dog.png') }}\" class=\"icon\" \/>   &lt;h3>Name my pet&lt;\/h3>   &lt;form action=\"\/\" method=\"post\">     &lt;input type=\"text\" name=\"animal\" placeholder=\"Enter an animal\" required \/>     &lt;input type=\"submit\" value=\"Generate names\" \/>   &lt;\/form><\/code><\/pre>\n<p>\u0423\u0434\u0430\u043b\u044f\u0435\u043c \u0435\u0433\u043e. \u0412\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0432\u043c\u0435\u0441\u0442\u043e \u043d\u0435\u0433\u043e:<\/p>\n<pre><code class=\"xml\">  &lt;h3>\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0442\u0435\u043a\u0441\u0442&lt;\/h3>   &lt;form action=\"\/\" method=\"post\">     &lt;textarea rows=\"20\" cols=\"200\" name=\"animal\" placeholder=\"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0442\u0435\u043a\u0441\u0442\" required>&lt;\/textarea>     &lt;input type=\"submit\" value=\"Generate\" \/>   &lt;\/form><\/code><\/pre>\n<p>\u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c: F2 -> Y -> Enter<\/p>\n<p>\u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0444\u0430\u0439\u043b \u0441 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c.<\/p>\n<pre><code>nano app.py<\/code><\/pre>\n<p>\u041d\u0430\u0445\u043e\u0434\u0438\u043c \u0431\u043b\u043e\u043a:<\/p>\n<pre><code class=\"python\">        response = openai.Completion.create(             model=\"text-davinci-003\",             prompt=generate_prompt(animal),             temperature=0.6,         )<\/code><\/pre>\n<p>\u0412\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u043d\u0435\u0433\u043e \u0441\u0442\u0440\u043e\u043a\u0443: <strong>max_tokens=4000,<\/strong><\/p>\n<pre><code class=\"python\">        response = openai.Completion.create(             model=\"text-davinci-003\",             prompt=generate_prompt(animal),             temperature=0.6,             max_tokens=4000,         )<\/code><\/pre>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0436\u0435 \u0444\u0430\u0439\u043b\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e:<\/p>\n<pre><code class=\"python\">def generate_prompt(animal):     return \"\"\"Suggest three names for an animal that is a superhero.  Animal: Cat Names: Captain Sharpclaw, Agent Fluffball, The Incredible Feline Animal: Dog Names: Ruff the Protector, Wonder Canine, Sir Barks-a-Lot Animal: {} Names:\"\"\".format(         animal.capitalize()     )<\/code><\/pre>\n<p>\u0423\u0434\u0430\u043b\u044f\u0435\u043c \u0435\u0435. \u0412\u043c\u0435\u0441\u0442\u043e \u043d\u0435\u0451 \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c:<\/p>\n<pre><code class=\"python\">def generate_prompt(animal):     return \"\"\"{} \"\"\".format(         animal.capitalize()     )<\/code><\/pre>\n<p>\u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c: F2 -> Y -> Enter<\/p>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0441\u0435\u0440\u0432\u0438\u0441.<\/p>\n<pre><code>python app.py<\/code><\/pre>\n<p>\u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 <strong>http:\/\/123.444.555.666:5000<\/strong><\/p>\n<p>\u0412\u0438\u0434\u0438\u043c \u043e\u043a\u043d\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u043d\u043e \u0441 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e \u0432\u0432\u043e\u0434\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u0430:<\/p>\n<figure class=\"\"><\/figure>\n<p>\u0412\u0432\u043e\u0434\u0438\u043c \u0432\u043e\u043f\u0440\u043e\u0441 \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043e\u0442\u0432\u0435\u0442:<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0427\u0442\u043e\u0431\u044b \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441 \u0438 \u0432\u044b\u0439\u0442\u0438, \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u043c CTRL+C.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0432\u044b\u0439\u0442\u0438 \u0438\u0437 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0440\u0435\u0434\u044b \u0432\u0432\u043e\u0434\u0438\u043c:<\/p>\n<pre><code>deactivate<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0432 ChatGPT \u043f\u043e API, \u0438 \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430 Python.<\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0435\u043c \u0442\u0430\u043a\u043e\u0439 \u0436\u0435 \u043f\u0440\u043e\u0435\u043a\u0442 \u0434\u043b\u044f Node.js. \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u044f \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043f\u0440\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b API \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 (\u0435\u0441\u043b\u0438 Node.js \u0432\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u0435\u043d, \u0442\u043e \u0441\u0440\u0430\u0437\u0443 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442\u0435 \u043a \u0440\u0430\u0437\u0434\u0435\u043b\u0443 \u043f\u0440\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b).<\/p>\n<h2>\u041f\u0440\u043e\u0435\u043a\u0442 \u0434\u043b\u044f Node.js (Next.js)<\/h2>\n<p>\u0414\u043b\u044f \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u0430 Node.js \u0441 \u0432\u0435\u0440\u0441\u0438\u0435\u0439 >= 14.6.0.<\/p>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043c, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u043b\u0438 node.<\/p>\n<pre><code>node -v<\/code><\/pre>\n<p>\u0418 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u043b\u0438 npm.<\/p>\n<pre><code>npm -v<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f, \u043a\u0430\u043a \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c Node.js \u0432\u0435\u0440\u0441\u0438\u0438 18.<\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 NodeSource.<\/p>\n<pre><code>curl -fsSL https:\/\/deb.nodesource.com\/setup_18.x | sudo -E bash -<\/code><\/pre>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c node \u0438 npm.<\/p>\n<pre><code>apt-get install nodejs -y<\/code><\/pre>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043c, \u0447\u0442\u043e node \u043d\u0443\u0436\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d.<\/p>\n<pre><code>node -v<\/code><\/pre>\n<p>\u0418 \u0447\u0442\u043e npm \u0442\u043e\u0436\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d.<\/p>\n<pre><code>npm -v<\/code><\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0440\u043e\u0435\u043a\u0442 \u0432 \u043f\u0430\u043f\u043a\u0435 <strong>\/home<\/strong>. \u041f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u0432 \u044d\u0442\u0443 \u043f\u0430\u043f\u043a\u0443.<\/p>\n<pre><code>cd \/home<\/code><\/pre>\n<p>\u041a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u0434\u0435\u043c\u043e \u043f\u0440\u043e\u0435\u043a\u0442.<\/p>\n<pre><code>git clone https:\/\/github.com\/openai\/openai-quickstart-node.git<\/code><\/pre>\n<p>\u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432 \u043f\u0430\u043f\u043a\u0443 \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<\/p>\n<pre><code>cd openai-quickstart-node<\/code><\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0444\u0430\u0439\u043b, \u043a\u0443\u0434\u0430 \u0432\u0441\u0442\u0430\u0432\u0438\u043c OPENAI_API_KEY<\/p>\n<pre><code>cp .env.example .env<\/code><\/pre>\n<p>\u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0435\u0433\u043e.<\/p>\n<pre><code>nano .env<\/code><\/pre>\n<p>\u0412\u043d\u0443\u0442\u0440\u0438 \u043d\u0435\u0433\u043e \u0431\u0443\u0434\u0435\u0442:<\/p>\n<pre><code class=\"bash\"># Do not share your OpenAI API key with anyone! It should remain a secret. OPENAI_API_KEY=<\/code><\/pre>\n<p>\u0412\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c OPENAI_API_KEY<\/p>\n<pre><code class=\"bash\"># Do not share your OpenAI API key with anyone! It should remain a secret. OPENAI_API_KEY=sk-n0123456789buNKlMOOs1AEnIPQgUuoYeL0s9a1PG8mKe3xN<\/code><\/pre>\n<p>\u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c: F2 -> Y -> Enter<\/p>\n<p>\u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043d\u0443\u0436\u043d\u044b\u0439 IP \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430. \u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c:<\/p>\n<pre><code>nano package.json<\/code><\/pre>\n<p>\u041d\u0430\u0445\u043e\u0434\u0438\u043c \u0441\u0442\u0440\u043e\u043a\u0443: <strong>&#171;dev&#187;: &#171;next dev&#187;,<\/strong><\/p>\n<pre><code class=\"json\">{   \"name\": \"openai-quickstart-node\",   \"version\": \"0.1.0\",   \"private\": true,   \"scripts\": {     \"dev\": \"next dev\",     \"build\": \"next build\",     \"start\": \"next start\"   },   \"dependencies\": {     \"next\": \"^13.1.1\",     \"openai\": \"^3.1.0\",     \"react\": \"^18.2.0\",     \"react-dom\": \"^18.2.0\"   },   \"engines\": {     \"node\": \">=14.6.0\"   } }<\/code><\/pre>\n<p>\u0417\u0430\u043c\u0435\u043d\u044f\u0435\u043c \u0435\u0435 \u043d\u0430 <strong>&#171;dev&#187;: &#171;next dev -H 123.444.555.666&#187;,<\/strong><\/p>\n<pre><code class=\"json\">{   \"name\": \"openai-quickstart-node\",   \"version\": \"0.1.0\",   \"private\": true,   \"scripts\": {     \"dev\": \"next dev -H 123.444.555.666\",     \"build\": \"next build\",     \"start\": \"next start\"   },   \"dependencies\": {     \"next\": \"^13.1.1\",     \"openai\": \"^3.1.0\",     \"react\": \"^18.2.0\",     \"react-dom\": \"^18.2.0\"   },   \"engines\": {     \"node\": \">=14.6.0\"   } }<\/code><\/pre>\n<p>\u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c: F2 -> Y -> Enter<\/p>\n<p>\u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u043f\u0430\u043a\u0435\u0442\u044b.<\/p>\n<pre><code>npm install<\/code><\/pre>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0441\u0435\u0440\u0432\u0438\u0441.<\/p>\n<pre><code>npm run dev<\/code><\/pre>\n<p>\u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 <strong>http:\/\/123.444.555.666:3000<\/strong><\/p>\n<p>\u0412\u0438\u0434\u0438\u043c \u043e\u043a\u043d\u043e \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430:<\/p>\n<figure class=\"\"><\/figure>\n<p>\u0421\u0443\u0442\u044c \u0434\u0435\u043c\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 &#8212; \u043c\u044b \u0432\u0432\u043e\u0434\u0438\u043c \u0438\u043c\u044f \u0436\u0438\u0432\u043e\u0442\u043d\u043e\u0433\u043e (\u043d\u0430 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u043e\u043c) \u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u043d\u0430\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0433\u0435\u0440\u043e\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0438\u043c\u0435\u043d \u0434\u043b\u044f \u043d\u0435\u0433\u043e:<\/p>\n<figure class=\"\"><\/figure>\n<hr\/>\n<figure class=\"\"><\/figure>\n<hr\/>\n<figure class=\"\"><\/figure>\n<p>\u0427\u0442\u043e\u0431\u044b \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441 \u0438 \u0432\u044b\u0439\u0442\u0438, \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u0442 CTRL+C<\/p>\n<p>\u0414\u043e\u0440\u0430\u0431\u043e\u0442<\/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-398764","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/398764","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=398764"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/398764\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=398764"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=398764"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=398764"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}