{"id":409802,"date":"2024-06-29T21:00:22","date_gmt":"2024-06-29T21:00:22","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=409802"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=409802","title":{"rendered":"<span>\u0418\u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0433\u0440\u0430\u043c\u043c\u0430\u0442\u0438\u043a\u0443 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e GPT-4 API<\/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>\u0421 \u0441\u0430\u043c\u043e\u0433\u043e \u0432\u044b\u0445\u043e\u0434\u0430 ChatGPT \u044f \u043d\u0430\u0447\u0430\u043b \u0435\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u0443\u0440\u044b \u0442\u0435\u043a\u0441\u0442\u0430: \u0443\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043e\u043f\u0435\u0447\u0430\u0442\u043e\u043a, \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043e\u0448\u0438\u0431\u043e\u043a \u0438 \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f \u0441\u0442\u0438\u043b\u0438\u0441\u0442\u0438\u043a\u0438.<\/p>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e, \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0432\u0435\u0431-\u0432\u0435\u0440\u0441\u0438\u0438 ChatGPT \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u044e\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b:<\/p>\n<ol>\n<li>\n<p>\u041f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u0442\u0435\u043a\u0441\u0442, \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0439\u0442\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f<\/p>\n<\/li>\n<li>\n<p>\u041d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432\u0441\u044f \u043c\u043e\u0449\u044c API, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0435\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u0431\u043e\u043b\u0435\u0435 \u0442\u043e\u043d\u043a\u043e\u0439 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0431\u043e\u0442\u0430<\/p>\n<ol>\n<li>\n<p>\u041c\u043e\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043e\u0431\u044a\u044f\u0441\u043d\u0438\u0442\u044c \u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043d\u0442\u0443 \u0441\u043c\u044b\u0441\u043b \u0435\u0433\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u044f<\/p>\n<\/li>\n<li>\n<p>Few-shot learning: \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043d\u0430\u0431\u043e\u0440 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u043a\u043e\u0440\u0440\u0435\u043a\u0446\u0438\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439<\/p>\n<\/li>\n<\/ol>\n<\/li>\n<li>\n<p>\u041d\u0435\u0443\u0434\u043e\u0431\u0441\u0442\u0432\u043e: \u043d\u0443\u0436\u043d\u043e \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0441\u0432\u043e\u0439 \u0442\u0435\u043a\u0441\u0442 \u0432 \u0432\u0435\u0431-\u0432\u0435\u0440\u0441\u0438\u044e, \u0437\u0430\u0442\u0435\u043c \u043d\u0430\u0431\u0438\u0440\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u043f\u0440\u043e\u043c\u0442 \u0434\u043b\u044f \u0435\u0433\u043e \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f (\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u043c \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u0438\u043f\u0430 \u043a\u043e\u0440\u0440\u0435\u043a\u0446\u0438\u0438). \u0425\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u0438\u043c\u0435\u0442\u044c Web UI, \u0433\u0434\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0442\u0435\u043a\u0441\u0442 \u0438 \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0442\u0438\u043f \u043a\u043e\u0440\u0440\u0435\u043a\u0446\u0438\u0438 &#8212; \u0430 \u0434\u0430\u043b\u0435\u0435 \u0442\u0435\u043a\u0441\u0442 \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c \u043f\u0440\u043e\u043c\u0442\u043e\u043c<\/p>\n<\/li>\n<\/ol>\n<p>\u0414\u0430\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u043f\u0440\u0438\u0437\u0432\u0430\u043d \u0443\u0441\u0442\u0440\u0430\u043d\u0438\u0442\u044c \u044d\u0442\u0438 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0438. \u041f\u043e\u0442\u044b\u043a\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u043d\u043e <a href=\"https:\/\/language-challenge-react.herokuapp.com\/correct\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a> (\u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0443\u0436\u0435\u043d OpenAI API-\u043a\u043b\u044e\u0447).<\/p>\n<h2>\u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435<\/h2>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/7b8\/84a\/536\/7b884a53650e5d8da31ffba15fefb93c.png\" width=\"1843\" height=\"441\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/7b8\/84a\/536\/7b884a53650e5d8da31ffba15fefb93c.png\"\/><\/figure>\n<p>\u0412 \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0435\u0441\u0442\u044c \u043f\u043e\u043b\u0435 \u0441 \u0442\u0435\u043a\u0441\u0442\u043e\u043c, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0432\u0432\u043e\u0434\u0438\u0442 \u0441\u0432\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c. \u041f\u043e\u0441\u043b\u0435 \u043d\u0430\u0436\u0430\u0442\u0438\u044f \u043d\u0430 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435-\u043a\u043d\u043e\u043f\u043a\u0443 \u0432 \u043f\u043e\u043b\u0435 \u0441\u043f\u0440\u0430\u0432\u0430 \u043f\u043e\u0441\u0442\u0435\u043f\u0435\u043d\u043d\u043e \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f, \u0430 \u043f\u043e \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u0438 \u0432\u044b\u0432\u043e\u0434\u0430 \u0432\u044b\u0434\u0435\u043b\u044f\u044e\u0442\u0441\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f. \u041f\u0440\u0438 \u043d\u0430\u0432\u0435\u0434\u0435\u043d\u0438\u0438 \u043d\u0430 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435, tooltip \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u0447\u0442\u043e \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e \u0431\u044b\u043b\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043e.<\/p>\n<p>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u044f\u0437\u044b\u043a\u043e\u0432. \u041c\u043e\u0436\u043d\u043e \u043b\u0438\u0431\u043e \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u044f\u0437\u044b\u043a \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0432\u0440\u0443\u0447\u043d\u0443\u044e, \u043b\u0438\u0431\u043e \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c\u0441\u044f \u043d\u0430 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u0434\u0435\u0442\u0435\u043a\u0442\u043e\u0440 \u044f\u0437\u044b\u043a\u0430.<\/p>\n<p>\u041c\u043e\u0436\u043d\u043e \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c: \u043e\u0431\u0449\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0443\u044e GPT 3.5 Turbo, \u043b\u0438\u0431\u043e GPT-4. \u0414\u043e\u0441\u0442\u0443\u043f \u043a GPT-4 API \u0441\u0435\u0439\u0447\u0430\u0441 \u043f\u043e <a href=\"https:\/\/openai.com\/waitlist\/gpt-4-api\" rel=\"noopener noreferrer nofollow\">\u0432\u0435\u0439\u0442\u043b\u0438\u0441\u0442\u0443<\/a>, \u0441\u0430\u043c\u0430 \u043c\u043e\u0434\u0435\u043b\u044c \u0431\u043e\u043b\u0435\u0435 \u0447\u0435\u043c \u043d\u0430 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0434\u043e\u0440\u043e\u0436\u0435, \u043d\u043e \u0437\u0430\u0442\u043e \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0443\u043c\u043d\u0435\u0435.<\/p>\n<p>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0434\u0432\u0430 \u0442\u0438\u043f\u0430 \u043a\u043e\u0440\u0440\u0435\u043a\u0446\u0438\u0438 \u0442\u0435\u043a\u0441\u0442\u0430: <\/p>\n<ol>\n<li>\n<p>just correct grammar \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0433\u0440\u0430\u043c\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435, \u043e\u0440\u0444\u043e\u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0438 \u043f\u0443\u043d\u043a\u0442\u0443\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438<\/p>\n<\/li>\n<li>\n<p>make more natural \u0432\u0434\u043e\u0431\u0430\u0432\u043e\u043a \u0443\u043b\u0443\u0447\u0448\u0430\u0435\u0442 \u0441\u0442\u0438\u043b\u0438\u0441\u0442\u0438\u043a\u0443 \u0442\u0435\u043a\u0441\u0442\u0430. \u041e\u0434\u043d\u0430\u043a\u043e, \u0442\u0443\u0442 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0431\u043e\u043b\u0435\u0435 \u043a\u0430\u0440\u0434\u0438\u043d\u0430\u043b\u044c\u043d\u044b, \u0438 \u0438\u043d\u043e\u0433\u0434\u0430 \u043e\u043d\u0438 \u043c\u043e\u0433\u0443\u0442 \u043c\u0435\u043d\u044f\u0442\u044c \u0441\u043c\u044b\u0441\u043b \u0442\u0435\u043a\u0441\u0442\u0430<\/p>\n<\/li>\n<\/ol>\n<p>OpenAI API \u0441\u0442\u043e\u0438\u0442 \u0434\u0435\u043d\u0435\u0433. \u041f\u0435\u0440\u0435\u0434\u043e \u043c\u043d\u043e\u0439 \u0432\u0441\u0442\u0430\u043b\u0430 \u0437\u0430\u0434\u0430\u0447\u0430: \u043a\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442 \u044e\u0437\u0430\u0431\u0435\u043b\u044c\u043d\u044b\u043c \u0434\u043b\u044f \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430 \u043b\u044e\u0434\u0435\u0439, \u0435\u0441\u043b\u0438 \u043e\u043d \u0431\u0430\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043d\u0430 \u043f\u043b\u0430\u0442\u043d\u043e\u043c API? \u0411\u0440\u0430\u0442\u044c \u0441 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0434\u0435\u043d\u044c\u0433\u0438 \u0438 \u043e\u043f\u043b\u0430\u0447\u0438\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0438\u043c \u043a\u043b\u044e\u0447\u043e\u043c &#8212; \u0442\u0430\u043a\u0430\u044f \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044f \u043d\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043f\u0435\u0442-\u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u0438\u043b\u043b\u0438\u043d\u0433 &#8212; \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0430\u044f \u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0443\u0441\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0441\u0430\u043c \u0432\u0432\u043e\u0434\u0438\u0442 \u0441\u0432\u043e\u0439 \u043a\u043b\u044e\u0447 \u0438 \u043f\u043b\u0430\u0442\u0438\u0442 \u0441 \u043d\u0435\u0433\u043e. \u041f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043d\u0430 \u0448\u0435\u0441\u0442\u0435\u0440\u0435\u043d\u043a\u0443 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438, \u0433\u0434\u0435 \u043c\u043e\u0436\u043d\u043e \u0432\u0432\u0435\u0441\u0442\u0438\/\u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0441\u0432\u043e\u0439 API-\u043a\u043b\u044e\u0447.<\/p>\n<p>\u0412 \u0442\u0430\u043a\u043e\u0439 \u043f\u0430\u0440\u0430\u0434\u0438\u0433\u043c\u0435 \u043f\u0440\u043e\u0435\u043a\u0442 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0434\u0435\u043b\u0430\u0442\u044c \u0432\u043e\u043e\u0431\u0449\u0435 \u0431\u0435\u0437 \u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u0447\u0438\u0441\u0442\u043e \u043d\u0430 React (\u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043a\u043b\u044e\u0447\u0438 \u043d\u0435\u043b\u044c\u0437\u044f \u043d\u0438\u043a\u0443\u0434\u0430 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c). \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0434\u043b\u044f \u0435\u0449\u0435 \u0431\u043e\u043b\u044c\u0448\u0435\u0439 \u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u043e\u0441\u0442\u0438 \u043a\u043e\u0434 \u044f \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u044e:  <a href=\"https:\/\/github.com\/einhornus\/language-challenge-react\" rel=\"noopener noreferrer nofollow\"><u>https:\/\/github.com\/einhornus\/language-challenge-react<\/u><\/a> (\u0434\u0430\u043d\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 &#8212; \u044d\u0442\u043e \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0430\u0441\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438).<\/p>\n<p>\u042f \u043f\u0438\u0442\u043e\u043d\u0438\u0441\u0442-ML\u0449\u0438\u043a \u0441\u043e \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u0432 NLP, \u043a\u043e\u0434\u0438\u043d\u0433 \u043d\u0430 React \u0434\u043b\u044f \u043c\u0435\u043d\u044f &#8212; \u0432\u044b\u0445\u043e\u0434 \u0438\u0437 \u0437\u043e\u043d\u044b \u043a\u043e\u043c\u0444\u043e\u0440\u0442\u0430. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u043e\u0448\u0443 \u0441\u0438\u043b\u044c\u043d\u043e \u043d\u0435 \u043f\u0438\u043d\u0430\u0442\u044c \u0438\u0437-\u0437\u0430 \u043a\u0440\u0438\u0432\u0438\u0437\u043d\u044b UI \u0438 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 JS-\u043a\u043e\u0434\u0430 \u0432 \u0440\u0435\u043f\u0435. <\/p>\n<p>\u0424\u043e\u043a\u0443\u0441 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 &#8212; \u043d\u0430 \u043c\u0430\u043a\u0441\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u043a\u043e\u0440\u0440\u0435\u043a\u0446\u0438\u0438 \u0442\u0435\u043a\u0441\u0442\u0430 \u0438 \u043d\u0430 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0440\u0435\u043b\u0438\u0437\u0430 \u044e\u0437\u0430\u0431\u0435\u043b\u044c\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438.<\/p>\n<h2>GPT-4 API<\/h2>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0435\u043a\u0446\u0438\u0438 \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043f\u0440\u043e GPT-4 API \u0438 \u043f\u043e\u043a\u0430\u0436\u0443, \u043a\u0430\u043a \u0441 \u0435\u0433\u043e \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0448\u0430\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0438 NLP.<\/p>\n<p>\u0412 API \u0435\u0441\u0442\u044c \u043c\u0435\u0442\u043e\u0434 ChatCompletion, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0441\u043f\u0438\u0441\u043e\u043a \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043d\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u043c\u0442\u043e\u043c, \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435.<\/p>\n<p>\u041a\u0430\u0436\u0434\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u044d\u0442\u043e\u0433\u043e \u0441\u043f\u0438\u0441\u043a\u0430 &#8212; \u044d\u0442\u043e \u0441\u043b\u043e\u0432\u0430\u0440\u044c \u0441 \u0434\u0432\u0443\u043c\u044f \u043f\u043e\u043b\u044f\u043c\u0438: role \u0438 content.<\/p>\n<p>\u041f\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e role \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u0446\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u043d\u0430 3 \u0442\u0438\u043f\u0430: \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f (role=&#187;system&#187;), \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f (role=&#187;user&#187;) \u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043d\u0442\u0430 (role=&#187;assistant&#187;).<\/p>\n<p>\u0421\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0432 \u0441\u0432\u043e\u0435\u043c \u043f\u043e\u043b\u0435 content \u0432\u044b\u0441\u043e\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043d\u0442\u0430 &#8212; \u0442\u043e, \u043a\u0430\u043a \u043e\u043d \u0434\u043e\u043b\u0436\u0435\u043d \u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c. \u0415\u0441\u043b\u0438 \u0432 \u043f\u0440\u043e\u043c\u0442\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0445 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439, \u0438\u043c\u0435\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u0438\u0437 \u043d\u0438\u0445 (\u043d\u043e\u0432\u044b\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442 \u0441\u0442\u0430\u0440\u044b\u0435). \u041a\u0430\u043a \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u043c\u0442\u0430 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0432\u043b\u0438\u044f\u0435\u0442 \u043d\u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 &#8212; \u044f \u043f\u043e\u043a\u0430 \u043d\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u044e, \u044d\u0442\u043e \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u0432\u043e\u043f\u0440\u043e\u0441.<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043d\u0442\u0430 \u0437\u0430\u0434\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0430\u044f \u0431\u0435\u0441\u0435\u0434\u0430 \u043c\u0435\u0436\u0434\u0443 \u043d\u0438\u043c\u0438. \u041e\u0434\u043d\u0430\u043a\u043e, \u044d\u0442\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447\u0438 (few shot learning). \u0412 \u043a\u0430\u0436\u0434\u043e\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u0440 \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u0430 \u0432 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0438 \u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043d\u0442\u0430 \u043f\u043e\u0441\u043b\u0435 \u043d\u0435\u0433\u043e &#8212; \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435. \u041f\u043e\u0441\u043b\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0438\u0434\u0435\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0432\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0440\u0435\u0448\u0435\u043d\u0438\u0435.<\/p>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0437\u0430\u0434\u0430\u0447\u0443 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0430 \u0441 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u043e\u0433\u043e \u043d\u0430 \u0440\u0443\u0441\u0441\u043a\u0438\u0439. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0440\u043e\u043c\u0442 \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"json\">[     {         \"role\": \"user\",         \"content\": \"Hello how are you?\"     },     {         \"role\": \"assistant\",         \"content\": \"\u041f\u0440\u0438\u0432\u0435\u0442, \u043a\u0430\u043a \u0434\u0435\u043b\u0430?\"     },     {         \"role\": \"user\",         \"content\": \"Despite the heavy rain, they decided to continue their hike through the dense forest\"     },     {         \"role\": \"assistant\",         \"content\": \"\u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0441\u0438\u043b\u044c\u043d\u044b\u0439 \u0434\u043e\u0436\u0434\u044c, \u043e\u043d\u0438 \u0440\u0435\u0448\u0438\u043b\u0438 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c \u0441\u0432\u043e\u0439 \u043f\u043e\u0445\u043e\u0434 \u0447\u0435\u0440\u0435\u0437 \u0433\u0443\u0441\u0442\u043e\u0439 \u043b\u0435\u0441\"     },     {         \"role\": \"user\",         \"content\": \"The chef, inspired by flavors from around the world, has created a unique fusion cuisine that attracts food enthusiasts and critics alike\"     },     {         \"role\": \"assistant\",         \"content\": \"\u041f\u043e\u0432\u0430\u0440, \u0432\u0434\u043e\u0445\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u0432\u043a\u0443\u0441\u0430\u043c\u0438 \u0441\u043e \u0432\u0441\u0435\u0433\u043e \u043c\u0438\u0440\u0430, \u0441\u043e\u0437\u0434\u0430\u043b \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u0443\u044e \u0444\u044c\u044e\u0436\u043d-\u043a\u0443\u0445\u043d\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u0438\u0432\u043b\u0435\u043a\u0430\u0435\u0442 \u043a\u0430\u043a \u0433\u0443\u0440\u043c\u0430\u043d\u043e\u0432, \u0442\u0430\u043a \u0438 \u043a\u0440\u0438\u0442\u0438\u043a\u043e\u0432\"     },     {         \"role\": \"system\",         \"content\": \"You are TranslateGPT. You translate user messages from English to Russian. You are the most accurate English to Russian translator in the world.\"     },     {         \"role\": \"user\",         \"content\": \"{\u0442\u0435\u043a\u0441\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0434\u043e \u043f\u0435\u0440\u0435\u0432\u0435\u0441\u0442\u0438}\"     } ] <\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u043f\u043e\u0441\u043b\u0430\u0442\u044c API-\u0437\u0430\u043f\u0440\u043e\u0441 \u0441 \u0442\u0430\u043a\u0438\u043c \u043f\u0440\u043e\u043c\u0442\u043e\u043c, \u0432 \u043e\u0442\u0432\u0435\u0442 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043d\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u043d\u0430\u0448\u0435\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u0430.<\/p>\n<p>\u041a\u0440\u043e\u043c\u0435 \u043f\u0440\u043e\u043c\u0442\u0430, \u0432 \u0437\u0430\u043f\u0440\u043e\u0441\u0435 \u043a API \u0435\u0441\u0442\u044c \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b:<\/p>\n<ol>\n<li>\n<p>model &#8212; \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c. \u041d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f gpt-3.5-turbo (\u043e\u0431\u0449\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430) \u0438 gpt-4 (\u043f\u043e\u043a\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0442\u0435\u0445, \u043a\u043e\u043c\u0443 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u043b\u0438 \u0434\u043e\u0441\u0442\u0443\u043f). gpt-4 \u0441\u0442\u043e\u0438\u0442 \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043e\u0440\u043e\u0436\u0435: 3 \u0446\u0435\u043d\u0442\u0430 \u0437\u0430 1000 \u0442\u043e\u043a\u0435\u043d\u043e\u0432 \u043f\u0440\u043e\u043c\u0442\u0430 + 6 \u0446\u0435\u043d\u0442\u043e\u0432 \u0437\u0430 1000 \u0442\u043e\u043a\u0435\u043d\u043e\u0432 \u043e\u0442\u0432\u0435\u0442\u0430 \u043f\u0440\u043e\u0442\u0438\u0432 0.2 \u0446\u0435\u043d\u0442\u043e\u0432 \u0437\u0430 1000 \u043b\u044e\u0431\u044b\u0445 \u0442\u043e\u043a\u0435\u043d\u043e\u0432 \u0443 gpt-3.5-turbo. \u041e\u0434\u043d\u0430\u043a\u043e, \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043f\u0440\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u0438 NLP-\u0437\u0430\u0434\u0430\u0447 \u0443 gpt-4 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043b\u0443\u0447\u0448\u0435.<\/p>\n<\/li>\n<li>\n<p>temperature &#8212; \u0447\u0438\u0441\u043b\u043e \u043e\u0442 0 \u0434\u043e 2, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0437\u0430\u0434\u0430\u0435\u0442, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0447\u0430\u0441\u0442\u043e \u043f\u0440\u0438 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0442\u043e\u043a\u0435\u043d\u0430 \u043c\u043e\u0434\u0435\u043b\u044c \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u043d\u0435 \u0441\u0430\u043c\u044b\u0439 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442. \u0423\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u0435 \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u044b \u043f\u043e\u0432\u044b\u0448\u0430\u0435\u0442 \u043a\u0440\u0435\u0430\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c \u043e\u0442\u0432\u0435\u0442\u043e\u0432, \u043d\u043e \u0441\u043d\u0438\u0436\u0430\u0435\u0442 \u0438\u0445 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e. \u041f\u0440\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u0438 \u0437\u0430\u0434\u0430\u0447 NLP \u043b\u0443\u0447\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0443 \u0440\u0430\u0432\u043d\u043e\u0439 \u043d\u0443\u043b\u044e. <\/p>\n<\/li>\n<li>\n<p>max_tokens &#8212; \u043c\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 \u0432 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c\u043e\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0438. \u041f\u0440\u0438 \u043f\u0440\u0435\u0432\u044b\u0448\u0435\u043d\u0438\u0438 \u043b\u0438\u043c\u0438\u0442\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e\u0431\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f.<\/p>\n<\/li>\n<\/ol>\n<p>\u041f\u043e\u043b\u043d\u0443\u044e \u0441\u043f\u0440\u0430\u0432\u043a\u0443 \u043f\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c \u0432 API \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c <a href=\"https:\/\/platform.openai.com\/docs\/api-reference\/chat\/create\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a>. \u041f\u043e\u0438\u0433\u0440\u0430\u0442\u044c\u0441\u044f \u0441 API \u043c\u043e\u0436\u043d\u043e \u0432 <a href=\"https:\/\/platform.openai.com\/playground?mode=chat\" rel=\"noopener noreferrer nofollow\">\u043f\u043b\u0435\u0439\u0433\u0440\u0430\u0443\u043d\u0434\u0435<\/a>.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/83c\/753\/50d\/83c75350d967c494b41fa0ea43fed99b.png\" alt=\"\u041f\u0435\u0440\u0435\u0432\u043e\u0434\u0447\u0438\u043a \u0432 \u043f\u043b\u0435\u0439\u0433\u0440\u0430\u0443\u043d\u0434\u0435\" title=\"\u041f\u0435\u0440\u0435\u0432\u043e\u0434\u0447\u0438\u043a \u0432 \u043f\u043b\u0435\u0439\u0433\u0440\u0430\u0443\u043d\u0434\u0435\" width=\"1829\" height=\"697\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/83c\/753\/50d\/83c75350d967c494b41fa0ea43fed99b.png\"\/><\/p>\n<div><figcaption>\u041f\u0435\u0440\u0435\u0432\u043e\u0434\u0447\u0438\u043a \u0432 \u043f\u043b\u0435\u0439\u0433\u0440\u0430\u0443\u043d\u0434\u0435<\/figcaption><\/div>\n<\/figure>\n<h2>GPT-4 API \u0432 JS<\/h2>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043c\u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c GPT-4 API \u0438\u0437 \u0440\u0435\u0430\u043a\u0442\u0430. \u0414\u0430, \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u043b\u0438\u0431\u0430 OpenAIApi, \u043d\u043e \u043e\u043d\u0430 \u043f\u043e\u043a\u0430 \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0441\u0442\u0440\u0438\u043c\u0438\u043d\u0433 \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u043e\u0433\u043e \u043e\u0442\u0432\u0435\u0442\u0430 &#8212; \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043c\u043e\u0433 \u0432\u0438\u0434\u0435\u0442\u044c \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u043e \u043c\u0435\u0440\u0435 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f.<\/p>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435 \u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043a API endpoint \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e:<\/p>\n<pre><code class=\"javascript\">\/** Calls the GPT-4 API with streaming support, providing real-time partial results. @async @function callGPT4APIJSStreaming @param {string} model - The model to use for the API call. @param {string} key - The API key for authentication with the GPT-4 API. @param {Array} prompt - The prompt to be sent to the GPT-4 API (a list of messages). @param {number} temperature - The sampling temperature for the GPT-4 API (0 for deterministic responses). @param {number} maxTokens - The maximum number of tokens in the generated response. @param {Function} onFullResult - Callback function to handle the complete generated response. @param {Function} onPartialResult - Callback function to handle partial results while streaming. @param {Function} onError - Callback function to handle errors during the API call. @returns {Promise&lt;void>} - A promise that resolves when the API call and streaming are complete. *\/ async function callGPT4APIJSStreaming(model, key, prompt, temperature, maxTokens, onFullResult, onPartialResult, onError) {     \/\/ Send the request to the API     try {         const response = await fetch('https:\/\/api.openai.com\/v1\/chat\/completions', {             method: 'POST',             headers: {                 'Content-Type': 'application\/json',                 'Authorization': `Bearer ${key}`,             },             body: JSON.stringify({                 model: model,                 messages: prompt,                 max_tokens: maxTokens,                 n: 1,                 temperature: temperature,                 stream: true,             }),         });          \/\/ If the response is not ok, call the onError callback with the status code and return         if (!response.ok) {             onError(response.status);             return;         }          \/\/ Initialize an empty string to accumulate content         let content = '';          \/\/ Get a reader for the response body stream         const reader = response.body.getReader();         \/\/ Initialize a TextDecoder to decode the response stream         const decoder = new TextDecoder();          \/\/ Continuously read the response stream until done         while (true) {             const {done, value} = await reader.read();              if (done) {                 break;             }              \/\/ Decode the current chunk of the response and split it into lines             const chunk = decoder.decode(value);             const lines = chunk.split('\\n');              \/\/ Process each line of the response             for (const line of lines) {                 if (line.startsWith('data: ')) {                     \/\/ If the line contains the '[DONE]' marker, stop processing                     if (line.includes('[DONE]')) {                         break;                     }                      \/\/ Extract the data object from the line and append the content to the accumulated content                     const data = JSON.parse(line.slice(6));                      if (data.choices &amp;&amp; data.choices[0].delta &amp;&amp; data.choices[0].delta.content) {                         content += data.choices[0].delta.content;                         \/\/ Call the onPartialResult callback with the accumulated content                         onPartialResult(content);                     }                 }             }         }          \/\/ Call the onFullResult callback with the final accumulated content         onFullResult(content);     } catch (error) {         \/\/ If an error occurs during the request, call the onError callback with the error         onError(error);     } }<\/code><\/pre>\n<h2>\u041f\u0440\u043e\u043c\u0442 \u0434\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438<\/h2>\n<p>\u041f\u0440\u043e\u043c\u0442 \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0438\u0437 \u0434\u0432\u0443\u0445 \u0447\u0430\u0441\u0442\u0435\u0439: <\/p>\n<ol>\n<li>\n<p>\u0421\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u044f\u0437\u044b\u043a\u0430<\/p>\n<\/li>\n<li>\n<p>\u041d\u0430\u0431\u043e\u0440 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u044f\u0437\u044b\u043a\u0430 (\u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0443\u0441\u0442\u044b\u043c)<\/p>\n<\/li>\n<\/ol>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435:<\/p>\n<pre><code class=\"javascript\">\/**  * Generates a system message for a language correction task, based on the given language and correction type.  *   * @function getLanguageCorrectionSystemMessage  * @param {string} language - The language code for the target language.  * @param {string} correctionType - The type of correction to be performed, either \"grammar\" or \"natural\".  * @returns {string} - The system message to be used as a prompt for the GPT model.  *\/ function getLanguageCorrectionSystemMessage(language, correctionType) {     \/\/codeToLanguage(languageCode) just converts the language code to the language name. eg: codeToLanguage(\"fr\") -> \"French\"     if (correctionType === \"grammar\") {         return \"You're CorrectGPT.\\n\" +             \"You fix grammar and spelling mistakes in \" + codeToLanguage(language) + \" texts.\\n\" +             \"Please only fix grammar and spelling mistakes in the user message.\\n\" +             \"Your reply should contain ONLY the corrected text, nothing else.\\n\" +             \"Please use exactly the same formatting as the original text.\\n\"     }     if (correctionType === \"natural\") {         return \"You're ImproveGPT.\\n\" +             \"You improve the provided \" + codeToLanguage(language) + \" text language-wise: you fix grammar and spelling mistakes and make it sound more natural.\\n\" +             \"Your reply should contain ONLY the corrected text, nothing else.\\n\"+             \"Please use exactly the same formatting as the original text\\n\"     } }<\/code><\/pre>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u044b:<\/p>\n<pre><code class=\"javascript\">\/**  * Generates examples for a language correction task, based on the given language and correction type.  *   * @function getLanguageCorrectionSystemMessage  * @param {string} language - The language code for the target language.  * @param {string} correctionType - The type of correction to be performed, either \"grammar\" or \"natural\".  * @returns {Array} - The array of examples for the GPT model prompt.  *\/  function getLanguageCorrectionExamples(language, correctionType) {     if (correctionType === \"grammar\") {         if (language === \"en\") {             return [                 [                     \"He don't like it\",                     \"He doesn't like it\"                 ],                 [                     \"GPT does supports multiple languages without any isses but problem is with search engine. The best models for saerch are English-only. Obviously, there are mulrtilingual models (including OpenAI embeddings) but they will yield more bad search quality.\",                     \"GPT does support multiple languages without any issues but the problem is with the search engine. The best models for search are English-only. Obviously there are multilingual models (including OpenAI embeddings) but they will yield worse search quality.\"                 ]             ]         }         if (language === \"ru\") {             return [                 [                     \"\u041c\u043e\u0451 \u0441\u0435\u0440\u0434\u0446\u0435 \u0431\u043e\u043b\u0435\u0442 \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0442\u043e\u0439 \u0434\u0435\u0432\u0443\u0448\u043a\u0435\",                     \"\u041c\u043e\u0451 \u0441\u0435\u0440\u0434\u0446\u0435 \u0431\u043e\u043b\u0438\u0442 \u0438\u0437-\u0437\u0430 \u0442\u043e\u0439 \u0434\u0435\u0432\u0443\u0448\u043a\u0438\"                 ],                 [                     \"\u043d\u043c \u043d\u0443\u0436\u043d\u043e \u0443\u0439\u0442\u0438 \u043d\u043e \u043e\u043d\u0430 \u043d\u0435 \u043c\u043e\u0436\u0442 \u043d\u0430\u0439\u0442\u0438 \u0435\u0451 \u043e\u0431\u0443\u0432\u044c\",                     \"\u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0443\u0445\u043e\u0434\u0438\u0442\u044c, \u043d\u043e \u043e\u043d\u0430 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0439\u0442\u0438 \u0441\u0432\u043e\u044e \u043e\u0431\u0443\u0432\u044c\"                 ],                 [                     \"\u044d\u0442\u0430 \u0442\u0430\u0440\u043b\u0435\u043a\u0430 - \u0433\u0440\u044f\u0437\u043d\u0430\u044f, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0435\u0451 \u043c\u044b\u0442\u044c\",                     \"\u044d\u0442\u0430 \u0442\u0430\u0440\u0435\u043b\u043a\u0430 \u0433\u0440\u044f\u0437\u043d\u0430\u044f, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0435\u0451 \u0432\u044b\u043c\u044b\u0442\u044c\"                 ],                 [                     \"\u044f\u0442\u0440\u043e\u043c\u0435\u0445\u0430\u043d\u0438\u043a\u0430, \u044d\u0442\u043e \u0441\u0442\u0430\u0440\u044b\u0439 \u0432\u0438\u0434 \u0444\u0438\u0437\u0438\u043a\u0438 \u043d\u043e \u0443\u0447\u0451\u043d\u044b\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u0435\u0451 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u044e\u0442\",                     \"\u044f\u0442\u0440\u043e\u043c\u0435\u0445\u0430\u043d\u0438\u043a\u0430 - \u044d\u0442\u043e \u0441\u0442\u0430\u0440\u044b\u0439 \u0432\u0438\u0434 \u0444\u0438\u0437\u0438\u043a\u0438, \u043d\u043e \u0443\u0447\u0451\u043d\u044b\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 \u0435\u0439 \u043d\u0435 \u0437\u0430\u043d\u0438\u043c\u0430\u044e\u0442\u0441\u044f\"                 ],                 [                     \"\u042f \u043e\u0447\u0435\u043d\u044c \u043b\u044e\u0431\u043b\u044e \u0432\u0441\u0435\u0445 \u0436\u0438\u0432\u043e\u0442\u043d\u044b\u0445. \u044f \u043c\u043e\u0433\u0443 \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u0447\u0442\u043e \u044f \u043b\u044e\u0431\u043b\u044e \u0432\u0441\u0435 \u0432\u0438\u0434\u044b \u0436\u0438\u0432\u043e\u0442\u043d\u044b\u0445 - \u043e\u0442 \u0445\u043e\u043c\u044f\u043a\u043e\u0432, \u0441\u043e\u0431\u0430\u043a, \u043a\u043e\u0448\u0435\u043a, \u043f\u043e\u043f\u0443\u0433\u0430\u0435\u0432, \u0434\u043e \u0437\u043c\u0435\u0439. \u0443 \u043c\u0435\u043d\u044f \u0435\u0441\u0442\u044c \u0434\u0432\u0435 \u0434\u043e\u043c\u0430\u0448\u043d\u0438\u0435 \u0436\u0438\u0432\u043e\u0442\u043d\u044b\u0435. \u0427\u0435\u0442\u044b\u0440\u0435 \u043c\u0435\u0441\u044f\u0446\u0430 \u043d\u0430\u0437\u0430\u0434 \u0411\u0430\u0431\u0443\u0448\u043a\u0438\u043d\u0430 \u043a\u043e\u0448\u043a\u0430 \u0440\u043e\u0434\u0438\u043b\u0430 \u043c\u043e\u044f \u0434\u0432\u0430 \u043a\u043e\u0442\u0430. \u041e\u043d\u0438 \u0437\u043e\u0432\u0443\u0442 \u041c\u0430\u0437\u0430 \u0438 \u041c\u0430\u043a\u0441, \u0438\u043c \u0447\u0435\u0442\u044b\u0440\u0435 \u043c\u0435\u0441\u044f\u0446\u0435\u0432. \u041e\u043d\u0438 \u043e\u0431\u0430 \u0435\u0449\u0451 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0435, \u0443 \u041c\u0430\u043a\u0441\u0430 \u0435\u0441\u0442\u044c \u043e\u0447\u0435\u043d\u044c \u0434\u043b\u0438\u043d\u043d\u0430\u044f \u0438 \u0433\u0443\u0441\u0442\u0430\u044f \u0448\u0435\u0440\u0441\u0442\u044c, \u0445\u043e\u0442\u044f \u0443 \u041c\u0430\u0437\u044b \u043a\u043e\u0440\u043e\u0442\u043a\u0430\u044f \u0448\u0435\u0440\u0441\u0442\u044c. \u041c\u0430\u0437\u0430 \u0438 \u041c\u0430\u043a\u0441 - \u0443\u043c\u043d\u0438\u0435 \u043a\u043e\u0448\u043a\u0438, \u043a\u043e\u0433\u0434\u0430 \u044f \u0433\u043e\u0432\u043e\u0440\u044e \u0441 \u0438\u043c\u0438 \u043e\u043d\u0438 \u043c\u0435\u043d\u044f \u0432\u0441\u0435\u0433\u0434\u0430 \u043f\u043e\u043d\u0438\u043c\u0430\u044e\u0442. \u0426\u0432\u0435\u0442 \u0448\u0435\u0440\u0441\u0442\u0438 \u0443 \u0438\u0445 \u043a\u043e\u0440\u0438\u0447\u043d\u0435\u0432\u044b\u0439-\u0431\u0435\u043b\u044b\u0439, \u0433\u043b\u0430\u0437\u0430 \u0437\u0435\u043b\u0451\u043d\u044b\u0435. \u041a\u043e\u0433\u0434\u0430 \u043e\u043d\u0438 \u0431\u044b\u043b\u0438 \u0435\u0449\u0451 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0435, \u043e\u043d\u0438 \u0431\u044b\u043b\u0438 \u043e\u0447\u0435\u043d\u044c \u0448\u0443\u0441\u0442\u0440\u044b\u043c, \u043c\u044b \u043d\u0435 \u043c\u043e\u0433\u043b\u0438 \u0437\u0430 \u043d\u0438\u043c\u0438 \u0443\u0441\u043b\u0435\u0434\u0438\u0442\u044c. \u041a\u0443\u0434\u0430 \u0431\u044b \u043c\u044b \u043d\u0438 \u043f\u043e\u0448\u043b\u0438, \u043c\u044b \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u0435\u0440\u0435\u043c \u0438\u0445 \u0441\u043e \u0441\u043e\u0431\u043e\u0439. \u041e\u043d\u0438 \u043f\u043e\u044f\u0432\u0438\u043b\u0438\u0441\u044c \u043a\u043e \u043c\u043d\u0435 \u043e\u0442 \u043a\u043e\u0448\u043a\u0438 \u043c\u043e\u0435\u0439 \u0431\u0430\u0431\u0443\u0448\u043a\u0438. \u041e \u0438\u043c \u0437\u0430\u0431\u043e\u0442\u0438\u0442\u044c\u0441\u044f \u044f \u0438 \u043c\u043e\u0439 \u043f\u0430\u043f\u0430. \u042f \u0438\u0445 \u043a\u043e\u0440\u043c\u043b\u044e \u0434\u0432\u0430\u0436\u0434\u044b \u0432 \u0434\u0435\u043d\u044c \u0430 \u043c\u043e\u0439 \u043f\u0430\u043f\u0430 \u0438\u0445 \u0432\u044b\u0433\u0443\u043b\u0438\u0432\u0430\u0435\u0442 \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u0432 \u0434\u0435\u043d\u044c. \u0438\u0445 \u043b\u044e\u0431\u0438\u043c\u0430\u044f \u0438\u0433\u0440\u0443\u0448\u043a\u0430 - \u043f\u043b\u0430\u0441\u0442\u0438\u043a\u043e\u0432\u0430\u044f \u043c\u044b\u0448\u044c. \u042f \u043e\u0447\u0435\u043d\u044c \u043b\u044e\u0431\u043b\u044e \u0441\u0432\u043e\u0438\u0445 \u0437\u0435\u043b\u0435\u043d\u043e\u0433\u043b\u0430\u0437\u044b\u0445 \u043a\u043e\u0448\u0435\u043a\",                     \"\u042f \u043e\u0447\u0435\u043d\u044c \u043b\u044e\u0431\u043b\u044e \u0432\u0441\u0435\u0445 \u0436\u0438\u0432\u043e\u0442\u043d\u044b\u0445. \u044f \u043c\u043e\u0433\u0443 \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u044f \u043b\u044e\u0431\u043b\u044e \u0432\u0441\u0435 \u0432\u0438\u0434\u044b \u0436\u0438\u0432\u043e\u0442\u043d\u044b\u0445 - \u043e\u0442 \u0445\u043e\u043c\u044f\u043a\u043e\u0432, \u0441\u043e\u0431\u0430\u043a, \u043a\u043e\u0448\u0435\u043a, \u043f\u043e\u043f\u0443\u0433\u0430\u0435\u0432, \u0434\u043e \u0437\u043c\u0435\u0439. \u0443 \u043c\u0435\u043d\u044f \u0435\u0441\u0442\u044c \u0434\u0432\u043e\u0435 \u0434\u043e\u043c\u0430\u0448\u043d\u0438\u0445 \u0436\u0438\u0432\u043e\u0442\u043d\u044b\u0445. \u0427\u0435\u0442\u044b\u0440\u0435 \u043c\u0435\u0441\u044f\u0446\u0430 \u043d\u0430\u0437\u0430\u0434 \u0431\u0430\u0431\u0443\u0448\u043a\u0438\u043d\u0430 \u043a\u043e\u0448\u043a\u0430 \u0440\u043e\u0434\u0438\u043b\u0430 \u043c\u043e\u0438\u0445 \u0434\u0432\u0443\u0445 \u043a\u043e\u0442\u043e\u0432. \u0418\u0445 \u0437\u043e\u0432\u0443\u0442 \u041c\u0430\u0437\u0430 \u0438 \u041c\u0430\u043a\u0441, \u0438\u043c \u0447\u0435\u0442\u044b\u0440\u0435 \u043c\u0435\u0441\u044f\u0446\u0430. \u041e\u043d\u0438 \u043e\u0431\u0430 \u0435\u0449\u0451 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0435, \u0443 \u041c\u0430\u043a\u0441\u0430 \u043e\u0447\u0435\u043d\u044c \u0434\u043b\u0438\u043d\u043d\u0430\u044f \u0438 \u0433\u0443\u0441\u0442\u0430\u044f \u0448\u0435\u0440\u0441\u0442\u044c, \u0445\u043e\u0442\u044f \u0443 \u041c\u0430\u0437\u044b \u043a\u043e\u0440\u043e\u0442\u043a\u0430\u044f \u0448\u0435\u0440\u0441\u0442\u044c. \u041c\u0430\u0437\u0430 \u0438 \u041c\u0430\u043a\u0441 - \u0443\u043c\u043d\u044b\u0435 \u043a\u043e\u0448\u043a\u0438, \u043a\u043e\u0433\u0434\u0430 \u044f \u0433\u043e\u0432\u043e\u0440\u044e \u0441 \u043d\u0438\u043c\u0438, \u043e\u043d\u0438 \u043c\u0435\u043d\u044f \u0432\u0441\u0435\u0433\u0434\u0430 \u043f\u043e\u043d\u0438\u043c\u0430\u044e\u0442. \u0426\u0432\u0435\u0442 \u0448\u0435\u0440\u0441\u0442\u0438 \u0443 \u043d\u0438\u0445 \u043a\u043e\u0440\u0438\u0447\u043d\u0435\u0432\u043e-\u0431\u0435\u043b\u044b\u0439, \u0433\u043b\u0430\u0437\u0430 \u0437\u0435\u043b\u0451\u043d\u044b\u0435. \u041a\u043e\u0433\u0434\u0430 \u043e\u043d\u0438 \u0431\u044b\u043b\u0438 \u0435\u0449\u0451 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u043c\u0438, \u043e\u043d\u0438 \u0431\u044b\u043b\u0438 \u043e\u0447\u0435\u043d\u044c \u0448\u0443\u0441\u0442\u0440\u044b\u043c\u0438, \u043c\u044b \u043d\u0435 \u043c\u043e\u0433\u043b\u0438 \u0437\u0430 \u043d\u0438\u043c\u0438 \u0443\u0441\u043b\u0435\u0434\u0438\u0442\u044c. \u041a\u0443\u0434\u0430 \u0431\u044b \u043c\u044b \u043d\u0438 \u043f\u043e\u0448\u043b\u0438, \u043c\u044b \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u0435\u0440\u0435\u043c \u0438\u0445 \u0441 \u0441\u043e\u0431\u043e\u0439. \u041e\u043d\u0438 \u043f\u043e\u044f\u0432\u0438\u043b\u0438\u0441\u044c \u0443 \u043c\u0435\u043d\u044f \u043e\u0442 \u043a\u043e\u0448\u043a\u0438 \u043c\u043e\u0435\u0439 \u0431\u0430\u0431\u0443\u0448\u043a\u0438. \u041e \u043d\u0438\u0445 \u0437\u0430\u0431\u043e\u0442\u0438\u043c\u0441\u044f \u044f \u0438 \u043c\u043e\u0439 \u043f\u0430\u043f\u0430. \u042f \u0438\u0445 \u043a\u043e\u0440\u043c\u043b\u044e \u0434\u0432\u0430\u0436\u0434\u044b \u0432 \u0434\u0435\u043d\u044c, \u0430 \u043c\u043e\u0439 \u043f\u0430\u043f\u0430 \u0438\u0445 \u0432\u044b\u0433\u0443\u043b\u0438\u0432\u0430\u0435\u0442 \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u0432 \u0434\u0435\u043d\u044c. \u0418\u0445 \u043b\u044e\u0431\u0438\u043c\u0430\u044f \u0438\u0433\u0440\u0443\u0448\u043a\u0430 - \u043f\u043b\u0430\u0441\u0442\u0438\u043a\u043e\u0432\u0430\u044f \u043c\u044b\u0448\u044c. \u042f \u043e\u0447\u0435\u043d\u044c \u043b\u044e\u0431\u043b\u044e \u0441\u0432\u043e\u0438\u0445 \u0437\u0435\u043b\u0435\u043d\u043e\u0433\u043b\u0430\u0437\u044b\u0445 \u043a\u043e\u0448\u0435\u043a\",                 ]             ]         }     } else {         if (language === \"en\") {             return [                 [                     \"As far as our portals are Eng-based, so I deem it is not necssary to expect some language packs over English\",                     \"Since our portal is English-based, I don't think it's necessary to have language packs besides English.\"                 ],                 [                     \"GPT does supports multiple languages without any isses but problem is with search engine. The best models for saerch are English-only. Obviously, there are mulrtilingual models (including OpenAI embeddings) but they will yield more bad search quality.\",                     \"GPT is indeed capable of supporting multiple languages seamlessly, but the issue lies with the search engine. The most effective models for search are English-only. While there are multilingual models available (including OpenAI embeddings), they will yield inferior search quality.\"                 ]             ]         }         if (language === \"ru\") {             return [                 [                     \"\u043d\u043c \u043d\u0443\u0436\u043d\u043e \u0443\u0439\u0442\u0438 \u043d\u043e \u043e\u043d\u0430 \u043d\u0435 \u043c\u043e\u0436\u0442 \u043d\u0430\u0439\u0442\u0438 \u0435\u0451 \u043e\u0431\u0443\u0432\u044c\",                     \"\u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0443\u0445\u043e\u0434\u0438\u0442\u044c, \u043d\u043e \u043e\u043d\u0430 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0439\u0442\u0438 \u0441\u0432\u043e\u044e \u043e\u0431\u0443\u0432\u044c\"                 ],                 [                     \"\u044d\u0442\u0430 \u0442\u0430\u0440\u043b\u0435\u043a\u0430 - \u0433\u0440\u044f\u0437\u043d\u0430\u044f, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0435\u0451 \u043c\u044b\u0442\u044c\",                     \"\u044d\u0442\u0430 \u0442\u0430\u0440\u0435\u043b\u043a\u0430 \u0433\u0440\u044f\u0437\u043d\u0430\u044f, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0435\u0451 \u0432\u044b\u043c\u044b\u0442\u044c\"                 ],                 [                     \"\u044f \u0445\u043e\u0447\u0443 \u043a\u0443\u043f\u0438\u0442\u044c \u043d\u043e\u0432\u0443\u044e \u043c\u0430\u0448\u0438\u043d\u0443, \u043d\u043e \u043c\u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u0434\u0430\u0442\u044c \u0441\u0432\u043e\u044e \u0441\u0442\u0430\u0440\u0443\u044e \u043c\u0430\u0448\u0438\u043d\u0443\",                     \"\u044f \u0445\u043e\u0447\u0443 \u043a\u0443\u043f\u0438\u0442\u044c \u043d\u043e\u0432\u0443\u044e \u043c\u0430\u0448\u0438\u043d\u0443, \u043d\u043e \u043c\u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u0440\u043e\u0434\u0430\u0442\u044c \u0441\u0432\u043e\u044e \u0441\u0442\u0430\u0440\u0443\u044e\"                 ],                 [                     \"\u043a\u0442\u043e \u043c\u043e\u0433 \u043f\u0440\u043e\u0434\u0430\u0442\u044c \u043c\u043d\u0435 \u043d\u0438\u0441\u0441\u0430\u043d \u0444\u0440\u043e\u043d\u0442\u0438\u0440 \u043f\u043e \u0445\u043e\u0440\u043e\u0448\u0430\u044f \u0446\u0435\u043d\u0430?\",                     \"\u043a\u0442\u043e \u043c\u043e\u0433 \u0431\u044b \u043f\u0440\u043e\u0434\u0430\u0442\u044c \u043c\u043d\u0435 Nissan Frontier \u043f\u043e \u0445\u043e\u0440\u043e\u0448\u0435\u0439 \u0446\u0435\u043d\u0435?\"                 ],                 [                     \"\u042f \u043e\u0447\u0435\u043d\u044c \u043b\u044e\u0431\u043b\u044e \u0432\u0441\u0435\u0445 \u0436\u0438\u0432\u043e\u0442\u043d\u044b\u0445. \u044f \u043c\u043e\u0433\u0443 \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u0447\u0442\u043e \u044f \u043b\u044e\u0431\u043b\u044e \u0432\u0441\u0435 \u0432\u0438\u0434\u044b \u0436\u0438\u0432\u043e\u0442\u043d\u044b\u0445 - \u043e\u0442 \u0445\u043e\u043c\u044f\u043a\u043e\u0432, \u0441\u043e\u0431\u0430\u043a, \u043a\u043e\u0448\u0435\u043a, \u043f\u043e\u043f\u0443\u0433\u0430\u0435\u0432, \u0434\u043e \u0437\u043c\u0435\u0439. \u0443 \u043c\u0435\u043d\u044f \u0435\u0441\u0442\u044c \u0434\u0432\u0435 \u0434\u043e\u043c\u0430\u0448\u043d\u0438\u0435 \u0436\u0438\u0432\u043e\u0442\u043d\u044b\u0435. \u0427\u0435\u0442\u044b\u0440\u0435 \u043c\u0435\u0441\u044f\u0446\u0430 \u043d\u0430\u0437\u0430\u0434 \u0411\u0430\u0431\u0443\u0448\u043a\u0438\u043d\u0430 \u043a\u043e\u0448\u043a\u0430 \u0440\u043e\u0434\u0438\u043b\u0430 \u043c\u043e\u044f \u0434\u0432\u0430 \u043a\u043e\u0442\u0430. \u041e\u043d\u0438 \u0437\u043e\u0432\u0443\u0442 \u041c\u0430\u0437\u0430 \u0438 \u041c\u0430\u043a\u0441, \u0438\u043c \u0447\u0435\u0442\u044b\u0440\u0435 \u043c\u0435\u0441\u044f\u0446\u0435\u0432. \u041e\u043d\u0438 \u043e\u0431\u0430 \u0435\u0449\u0451 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0435, \u0443 \u041c\u0430\u043a\u0441\u0430 \u0435\u0441\u0442\u044c \u043e\u0447\u0435\u043d\u044c \u0434\u043b\u0438\u043d\u043d\u0430\u044f \u0438 \u0433\u0443\u0441\u0442\u0430\u044f \u0448\u0435\u0440\u0441\u0442\u044c, \u0445\u043e\u0442\u044f \u0443 \u041c\u0430\u0437\u044b \u043a\u043e\u0440\u043e\u0442\u043a\u0430\u044f \u0448\u0435\u0440\u0441\u0442\u044c. \u041c\u0430\u0437\u0430 \u0438 \u041c\u0430\u043a\u0441 - \u0443\u043c\u043d\u0438\u0435 \u043a\u043e\u0448\u043a\u0438, \u043a\u043e\u0433\u0434\u0430 \u044f \u0433\u043e\u0432\u043e\u0440\u044e \u0441 \u0438\u043c\u0438 \u043e\u043d\u0438 \u043c\u0435\u043d\u044f \u0432\u0441\u0435\u0433\u0434\u0430 \u043f\u043e\u043d\u0438\u043c\u0430\u044e\u0442. \u0426\u0432\u0435\u0442 \u0448\u0435\u0440\u0441\u0442\u0438 \u0443 \u0438\u0445 \u043a\u043e\u0440\u0438\u0447\u043d\u0435\u0432\u044b\u0439-\u0431\u0435\u043b\u044b\u0439, \u0433\u043b\u0430\u0437\u0430 \u0437\u0435\u043b\u0451\u043d\u044b\u0435. \u041a\u043e\u0433\u0434\u0430 \u043e\u043d\u0438 \u0431\u044b\u043b\u0438 \u0435\u0449\u0451 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0435, \u043e\u043d\u0438 \u0431\u044b\u043b\u0438 \u043e\u0447\u0435\u043d\u044c \u0448\u0443\u0441\u0442\u0440\u044b\u043c, \u043c\u044b \u043d\u0435 \u043c\u043e\u0433\u043b\u0438 \u0437\u0430 \u043d\u0438\u043c\u0438 \u0443\u0441\u043b\u0435\u0434\u0438\u0442\u044c. \u041a\u0443\u0434\u0430 \u0431\u044b \u043c\u044b \u043d\u0438 \u043f\u043e\u0448\u043b\u0438, \u043c\u044b \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u0435\u0440\u0435\u043c \u0438\u0445 \u0441\u043e \u0441\u043e\u0431\u043e\u0439. \u041e\u043d\u0438 \u043f\u043e\u044f\u0432\u0438\u043b\u0438\u0441\u044c \u043a\u043e \u043c\u043d\u0435 \u043e\u0442 \u043a\u043e\u0448\u043a\u0438 \u043c\u043e\u0435\u0439 \u0431\u0430\u0431\u0443\u0448\u043a\u0438. \u041e \u0438\u043c \u0437\u0430\u0431\u043e\u0442\u0438\u0442\u044c\u0441\u044f \u044f \u0438 \u043c\u043e\u0439 \u043f\u0430\u043f\u0430. \u042f \u0438\u0445 \u043a\u043e\u0440\u043c\u043b\u044e \u0434\u0432\u0430\u0436\u0434\u044b \u0432 \u0434\u0435\u043d\u044c \u0430 \u043c\u043e\u0439 \u043f\u0430\u043f\u0430 \u0438\u0445 \u0432\u044b\u0433\u0443\u043b\u0438\u0432\u0430\u0435\u0442 \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u0432 \u0434\u0435\u043d\u044c. \u0438\u0445 \u043b\u044e\u0431\u0438\u043c\u0430\u044f \u0438\u0433\u0440\u0443\u0448\u043a\u0430 - \u043f\u043b\u0430\u0441\u0442\u0438\u043a\u043e\u0432\u0430\u044f \u043c\u044b\u0448\u044c. \u042f \u043e\u0447\u0435\u043d\u044c \u043b\u044e\u0431\u043b\u044e \u0441\u0432\u043e\u0438\u0445 \u0437\u0435\u043b\u0435\u043d\u043e\u0433\u043b\u0430\u0437\u044b\u0445 \u043a\u043e\u0448\u0435\u043a\",                     \"\u042f \u043e\u0447\u0435\u043d\u044c \u043b\u044e\u0431\u043b\u044e \u0432\u0441\u0435\u0445 \u0436\u0438\u0432\u043e\u0442\u043d\u044b\u0445. \u044f \u043c\u043e\u0433\u0443 \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u044f \u043b\u044e\u0431\u043b\u044e \u0432\u0441\u0435 \u0432\u0438\u0434\u044b \u0436\u0438\u0432\u043e\u0442\u043d\u044b\u0445 - \u043e\u0442 \u0445\u043e\u043c\u044f\u043a\u043e\u0432, \u0441\u043e\u0431\u0430\u043a, \u043a\u043e\u0448\u0435\u043a, \u043f\u043e\u043f\u0443\u0433\u0430\u0435\u0432, \u0434\u043e \u0437\u043c\u0435\u0439. \u0443 \u043c\u0435\u043d\u044f \u0435\u0441\u0442\u044c \u0434\u0432\u043e\u0435 \u0434\u043e\u043c\u0430\u0448\u043d\u0438\u0445 \u0436\u0438\u0432\u043e\u0442\u043d\u044b\u0445. \u0427\u0435\u0442\u044b\u0440\u0435 \u043c\u0435\u0441\u044f\u0446\u0430 \u043d\u0430\u0437\u0430\u0434 \u043a\u043e\u0448\u043a\u0430 \u043c\u043e\u0435\u0439 \u0431\u0430\u0431\u0443\u0448\u043a\u0438 \u0440\u043e\u0434\u0438\u043b\u0430 \u0434\u0432\u0443\u0445 \u043a\u043e\u0442\u044f\u0442. \u0418\u0445 \u0437\u043e\u0432\u0443\u0442 \u041c\u0430\u0437\u0430 \u0438 \u041c\u0430\u043a\u0441, \u0438\u043c \u043f\u043e \u0447\u0435\u0442\u044b\u0440\u0435 \u043c\u0435\u0441\u044f\u0446\u0430. \u041e\u043d\u0438 \u043e\u0431\u0430 \u0435\u0449\u0451 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0435. \u0423 \u041c\u0430\u043a\u0441\u0430 \u043e\u0447\u0435\u043d\u044c \u0434\u043b\u0438\u043d\u043d\u0430\u044f \u0438 \u0433\u0443\u0441\u0442\u0430\u044f \u0448\u0435\u0440\u0441\u0442\u044c, \u0445\u043e\u0442\u044f \u0443 \u041c\u0430\u0437\u044b - \u043a\u043e\u0440\u043e\u0442\u043a\u0430\u044f. \u041c\u0430\u0437\u0430 \u0438 \u041c\u0430\u043a\u0441 - \u0443\u043c\u043d\u044b\u0435 \u043a\u043e\u0448\u043a\u0438, \u043a\u043e\u0433\u0434\u0430 \u044f \u0433\u043e\u0432\u043e\u0440\u044e \u0441 \u043d\u0438\u043c\u0438, \u043e\u043d\u0438 \u0432\u0441\u0435\u0433\u0434\u0430 \u043c\u0435\u043d\u044f \u043f\u043e\u043d\u0438\u043c\u0430\u044e\u0442. \u0426\u0432\u0435\u0442 \u0448\u0435\u0440\u0441\u0442\u0438 \u0443 \u043d\u0438\u0445 \u043a\u043e\u0440\u0438\u0447\u043d\u0435\u0432\u043e-\u0431\u0435\u043b\u044b\u0439, \u0433\u043b\u0430\u0437\u0430 \u0437\u0435\u043b\u0451\u043d\u044b\u0435. \u041a\u043e\u0433\u0434\u0430 \u043e\u043d\u0438 \u0431\u044b\u043b\u0438 \u0435\u0449\u0451 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u043c\u0438, \u043e\u043d\u0438 \u0431\u044b\u043b\u0438 \u043e\u0447\u0435\u043d\u044c \u0448\u0443\u0441\u0442\u0440\u044b\u043c\u0438, \u043c\u044b \u043d\u0435 \u043c\u043e\u0433\u043b\u0438 \u0437\u0430 \u043d\u0438\u043c\u0438 \u0443\u0441\u043b\u0435\u0434\u0438\u0442\u044c. \u041a\u0443\u0434\u0430 \u0431\u044b \u043c\u044b \u043d\u0438 \u043f\u043e\u0448\u043b\u0438, \u043c\u044b \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u0435\u0440\u0435\u043c \u0438\u0445 \u0441 \u0441\u043e\u0431\u043e\u0439. \u0418\u0445 \u0440\u043e\u0434\u0438\u043b\u0430 \u043a\u043e\u0448\u043a\u0430 \u043c\u043e\u0435\u0439 \u0431\u0430\u0431\u0443\u0448\u043a\u0438. \u041c\u044b \u0441 \u043c\u043e\u0438\u043c \u043f\u0430\u043f\u043e\u0439 \u0437\u0430\u0431\u043e\u0442\u0438\u043c\u0441\u044f \u043e \u043d\u0438\u0445. \u042f \u0438\u0445 \u043a\u043e\u0440\u043c\u043b\u044e \u0434\u0432\u0430\u0436\u0434\u044b \u0432 \u0434\u0435\u043d\u044c, \u0430 \u043c\u043e\u0439 \u043f\u0430\u043f\u0430 \u0438\u0445 \u0432\u044b\u0433\u0443\u043b\u0438\u0432\u0430\u0435\u0442 \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u0432 \u0434\u0435\u043d\u044c. \u0438\u0445 \u043b\u044e\u0431\u0438\u043c\u0430\u044f \u0438\u0433\u0440\u0443\u0448\u043a\u0430 - \u043f\u043b\u0430\u0441\u0442\u0438\u043a\u043e\u0432\u0430\u044f \u043c\u044b\u0448\u044c. \u042f \u043e\u0447\u0435\u043d\u044c \u043b\u044e\u0431\u043b\u044e \u0441\u0432\u043e\u0438\u0445 \u0437\u0435\u043b\u0435\u043d\u043e\u0433\u043b\u0430\u0437\u044b\u0445 \u043a\u043e\u0448\u0435\u043a\",                 ]             ]         }     }      return [] }<\/code><\/pre>\n<h2>NLP \u0432 React<\/h2>\n<h3>\u0422\u043e\u043a\u0435\u043d\u0438\u0437\u0430\u0446\u0438\u044f<\/h3>\n<p>\u0414\u043b\u044f \u0442\u043e\u043a\u0435\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0442\u0435\u043a\u0441\u0442\u043e\u0432 \u0432 JS \u044f \u0431\u044b\u0441\u0442\u0440\u043e \u043d\u0430\u0448\u0435\u043b <strong><em>Intl<\/em><\/strong>.Segmenter, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0435\u0432\u043e\u0441\u0445\u043e\u0434\u043d\u043e \u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441 \u0437\u0430\u0434\u0430\u0447\u0435\u0439. \u0427\u0442\u043e \u0432\u0430\u0436\u043d\u043e, \u043e\u043d \u0442\u0430\u043a\u0436\u0435 \u0443\u043c\u0435\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u044f\u0437\u044b\u043a\u0430\u043c\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u043a\u0438\u0442\u0430\u0439\u0441\u043a\u043e\u043c \u044f\u0437\u044b\u043a\u0435 \u043d\u0435 \u0441\u0442\u0430\u0432\u044f\u0442 \u043f\u0440\u043e\u0431\u0435\u043b\u043e\u0432, \u0442\u043e\u043a\u0435\u043d\u0438\u0437\u0430\u0442\u043e\u0440 \u0431\u0443\u0434\u0435\u0442 \u0434\u0435\u043b\u0438\u0442\u044c \u0442\u0435\u043a\u0441\u0442 \u043d\u0430 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0438\u0437 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0438\u0435\u0440\u043e\u0433\u043b\u0438\u0444\u043e\u0432.<\/p>\n<h3>\u0420\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u0435 \u044f\u0437\u044b\u043a\u0430<\/h3>\n<p>\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0434\u043b\u044f \u043a\u043e\u0440\u0440\u0435\u043a\u0446\u0438\u0438 \u0442\u0435\u043a\u0441\u0442\u0430 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u044f\u0437\u044b\u043a\u0430 \u0434\u043b\u044f \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0438 \u0442\u043e\u043a\u0435\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0442\u0435\u043a\u0441\u0442\u043e\u0432. \u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u044f\u0437\u044b\u043a \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e, \u043d\u043e \u0431\u043e\u043b\u0435\u0435 \u0443\u0434\u043e\u0431\u043d\u043e \u0438\u043c\u0435\u0442\u044c \u043e\u043f\u0446\u0438\u044e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f \u044f\u0437\u044b\u043a\u0430.<\/p>\n<p>\u0421 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u0435\u043c \u044f\u0437\u044b\u043a\u0430 \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b.<\/p>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u044f \u043d\u0430\u0442\u043a\u043d\u0443\u043b\u0441\u044f \u043d\u0430 \u043b\u0438\u0431\u0443 franc, \u043e\u043d\u0430 \u043d\u0435 \u043f\u043e\u0434\u043e\u0448\u043b\u0430 \u0438\u0437-\u0437\u0430 \u043e\u0442\u0432\u0440\u0430\u0442\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f.<\/p>\n<p>\u0417\u0430\u0442\u0435\u043c \u044f \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u043b \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0434\u0440\u0443\u0433\u0438\u0445 \u043b\u0438\u0431, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443 \u043c\u0435\u043d\u044f \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c (\u0432\u0438\u0434\u0438\u043c\u043e, \u043e\u043d\u0438 \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u044b \u0434\u043b\u044f Node.js). \u0411\u044b\u043b\u0430 \u043f\u0430\u0440\u0430 \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u0441 \u0432\u043d\u0435\u0448\u043d\u0438\u043c API, \u043d\u043e \u0434\u043b\u044f \u043c\u043e\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u044d\u0442\u043e \u043d\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442. <\/p>\n<p>\u041f\u043e\u0442\u043e\u043c \u0443 \u043c\u0435\u043d\u044f \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0430 \u0438\u0434\u0435\u044f \u0440\u0435\u0448\u0438\u0442\u044c \u044d\u0442\u0443 \u0437\u0430\u0434\u0430\u0447\u0443 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e GPT-3.5 API. \u0412 \u0446\u0435\u043b\u043e\u043c \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e, \u043d\u043e \u0432 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u043c\u043e\u0434\u0435\u043b\u044c \u043d\u0430\u0447\u0438\u043d\u0430\u043b\u0430 &#171;\u043b\u043e\u043c\u0430\u0442\u044c\u0441\u044f&#187; \u0438 \u0432\u044b\u0434\u0430\u0432\u0430\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u0432\u0440\u043e\u0434\u0435 &#171;It seems to be a text in English with a couple of Russian words thrown in there as well&#187; \u0432\u043c\u0435\u0441\u0442\u043e \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u044b\u0434\u0430\u0442\u044c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u044f\u0437\u044b\u043a\u0430 \u0432 \u043f\u0435\u0440\u0432\u044b\u0445 \u0434\u0432\u0443\u0445 \u0442\u043e\u043a\u0435\u043d\u0430\u0445. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u043e\u0431\u043e\u0439\u0442\u0438\u0441\u044c \u0431\u0435\u0437 \u0432\u0441\u044f\u043a\u043e\u0439 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0441\u0442\u0438, \u0447\u0442\u043e\u0431\u044b \u0434\u0435\u0442\u0435\u043a\u0446\u0438\u044f \u044f\u0437\u044b\u043a\u0430 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u043b\u0430 \u043c\u0433\u043d\u043e\u0432\u0435\u043d\u043d\u043e. \u0414\u0430 \u0438 \u0432\u043e\u043e\u0431\u0449\u0435, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c LLM \u0434\u043b\u044f \u0442\u0430\u043a\u043e\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 &#8212; \u044d\u0442\u043e \u043e\u0432\u0435\u0440\u043a\u0438\u043b\u043b.<\/p>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435 \u044f \u0431\u044b\u0441\u0442\u0440\u0435\u043d\u044c\u043a\u043e \u043d\u0430\u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434\u0438\u043b \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0434\u0435\u0442\u0435\u043a\u0442\u043e\u0440. \u041e\u043d \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u0442 \u043c\u0435\u0436\u0434\u0443 15 \u044f\u0437\u044b\u043a\u0430\u043c\u0438, \u043e\u043f\u0446\u0438\u0438 &#171;\u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0439 \u044f\u0437\u044b\u043a&#187; \u043d\u0435 \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u043e.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0443 \u044f\u0437\u044b\u043a\u0430 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043f\u0438\u0441\u044c\u043c\u0430, \u0442\u043e \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0442\u044c \u0442\u0435\u043a\u0441\u0442 \u043d\u0430 \u043d\u0435\u043c \u043d\u0435\u0441\u043b\u043e\u0436\u043d\u043e &#8212; \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0443\u0434\u043e\u0441\u0442\u043e\u0432\u0435\u0440\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u043f\u0440\u043e\u0446\u0435\u043d\u0442 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0438\u0437 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u0430\u043b\u0444\u0430\u0432\u0438\u0442\u0430 \u043f\u0440\u0435\u0432\u043e\u0441\u0445\u043e\u0434\u0438\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u043f\u043e\u0440\u043e\u0433. \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0442\u0430\u043a\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u043c\u043e\u0439 \u0434\u0435\u0442\u0435\u043a\u0442\u043e\u0440 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0451\u0442 \u043a\u0438\u0442\u0430\u0439\u0441\u043a\u0438\u0439, \u044f\u043f\u043e\u043d\u0441\u043a\u0438\u0439, \u043a\u043e\u0440\u0435\u0439\u0441\u043a\u0438\u0439, \u0445\u0438\u043d\u0434\u0438, \u0430\u0440\u043c\u044f\u043d\u0441\u043a\u0438\u0439, \u0433\u0440\u0443\u0437\u0438\u043d\u0441\u043a\u0438\u0439 \u0438 \u0442\u0430\u0439\u0441\u043a\u0438\u0439. \u0415\u0441\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0441 \u0434\u0435\u0432\u0430\u043d\u0430\u0433\u0430\u0440\u0438 &#8212; \u043e\u043d\u043e \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u043c\u0438 \u0438\u043d\u0434\u0438\u0439\u0441\u043a\u0438\u043c\u0438 \u044f\u0437\u044b\u043a\u0430\u043c\u0438, \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0445\u0438\u043d\u0434\u0438. \u042d\u0442\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439 \u044f \u043f\u043e\u043a\u0430 \u043f\u0440\u0435\u043d\u0435\u0431\u0440\u0435\u0433.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0442\u0435\u043a\u0441\u0442 \u043f\u0440\u043e\u0448\u0435\u043b \u0444\u0438\u043b\u044c\u0442\u0440 \u0432\u044b\u0448\u0435 (\u0442\u043e \u0435\u0441\u0442\u044c, \u043e\u043d \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u043d\u0430 \u043b\u0430\u0442\u0438\u043d\u0438\u0446\u0435 \u0438\u043b\u0438 \u043a\u0438\u0440\u0438\u043b\u043b\u0438\u0446\u0435), \u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044e \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043c\u0435\u0436\u0434\u0443 8 \u044f\u0437\u044b\u043a\u0430\u043c\u0438 &#8212; \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u0438\u0439, \u0440\u0443\u0441\u0441\u043a\u0438\u0439, \u0438\u0441\u043f\u0430\u043d\u0441\u043a\u0438\u0439, \u043d\u0435\u043c\u0435\u0446\u043a\u0438\u0439, \u0444\u0440\u0430\u043d\u0446\u0443\u0437\u0441\u043a\u0438\u0439, \u043f\u043e\u0440\u0442\u0443\u0433\u0430\u043b\u044c\u0441\u043a\u0438\u0439, \u0438\u0442\u0430\u043b\u044c\u044f\u043d\u0441\u043a\u0438\u0439, \u0433\u043e\u043b\u043b\u0430\u043d\u0434\u0441\u043a\u0438\u0439.<\/p>\n<p>\u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0437 \u044d\u0442\u0438\u0445 \u044f\u0437\u044b\u043a\u043e\u0432 \u044f \u0441\u043a\u0430\u0447\u0430\u043b \u0447\u0430\u0441\u0442\u043e\u0442\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u0441\u043b\u043e\u0432 \u0438 \u0434\u043b\u044f 1000 \u0441\u0430\u043c\u044b\u0445 \u0447\u0430\u0441\u0442\u043e\u0442\u043d\u044b\u0445 \u0441\u043b\u043e\u0432 \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u043b \u0438\u0445 \u043d\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u0447\u0430\u0441\u0442\u043e\u0442\u0443. \u0422\u0430\u043a\u0436\u0435 \u044f \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u043b \u043c\u0430\u0442\u043e\u0436\u0438\u0434\u0430\u043d\u0438\u0435 \u043d\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u043e\u0442\u044b \u0441\u043b\u043e\u0432\u0430, \u0435\u0441\u043b\u0438 \u043e\u043d\u043e \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 1000 \u0441\u0430\u043c\u044b\u0445 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u043d\u044b\u0445.<\/p>\n<p>\u0414\u0430\u043b\u0435\u0435, \u044f \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u044e <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%9C%D0%B5%D1%82%D0%BE%D0%B4_%D0%BC%D0%B0%D0%BA%D1%81%D0%B8%D0%BC%D0%B0%D0%BB%D1%8C%D0%BD%D0%BE%D0%B3%D0%BE_%D0%BF%D1%80%D0%B0%D0%B2%D0%B4%D0%BE%D0%BF%D0%BE%D0%B4%D0%BE%D0%B1%D0%B8%D1%8F\" rel=\"noopener noreferrer nofollow\">\u043c\u0435\u0442\u043e\u0434 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u0430\u0432\u0434\u043e\u043f\u043e\u0434\u043e\u0431\u0438\u044f<\/a>: \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u044f\u0437\u044b\u043a\u0430 \u044f \u0442\u043e\u043a\u0435\u043d\u0438\u0437\u0443\u044e \u0442\u0435\u043a\u0441\u0442 \u0438 \u0441\u0447\u0438\u0442\u0430\u044e \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u043d\u043e\u0441\u0442\u0438 \u0442\u0435\u043a\u0441\u0442\u0430 \u043a \u044f\u0437\u044b\u043a\u0443 \u043a\u0430\u043a \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043d\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0447\u0430\u0441\u0442\u043e\u0442 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u0441\u043b\u043e\u0432 (\u0438\u043b\u0438 \u0438\u0445 \u043c\u0430\u0442\u043e\u0436\u0438\u0434\u0430\u043d\u0438\u0439 \u0434\u043b\u044f \u0440\u0435\u0434\u043a\u0438\u0445 \u0441\u043b\u043e\u0432).<\/p>\n<h2>\u041f\u043e\u0438\u0441\u043a \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439<\/h2>\n<p>\u041f\u0443\u0441\u0442\u044c \u043d\u0430\u043c \u0434\u0430\u043d\u044b \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u0442\u0435\u043a\u0441\u0442 \u0438 \u0435\u0433\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f (\u043e\u0431\u0430 &#8212; \u0432 \u0432\u0438\u0434\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0441\u043b\u043e\u0432). \u0422\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043d\u0430\u0439\u0442\u0438 \u043a\u0440\u0430\u0442\u0447\u0430\u0439\u0448\u0438\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0434\u043b\u044f \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u0439. \u041e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0431\u044b\u0432\u0430\u044e\u0442 \u0442\u0440\u0435\u0445 \u0432\u0438\u0434\u043e\u0432: \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u0441\u043b\u043e\u0432\u0430, \u0432\u0441\u0442\u0430\u0432\u043a\u0430 \u0441\u043b\u043e\u0432\u0430 \u0438 \u0437\u0430\u043c\u0435\u043d\u0430 \u0441\u043b\u043e\u0432\u0430. \u0414\u043b\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0438\u043d\u0434\u0435\u043a\u0441 \u0443\u0434\u0430\u043b\u044f\u0435\u043c\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u0430, \u0434\u043b\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0432\u0441\u0442\u0430\u0432\u043a\u0438 &#8212; \u0438\u043d\u0434\u0435\u043a\u0441 \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u0430, \u0430 \u0434\u043b\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0437\u0430\u043c\u0435\u043d\u044b &#8212; \u043e\u0431\u0430 \u0438\u043d\u0434\u0435\u043a\u0441\u0430.<\/p>\n<p>\u041d\u0435\u0442\u0440\u0443\u0434\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0434\u043b\u0438\u043d\u0430 \u043d\u0430\u0448\u0435\u0433\u043e \u043a\u0440\u0430\u0442\u0447\u0430\u0439\u0448\u0435\u0433\u043e \u0441\u043f\u0438\u0441\u043a\u0430 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u043d\u0430 <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%A0%D0%B0%D1%81%D1%81%D1%82%D0%BE%D1%8F%D0%BD%D0%B8%D0%B5_%D0%9B%D0%B5%D0%B2%D0%B5%D0%BD%D1%88%D1%82%D0%B5%D0%B9%D0%BD%D0%B0\" rel=\"noopener noreferrer nofollow\">\u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u044e \u041b\u0435\u0432\u0435\u043d\u0448\u0442\u0435\u0439\u043d\u0430<\/a>. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0434\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447\u0438 \u043d\u0443\u0436\u043d\u043e \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0440\u0435\u0434\u0430\u043a\u0446\u0438\u043e\u043d\u043d\u043e\u0435 \u043f\u0440\u0435\u0434\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0432 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0435 \u041b\u0435\u0432\u0435\u043d\u0448\u0442\u0435\u0439\u043d\u0430.<\/p>\n<details class=\"spoiler\">\n<summary>\u041a\u043e\u0434<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"javascript\">\/**  * Given two string arrays, computes the minimal edit sequence of substitutions, insertion and deletion operations  * required to transform the first array into the second one  *  * @param {string[]} text1 - The first input array.  * @param {string[]} text2 - The second input array.  * @returns {Object[]} operations - The array of operations to transform text1 into text2.  *\/ function computeEditSequence(text1, text2) {     \/\/ Store the lengths of the two input arrays.     const m = text1.length, n = text2.length;      \/\/ Initialize a 2D matrix for dynamic programming, where dp[i][j] will     \/\/ hold the minimal edit distance between the substrings text1[0...i-1] and text2[0...j-1].     const dp = Array.from({length: m + 1}, () => Array(n + 1).fill(0));      \/\/ Set the base cases for the dynamic programming matrix.     \/\/ If text1 is empty, then the distance is the length of text2 (all insertions).     \/\/ If text2 is empty, then the distance is the length of text1 (all deletions).     for (let i = 0; i &lt;= m; i++) dp[i][0] = i;     for (let j = 0; j &lt;= n; j++) dp[0][j] = j;      \/\/ Iterate through the matrix, computing the minimal edit distances.     for (let i = 1; i &lt;= m; i++) {         for (let j = 1; j &lt;= n; j++) {             \/\/ If the current words are the same,             \/\/ no operation is needed, and the distance remains the same.             if (text1[i - 1] === text2[j - 1]) {                 dp[i][j] = dp[i - 1][j - 1];             } else {                 \/\/ If the current words are different, the minimal distance is                 \/\/ determined by the minimum of the three previous distances, plus 1.                 dp[i][j] = Math.min(dp[i - 1][j], dp[i][j - 1], dp[i - 1][j - 1]) + 1;             }         }     }      \/\/ Backtrack through the matrix to find the sequence of operations.     let i = m, j = n;     const operations = [];     while (i > 0 || j > 0) {         if (i > 0 &amp;&amp; j > 0 &amp;&amp; text1[i - 1] === text2[j - 1]) {             \/\/ If the words are the same, move diagonally up-left.             i--;             j--;         } else {             if (i > 0 &amp;&amp; dp[i][j] === dp[i - 1][j] + 1) {                 \/\/ If the minimal distance comes from the left, it's a deletion operation.                 let operation = {                     'type': \"delete\",                     'word': text1[i - 1],                     'index': i - 1,                 }                 operations.push(operation);                 i--;             } else if (j > 0 &amp;&amp; dp[i][j] === dp[i][j - 1] + 1) {                 \/\/ If the minimal distance comes from above, it's an insertion operation.                 let operation = {                     'type': \"insert\",                     'word': text2[j - 1],                     'index': j - 1,                 }                 operations.push(operation);                 j--;             } else {                 \/\/ If the minimal distance comes from the diagonal, it's a substitution operation.                 let operation = {                     'type': \"substitute\",                     'word': text2[j - 1],                     'index': j - 1,                     'originalIndex': i - 1,                     'originalWord': text1[i - 1],                 }                 operations.push(operation);                 i--;                 j--;             }         }     }      \/\/ Return the array of operations to transform text1 into text2.     return operations; }<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<h2>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b<\/h2>\n<p>\u0415\u0441\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c GPT-4, \u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u044e\u0442\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0444\u0438\u0433\u0435\u043d\u043d\u044b\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/023\/dd1\/94a\/023dd194a7196f7656f04ec11c29fb50.png\" alt=\"\u0418\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0433\u0440\u0430\u043c\u043c\u0430\u0442\u0438\u043a\u0438 \u0432 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0438 \u043d\u0430 \u0440\u0443\u0441\u0441\u043a\u043e\u043c \u043e\u0442 \u043d\u0435\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044f\" title=\"\u0418\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0433\u0440\u0430\u043c\u043c\u0430\u0442\u0438\u043a\u0438 \u0432 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0438 \u043d\u0430 \u0440\u0443\u0441\u0441\u043a\u043e\u043c \u043e\u0442 \u043d\u0435\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044f\" width=\"1830\" height=\"300\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/023\/dd1\/94a\/023dd194a7196f7656f04ec11c29fb50.png\"\/><\/p>\n<div><figcaption>\u0418\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0433\u0440\u0430\u043c\u043c\u0430\u0442\u0438\u043a\u0438 \u0432 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0438 \u043d\u0430 \u0440\u0443\u0441\u0441\u043a\u043e\u043c \u043e\u0442 \u043d\u0435\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044f<\/figcaption><\/div>\n<\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/d5b\/1a2\/81b\/d5b1a281b719c9b3a43cfafcedcbb975.png\" alt=\"\u0423\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u0435 \u0442\u0435\u043a\u0441\u0442\u0430, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0433\u043e \u0432 \u0441\u043b\u0435\u0433\u043a\u0430 \u043d\u0435\u0444\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u043c \u0441\u0442\u0438\u043b\u0435. \u0412\u0441\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043f\u043e \u0434\u0435\u043b\u0443\" title=\"\u0423\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u0435 \u0442\u0435\u043a\u0441\u0442\u0430, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0433\u043e \u0432 \u0441\u043b\u0435\u0433\u043a\u0430 \u043d\u0435\u0444\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u043c \u0441\u0442\u0438\u043b\u0435. \u0412\u0441\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043f\u043e \u0434\u0435\u043b\u0443\" width=\"1843\" height=\"441\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d5b\/1a2\/81b\/d5b1a281b719c9b3a43cfafcedcbb975.png\"\/><\/p>\n<div><figcaption>\u0423\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u0435 \u0442\u0435\u043a\u0441\u0442\u0430, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0433\u043e \u0432 \u0441\u043b\u0435\u0433\u043a\u0430 \u043d\u0435\u0444\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u043c \u0441\u0442\u0438\u043b\u0435. \u0412\u0441\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043f\u043e \u0434\u0435\u043b\u0443<\/figcaption><\/div>\n<\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/44c\/233\/1c5\/44c2331c56776b5d7be5bd8e54c280bc.png\" alt=\"\u0418\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 introduction, \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u043e\u0433\u043e \u0432 \u043e\u0434\u043d\u043e\u043c \u0434\u0438\u0441\u043a\u043e\u0440\u0434-\u0441\u0435\u0440\u0432\u0435\u0440\u0435\" title=\"\u0418\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 introduction, \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u043e\u0433\u043e \u0432 \u043e\u0434\u043d\u043e\u043c \u0434\u0438\u0441\u043a\u043e\u0440\u0434-\u0441\u0435\u0440\u0432\u0435\u0440\u0435\" width=\"1843\" height=\"327\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/44c\/233\/1c5\/44c2331c56776b5d7be5bd8e54c280bc.png\"\/><\/p>\n<div><figcaption>\u0418\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 introduction, \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u043e\u0433\u043e \u0432 \u043e\u0434\u043d\u043e\u043c \u0434\u0438\u0441\u043a\u043e\u0440\u0434-\u0441\u0435\u0440\u0432\u0435\u0440\u0435<\/figcaption><\/div>\n<\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/ba2\/bfd\/e04\/ba2bfde0445ccb90336bc835c011bc45.png\" alt=\"\u0423\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u0435 \u043c\u043e\u0435\u0433\u043e \u043d\u0435\u0444\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043d\u0430 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u043e\u043c\" title=\"\u0423\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u0435 \u043c\u043e\u0435\u0433\u043e \u043d\u0435\u0444\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043d\u0430 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u043e\u043c\" width=\"1669\" height=\"351\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ba2\/bfd\/e04\/ba2bfde0445ccb90336bc835c011bc45.png\"\/><\/p>\n<div><figcaption>\u0423\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u0435 \u043c\u043e\u0435\u0433\u043e \u043d\u0435\u0444\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043d\u0430 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u043e\u043c<\/figcaption><\/div>\n<\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/3a1\/592\/80b\/3a159280b55006399b52ad8df0e5323f.png\" alt=\"\u041c\u0435\u0433\u0430\u0445\u0430\u0440\u0434\u043a\u043e\u0440 - \u0441\u043e\u0447\u0438\u043d\u0435\u043d\u0438\u0435 \u041b\u0438 \u0412\u043e\u043d\u0433 \u042f\u043d\u0430\" title=\"\u041c\u0435\u0433\u0430\u0445\u0430\u0440\u0434\u043a\u043e\u0440 - \u0441\u043e\u0447\u0438\u043d\u0435\u043d\u0438\u0435 \u041b\u0438 \u0412\u043e\u043d\u0433 \u042f\u043d\u0430\" width=\"1839\" height=\"453\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/3a1\/592\/80b\/3a159280b55006399b52ad8df0e5323f.png\"\/><\/p>\n<div><figcaption>\u041c\u0435\u0433\u0430\u0445\u0430\u0440\u0434\u043a\u043e\u0440 &#8212; \u0441\u043e\u0447\u0438\u043d\u0435\u043d\u0438\u0435 <a href=\"https:\/\/neolurk.org\/wiki\/%D0%9B%D0%B8_%D0%92%D0%BE%D0%BD%D0%B3_%D0%AF%D0%BD\" rel=\"noopener noreferrer nofollow\">\u041b\u0438 \u0412\u043e\u043d\u0433 \u042f\u043d\u0430<\/a><\/figcaption><\/div>\n<\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/c22\/233\/f5f\/c22233f5fc9265d2ce8c0358e16e168e.png\" alt=\"\u0415\u0449\u0435 \u043e\u0434\u043d\u043e\" title=\"\u0415\u0449\u0435 \u043e\u0434\u043d\u043e\" width=\"1845\" height=\"783\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c22\/233\/f5f\/c22233f5fc9265d2ce8c0358e16e168e.png\"\/><\/p>\n<div><figcaption>\u0415\u0449\u0435 \u043e\u0434\u043d\u043e<\/figcaption><\/div>\n<\/figure>\n<p>\u041d\u0430 GPT-3.5 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043f\u043e\u0445\u0443\u0436\u0435, \u043d\u043e \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u043e\u0447\u0435\u043d\u044c \u0434\u0430\u0436\u0435 \u043d\u0435\u043f\u043b\u043e\u0445\u0438\u0435<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/13a\/d9d\/41e\/13ad9d41e0cf0d06d300f5eea03dfac8.png\" alt=\"\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043d\u0430 GPT-3.5 \u0441\u043b\u0430\u0431\u043e \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f \u043e\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u043d\u0430 GPT-4\" title=\"\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043d\u0430 GPT-3.5 \u0441\u043b\u0430\u0431\u043e \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f \u043e\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u043d\u0430 GPT-4\" width=\"1817\" height=\"428\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/13a\/d9d\/41e\/13ad9d41e0cf0d06d300f5eea03dfac8.png\"\/><\/p>\n<div><figcaption>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043d\u0430 GPT-3.5 \u0441\u043b\u0430\u0431\u043e \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f \u043e\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u043d\u0430 GPT-4<\/figcaption><\/div>\n<\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/de0\/1ff\/8a0\/de01ff8a064015feb80c31350502410b.png\" alt=\"\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043d\u0430 GPT-3.5 \u0441\u043b\u0430\u0431\u043e \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f \u043e\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u043d\u0430 GPT-4 \u041e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0439 \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 GPT-4\" title=\"\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043d\u0430 GPT-3.5 \u0441\u043b\u0430\u0431\u043e \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f \u043e\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u043d\u0430 GPT-4 \u041e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0439 \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 GPT-4\" width=\"1827\" height=\"409\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/de0\/1ff\/8a0\/de01ff8a064015feb80c31350502410b.png\"\/><\/p>\n<div><figcaption>\u041e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0439 \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 GPT-4<\/figcaption><\/div>\n<\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/1a4\/26f\/bea\/1a426fbeacff43e428a791808176cdfc.png\" alt=\"\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043d\u0430 GPT-3.5 \u0441\u043b\u0430\u0431\u043e \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f \u043e\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u043d\u0430 GPT-4\" title=\"\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043d\u0430 GPT-3.5 \u0441\u043b\u0430\u0431\u043e \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f \u043e\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u043d\u0430 GPT-4\" width=\"1843\" height=\"343\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/1a4\/26f\/bea\/1a426fbeacff43e428a791808176cdfc.png\"\/><\/p>\n<div><figcaption>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043d\u0430 GPT-3.5 \u0441\u043b\u0430\u0431\u043e \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f \u043e\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u043d\u0430 GPT-4<\/figcaption><\/div>\n<\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/3fd\/e99\/d2a\/3fde99d2a4a724383d9b403e27fcee1e.png\" alt=\"GPT-3.5 \u043d\u0435 \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u043b\u0430 &quot;\u0438\u0445&quot; \u2192 &quot;\u0435\u0451&quot;\" title=\"GPT-3.5 \u043d\u0435 \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u043b\u0430 &quot;\u0438\u0445&quot; \u2192 &quot;\u0435\u0451&quot;\" width=\"1821\" height=\"259\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/3fd\/e99\/d2a\/3fde99d2a4a724383d9b403e27fcee1e.png\"\/><\/p>\n<div><figcaption>GPT-3.5 \u043d\u0435 \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u043b\u0430 &#171;\u0438\u0445&#187; \u2192 &#171;\u0435\u0451&#187;<\/figcaption><\/div>\n<\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/415\/ead\/dc9\/415eaddc9fbdcfca9cd28a551d6a878d.png\" alt=\"\u041b\u0438 \u0412\u043e\u043d\u0433 \u042f\u043d. \u041d\u0430 \u044d\u0442\u043e\u043c \u0442\u0435\u0441\u0442\u0435 \u044f\u0432\u043d\u043e \u0432\u0438\u0434\u043d\u043e \u043f\u0440\u0435\u0432\u043e\u0441\u0445\u043e\u0434\u0441\u0442\u0432\u043e GPT-4\" title=\"\u041b\u0438 \u0412\u043e\u043d\u0433 \u042f\u043d. \u041d\u0430 \u044d\u0442\u043e\u043c \u0442\u0435\u0441\u0442\u0435 \u044f\u0432\u043d\u043e \u0432\u0438\u0434\u043d\u043e \u043f\u0440\u0435\u0432\u043e\u0441\u0445\u043e\u0434\u0441\u0442\u0432\u043e GPT-4\" width=\"1843\" height=\"459\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/415\/ead\/dc9\/415eaddc9fbdcfca9cd28a551d6a878d.png\"\/><\/p>\n<div><figcaption>\u041b\u0438 \u0412\u043e\u043d\u0433 \u042f\u043d. \u041d\u0430 \u044d\u0442\u043e\u043c \u0442\u0435\u0441\u0442\u0435 \u044f\u0432\u043d\u043e \u0432\u0438\u0434\u043d\u043e \u043f\u0440\u0435\u0432\u043e\u0441\u0445\u043e\u0434\u0441\u0442\u0432\u043e GPT-4<\/figcaption><\/div>\n<\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/8a8\/704\/340\/8a87043407963e3393b9a8f0f74a494a.png\" alt=\"\u0422\u0443\u0442 \u0442\u043e\u0436\u0435 GPT-3.5 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0442\u0435\u043a\u0441\u0442 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0445\u0443\u0436\u0435, \u0447\u0435\u043c GPT-4\" title=\"\u0422\u0443\u0442 \u0442\u043e\u0436\u0435 GPT-3.5 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0442\u0435\u043a\u0441\u0442 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0445\u0443\u0436\u0435, \u0447\u0435\u043c GPT-4\" width=\"1837\" height=\"751\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/8a8\/704\/340\/8a87043407963e3393b9a8f0f74a494a.png\"\/><\/p>\n<div><figcaption>\u0422\u0443\u0442 \u0442\u043e\u0436\u0435 GPT-3.5 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0442\u0435\u043a\u0441\u0442 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0445\u0443\u0436\u0435, \u0447\u0435\u043c GPT-4<\/figcaption><\/div>\n<\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/88d\/9b3\/39f\/88d9b339fe87b35c835645aec0cd6fce.png\" alt=\"\u041f\u0440\u0438\u043a\u043e\u043b\u044c\u043d\u0430\u044f \u0444\u0438\u0447\u0430: \u043c\u043e\u0436\u043d\u043e \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0441\u043b\u043e\u0432\u0430 \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u043c \u044f\u0437\u044b\u043a\u0435, \u0438 GPT \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0438\u0442\u044c \u0438\u0445 \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435\" title=\"\u041f\u0440\u0438\u043a\u043e\u043b\u044c\u043d\u0430\u044f \u0444\u0438\u0447\u0430: \u043c\u043e\u0436\u043d\u043e \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0441\u043b\u043e\u0432\u0430 \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u043c \u044f\u0437\u044b\u043a\u0435, \u0438 GPT \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0438\u0442\u044c \u0438\u0445 \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435\" width=\"1703\" height=\"189\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/88d\/9b3\/39f\/88d9b339fe87b35c835645aec0cd6fce.png\"\/><\/p>\n<div><figcaption>\u041f\u0440\u0438\u043a\u043e\u043b\u044c\u043d\u0430\u044f \u0444\u0438\u0447\u0430: \u043c\u043e\u0436\u043d\u043e \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0441\u043b\u043e\u0432\u0430 \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u043c \u044f\u0437\u044b\u043a\u0435, \u0438 GPT \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0438\u0442\u044c \u0438\u0445 \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435<\/figcaption><\/div>\n<\/figure>\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\/732394\/\"> https:\/\/habr.com\/ru\/articles\/732394\/<\/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>\u0421 \u0441\u0430\u043c\u043e\u0433\u043e \u0432\u044b\u0445\u043e\u0434\u0430 ChatGPT \u044f \u043d\u0430\u0447\u0430\u043b \u0435\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u0443\u0440\u044b \u0442\u0435\u043a\u0441\u0442\u0430: \u0443\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043e\u043f\u0435\u0447\u0430\u0442\u043e\u043a, \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043e\u0448\u0438\u0431\u043e\u043a \u0438 \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f \u0441\u0442\u0438\u043b\u0438\u0441\u0442\u0438\u043a\u0438.<\/p>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e, \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0432\u0435\u0431-\u0432\u0435\u0440\u0441\u0438\u0438 ChatGPT \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u044e\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b:<\/p>\n<ol>\n<li>\n<p>\u041f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u0442\u0435\u043a\u0441\u0442, \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0439\u0442\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f<\/p>\n<\/li>\n<li>\n<p>\u041d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432\u0441\u044f \u043c\u043e\u0449\u044c API, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0435\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u0431\u043e\u043b\u0435\u0435 \u0442\u043e\u043d\u043a\u043e\u0439 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0431\u043e\u0442\u0430<\/p>\n<ol>\n<li>\n<p>\u041c\u043e\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043e\u0431\u044a\u044f\u0441\u043d\u0438\u0442\u044c \u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043d\u0442\u0443 \u0441\u043c\u044b\u0441\u043b \u0435\u0433\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u044f<\/p>\n<\/li>\n<li>\n<p>Few-shot learning: \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043d\u0430\u0431\u043e\u0440 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u043a\u043e\u0440\u0440\u0435\u043a\u0446\u0438\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439<\/p>\n<\/li>\n<\/ol>\n<\/li>\n<li>\n<p>\u041d\u0435\u0443\u0434\u043e\u0431\u0441\u0442\u0432\u043e: \u043d\u0443\u0436\u043d\u043e \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0441\u0432\u043e\u0439 \u0442\u0435\u043a\u0441\u0442 \u0432 \u0432\u0435\u0431-\u0432\u0435\u0440\u0441\u0438\u044e, \u0437\u0430\u0442\u0435\u043c \u043d\u0430\u0431\u0438\u0440\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u043f\u0440\u043e\u043c\u0442 \u0434\u043b\u044f \u0435\u0433\u043e \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f (\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u043c \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u0438\u043f\u0430 \u043a\u043e\u0440\u0440\u0435\u043a\u0446\u0438\u0438). \u0425\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u0438\u043c\u0435\u0442\u044c Web UI, \u0433\u0434\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0442\u0435\u043a\u0441\u0442 \u0438 \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0442\u0438\u043f \u043a\u043e\u0440\u0440\u0435\u043a\u0446\u0438\u0438 &#8212; \u0430 \u0434\u0430\u043b\u0435\u0435 \u0442\u0435\u043a\u0441\u0442 \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c \u043f\u0440\u043e\u043c\u0442\u043e\u043c<\/p>\n<\/li>\n<\/ol>\n<p>\u0414\u0430\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u043f\u0440\u0438\u0437\u0432\u0430\u043d \u0443\u0441\u0442\u0440\u0430\u043d\u0438\u0442\u044c \u044d\u0442\u0438 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0438. \u041f\u043e\u0442\u044b\u043a\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u043d\u043e <a href=\"https:\/\/language-challenge-react.herokuapp.com\/correct\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a> (\u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0443\u0436\u0435\u043d OpenAI API-\u043a\u043b\u044e\u0447).<\/p>\n<h2>\u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435<\/h2>\n<figure class=\"full-width\"><\/figure>\n<p>\u0412 \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0435\u0441\u0442\u044c \u043f\u043e\u043b\u0435 \u0441 \u0442\u0435\u043a\u0441\u0442\u043e\u043c, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0432\u0432\u043e\u0434\u0438\u0442 \u0441\u0432\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c. \u041f\u043e\u0441\u043b\u0435 \u043d\u0430\u0436\u0430\u0442\u0438\u044f \u043d\u0430 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435-\u043a\u043d\u043e\u043f\u043a\u0443 \u0432 \u043f\u043e\u043b\u0435 \u0441\u043f\u0440\u0430\u0432\u0430 \u043f\u043e\u0441\u0442\u0435\u043f\u0435\u043d\u043d\u043e \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f, \u0430 \u043f\u043e \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u0438 \u0432\u044b\u0432\u043e\u0434\u0430 \u0432\u044b\u0434\u0435\u043b\u044f\u044e\u0442\u0441\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f. \u041f\u0440\u0438 \u043d\u0430\u0432\u0435\u0434\u0435\u043d\u0438\u0438 \u043d\u0430 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435, tooltip \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u0447\u0442\u043e \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e \u0431\u044b\u043b\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043e.<\/p>\n<p>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u044f\u0437\u044b\u043a\u043e\u0432. \u041c\u043e\u0436\u043d\u043e \u043b\u0438\u0431\u043e \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u044f\u0437\u044b\u043a \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0432\u0440\u0443\u0447\u043d\u0443\u044e, \u043b\u0438\u0431\u043e \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c\u0441\u044f \u043d\u0430 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u0434\u0435\u0442\u0435\u043a\u0442\u043e\u0440 \u044f\u0437\u044b\u043a\u0430.<\/p>\n<p>\u041c\u043e\u0436\u043d\u043e \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c: \u043e\u0431\u0449\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0443\u044e GPT 3.5 Turbo, \u043b\u0438\u0431\u043e GPT-4. \u0414\u043e\u0441\u0442\u0443\u043f \u043a GPT-4 API \u0441\u0435\u0439\u0447\u0430\u0441 \u043f\u043e <a href=\"https:\/\/openai.com\/waitlist\/gpt-4-api\" rel=\"noopener noreferrer nofollow\">\u0432\u0435\u0439\u0442\u043b\u0438\u0441\u0442\u0443<\/a>, \u0441\u0430\u043c\u0430 \u043c\u043e\u0434\u0435\u043b\u044c \u0431\u043e\u043b\u0435\u0435 \u0447\u0435\u043c \u043d\u0430 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0434\u043e\u0440\u043e\u0436\u0435, \u043d\u043e \u0437\u0430\u0442\u043e \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0443\u043c\u043d\u0435\u0435.<\/p>\n<p>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0434\u0432\u0430 \u0442\u0438\u043f\u0430 \u043a\u043e\u0440\u0440\u0435\u043a\u0446\u0438\u0438 \u0442\u0435\u043a\u0441\u0442\u0430: <\/p>\n<ol>\n<li>\n<p>just correct grammar \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0433\u0440\u0430\u043c\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435, \u043e\u0440\u0444\u043e\u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0438 \u043f\u0443\u043d\u043a\u0442\u0443\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438<\/p>\n<\/li>\n<li>\n<p>make more natural \u0432\u0434\u043e\u0431\u0430\u0432\u043e\u043a \u0443\u043b\u0443\u0447\u0448\u0430\u0435\u0442 \u0441\u0442\u0438\u043b\u0438\u0441\u0442\u0438\u043a\u0443 \u0442\u0435\u043a\u0441\u0442\u0430. \u041e\u0434\u043d\u0430\u043a\u043e, \u0442\u0443\u0442 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0431\u043e\u043b\u0435\u0435 \u043a\u0430\u0440\u0434\u0438\u043d\u0430\u043b\u044c\u043d\u044b, \u0438 \u0438\u043d\u043e\u0433\u0434\u0430 \u043e\u043d\u0438 \u043c\u043e\u0433\u0443\u0442 \u043c\u0435\u043d\u044f\u0442\u044c \u0441\u043c\u044b\u0441\u043b \u0442\u0435\u043a\u0441\u0442\u0430<\/p>\n<\/li>\n<\/ol>\n<p>OpenAI API \u0441\u0442\u043e\u0438\u0442 \u0434\u0435\u043d\u0435\u0433. \u041f\u0435\u0440\u0435\u0434\u043e \u043c\u043d\u043e\u0439 \u0432\u0441\u0442\u0430\u043b\u0430 \u0437\u0430\u0434\u0430\u0447\u0430: \u043a\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442 \u044e\u0437\u0430\u0431\u0435\u043b\u044c\u043d\u044b\u043c \u0434\u043b\u044f \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430 \u043b\u044e\u0434\u0435\u0439, \u0435\u0441\u043b\u0438 \u043e\u043d \u0431\u0430\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043d\u0430 \u043f\u043b\u0430\u0442\u043d\u043e\u043c API? \u0411\u0440\u0430\u0442\u044c \u0441 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0434\u0435\u043d\u044c\u0433\u0438 \u0438 \u043e\u043f\u043b\u0430\u0447\u0438\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0438\u043c \u043a\u043b\u044e\u0447\u043e\u043c &#8212; \u0442\u0430\u043a\u0430\u044f \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044f \u043d\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043f\u0435\u0442-\u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u0438\u043b\u043b\u0438\u043d\u0433 &#8212; \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0430\u044f \u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0443\u0441\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0441\u0430\u043c \u0432\u0432\u043e\u0434\u0438\u0442 \u0441\u0432\u043e\u0439 \u043a\u043b\u044e\u0447 \u0438 \u043f\u043b\u0430\u0442\u0438\u0442 \u0441 \u043d\u0435\u0433\u043e. \u041f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043d\u0430 \u0448\u0435\u0441\u0442\u0435\u0440\u0435\u043d\u043a\u0443 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438, \u0433\u0434\u0435 \u043c\u043e\u0436\u043d\u043e \u0432\u0432\u0435\u0441\u0442\u0438\/\u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0441\u0432\u043e\u0439 API-\u043a\u043b\u044e\u0447.<\/p>\n<p>\u0412 \u0442\u0430\u043a\u043e\u0439 \u043f\u0430\u0440\u0430\u0434\u0438\u0433\u043c\u0435 \u043f\u0440\u043e\u0435\u043a\u0442 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0434\u0435\u043b\u0430\u0442\u044c \u0432\u043e\u043e\u0431\u0449\u0435 \u0431\u0435\u0437 \u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u0447\u0438\u0441\u0442\u043e \u043d\u0430 React (\u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043a\u043b\u044e\u0447\u0438 \u043d\u0435\u043b\u044c\u0437\u044f \u043d\u0438\u043a\u0443\u0434\u0430 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c). \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0434\u043b\u044f \u0435\u0449\u0435 \u0431\u043e\u043b\u044c\u0448\u0435\u0439 \u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u043e\u0441\u0442\u0438 \u043a\u043e\u0434 \u044f \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u044e:  <a href=\"https:\/\/github.com\/einhornus\/language-challenge-react\" rel=\"noopener noreferrer nofollow\"><u>https:\/\/github.com\/einhornus\/language-challenge-react<\/u><\/a> (\u0434\u0430\u043d\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 &#8212; \u044d\u0442\u043e \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0430\u0441\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438).<\/p>\n<p>\u042f \u043f\u0438\u0442\u043e\u043d\u0438\u0441\u0442-ML\u0449\u0438\u043a \u0441\u043e \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u0432 NLP, \u043a\u043e\u0434\u0438\u043d\u0433 \u043d\u0430 React \u0434\u043b\u044f \u043c\u0435\u043d\u044f &#8212; \u0432\u044b\u0445\u043e\u0434 \u0438\u0437 \u0437\u043e\u043d\u044b \u043a\u043e\u043c\u0444\u043e\u0440\u0442\u0430. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u043e\u0448\u0443 \u0441\u0438\u043b\u044c\u043d\u043e \u043d\u0435 \u043f\u0438\u043d\u0430\u0442\u044c \u0438\u0437-\u0437\u0430 \u043a\u0440\u0438\u0432\u0438\u0437\u043d\u044b UI \u0438 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 JS-\u043a\u043e\u0434\u0430 \u0432 \u0440\u0435\u043f\u0435. <\/p>\n<p>\u0424\u043e\u043a\u0443\u0441 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 &#8212; \u043d\u0430 \u043c\u0430\u043a\u0441\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u043a\u043e\u0440\u0440\u0435\u043a\u0446\u0438\u0438 \u0442\u0435\u043a\u0441\u0442\u0430 \u0438 \u043d\u0430 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0440\u0435\u043b\u0438\u0437\u0430 \u044e\u0437\u0430\u0431\u0435\u043b\u044c\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438.<\/p>\n<h2>GPT-4 API<\/h2>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0435\u043a\u0446\u0438\u0438 \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043f\u0440\u043e GPT-4 API \u0438 \u043f\u043e\u043a\u0430\u0436\u0443, \u043a\u0430\u043a \u0441 \u0435\u0433\u043e \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0448\u0430\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0438 NLP.<\/p>\n<p>\u0412 API \u0435\u0441\u0442\u044c \u043c\u0435\u0442\u043e\u0434 ChatCompletion, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0441\u043f\u0438\u0441\u043e\u043a \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043d\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u043c\u0442\u043e\u043c, \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435.<\/p>\n<p>\u041a\u0430\u0436\u0434\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u044d\u0442\u043e\u0433\u043e \u0441\u043f\u0438\u0441\u043a\u0430 &#8212; \u044d\u0442\u043e \u0441\u043b\u043e\u0432\u0430\u0440\u044c \u0441 \u0434\u0432\u0443\u043c\u044f \u043f\u043e\u043b\u044f\u043c\u0438: role \u0438 content.<\/p>\n<p>\u041f\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e role \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u0446\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u043d\u0430 3 \u0442\u0438\u043f\u0430: \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f (role=&#187;system&#187;), \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f (role=&#187;user&#187;) \u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043d\u0442\u0430 (role=&#187;assistant&#187;).<\/p>\n<p>\u0421\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0432 \u0441\u0432\u043e\u0435\u043c \u043f\u043e\u043b\u0435 content \u0432\u044b\u0441\u043e\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043d\u0442\u0430 &#8212; \u0442\u043e, \u043a\u0430\u043a \u043e\u043d \u0434\u043e\u043b\u0436\u0435\u043d \u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c. \u0415\u0441\u043b\u0438 \u0432 \u043f\u0440\u043e\u043c\u0442\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0445 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439, \u0438\u043c\u0435\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u0438\u0437 \u043d\u0438\u0445 (\u043d\u043e\u0432\u044b\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442 \u0441\u0442\u0430\u0440\u044b\u0435). \u041a\u0430\u043a \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u043c\u0442\u0430 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0432\u043b\u0438\u044f\u0435\u0442 \u043d\u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 &#8212; \u044f \u043f\u043e\u043a\u0430 \u043d\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u044e, \u044d\u0442\u043e \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u0432\u043e\u043f\u0440\u043e\u0441.<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043d\u0442\u0430 \u0437\u0430\u0434\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0430\u044f \u0431\u0435\u0441\u0435\u0434\u0430 \u043c\u0435\u0436\u0434\u0443 \u043d\u0438\u043c\u0438. \u041e\u0434\u043d\u0430\u043a\u043e, \u044d\u0442\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447\u0438 (few shot learning). \u0412 \u043a\u0430\u0436\u0434\u043e\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u0440 \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u0430 \u0432 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0438 \u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043d\u0442\u0430 \u043f\u043e\u0441\u043b\u0435 \u043d\u0435\u0433\u043e &#8212; \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435. \u041f\u043e\u0441\u043b\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0438\u0434\u0435\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0432\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0440\u0435\u0448\u0435\u043d\u0438\u0435.<\/p>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0437\u0430\u0434\u0430\u0447\u0443 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0430 \u0441 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u043e\u0433\u043e \u043d\u0430 \u0440\u0443\u0441\u0441\u043a\u0438\u0439. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0440\u043e\u043c\u0442 \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"json\">[     {         \"role\": \"user\",         \"content\": \"Hello how are you?\"     },     {         \"role\": \"assistant\",         \"content\": \"\u041f\u0440\u0438\u0432\u0435\u0442, \u043a\u0430\u043a \u0434\u0435\u043b\u0430?\"     },     {         \"role\": \"user\",         \"content\": \"Despite the heavy rain, they decided to continue their hike through the dense forest\"     },     {         \"role\": \"assistant\",         \"content\": \"\u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0441\u0438\u043b\u044c\u043d\u044b\u0439 \u0434\u043e\u0436\u0434\u044c, \u043e\u043d\u0438 \u0440\u0435\u0448\u0438\u043b\u0438 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c \u0441\u0432\u043e\u0439 \u043f\u043e\u0445\u043e\u0434 \u0447\u0435\u0440\u0435\u0437 \u0433\u0443\u0441\u0442\u043e\u0439 \u043b\u0435\u0441\"     },     {         \"role\": \"user\",         \"content\": \"The chef, inspired by flavors from around the world, has created a unique fusion cuisine that attracts food enthusiasts and critics alike\"     },     {         \"role\": \"assistant\",         \"content\": \"\u041f\u043e\u0432\u0430\u0440, \u0432\u0434\u043e\u0445\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u0432\u043a\u0443\u0441\u0430\u043c\u0438 \u0441\u043e \u0432\u0441\u0435\u0433\u043e \u043c\u0438\u0440\u0430, \u0441\u043e\u0437\u0434\u0430\u043b \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u0443\u044e \u0444\u044c\u044e\u0436\u043d-\u043a\u0443\u0445\u043d\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u0438\u0432\u043b\u0435\u043a\u0430\u0435\u0442 \u043a\u0430\u043a \u0433\u0443\u0440\u043c\u0430\u043d\u043e\u0432, \u0442\u0430\u043a \u0438 \u043a\u0440\u0438\u0442\u0438\u043a\u043e\u0432\"     },     {         \"role\": \"system\",         \"content\": \"You are TranslateGPT. You translate user messages from English to Russian. You are the most accurate English to Russian translator in the world.\"     },     {         \"role\": \"user\",         \"content\": \"{\u0442\u0435\u043a\u0441\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0434\u043e \u043f\u0435\u0440\u0435\u0432\u0435\u0441\u0442\u0438}\"     } ] <\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u043f\u043e\u0441\u043b\u0430\u0442\u044c API-\u0437\u0430\u043f\u0440\u043e\u0441 \u0441 \u0442\u0430\u043a\u0438\u043c \u043f\u0440\u043e\u043c\u0442\u043e\u043c, \u0432 \u043e\u0442\u0432\u0435\u0442 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043d\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u043d\u0430\u0448\u0435\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u0430.<\/p>\n<p>\u041a\u0440\u043e\u043c\u0435 \u043f\u0440\u043e\u043c\u0442\u0430, \u0432 \u0437\u0430\u043f\u0440\u043e\u0441\u0435 \u043a API \u0435\u0441\u0442\u044c \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b:<\/p>\n<ol>\n<li>\n<p>model &#8212; \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c. \u041d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f gpt-3.5-turbo (\u043e\u0431\u0449\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430) \u0438 gpt-4 (\u043f\u043e\u043a\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0442\u0435\u0445, \u043a\u043e\u043c\u0443 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u043b\u0438 \u0434\u043e\u0441\u0442\u0443\u043f). gpt-4 \u0441\u0442\u043e\u0438\u0442 \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043e\u0440\u043e\u0436\u0435: 3 \u0446\u0435\u043d\u0442\u0430 \u0437\u0430 1000 \u0442\u043e\u043a\u0435\u043d\u043e\u0432 \u043f\u0440\u043e\u043c\u0442\u0430 + 6 \u0446\u0435\u043d\u0442\u043e\u0432 \u0437\u0430 1000 \u0442\u043e\u043a\u0435\u043d\u043e\u0432 \u043e\u0442\u0432\u0435\u0442\u0430 \u043f\u0440\u043e\u0442\u0438\u0432 0.2 \u0446\u0435\u043d\u0442\u043e\u0432 \u0437\u0430 1000 \u043b\u044e\u0431\u044b\u0445 \u0442\u043e\u043a\u0435\u043d\u043e\u0432 \u0443 gpt-3.5-turbo. \u041e\u0434\u043d\u0430\u043a\u043e, \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043f\u0440\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u0438 NLP-\u0437\u0430\u0434\u0430\u0447 \u0443 gpt-4 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043b\u0443\u0447\u0448\u0435.<\/p>\n<\/li>\n<li>\n<p>temperature &#8212; \u0447\u0438\u0441\u043b\u043e \u043e\u0442 0 \u0434\u043e 2, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0437\u0430\u0434\u0430\u0435\u0442, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0447\u0430\u0441\u0442\u043e \u043f\u0440\u0438 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0442\u043e\u043a\u0435\u043d\u0430 \u043c\u043e\u0434\u0435\u043b\u044c \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u043d\u0435 \u0441\u0430\u043c\u044b\u0439 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442. \u0423\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u0435 \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u044b \u043f\u043e\u0432\u044b\u0448\u0430\u0435\u0442 \u043a\u0440\u0435\u0430\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c \u043e\u0442\u0432\u0435\u0442\u043e\u0432, \u043d\u043e \u0441\u043d\u0438\u0436\u0430\u0435\u0442 \u0438\u0445 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e. \u041f\u0440\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u0438 \u0437\u0430\u0434\u0430\u0447 NLP \u043b\u0443\u0447\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0443 \u0440\u0430\u0432\u043d\u043e\u0439 \u043d\u0443\u043b\u044e. <\/p>\n<\/li>\n<li>\n<p>max_tokens &#8212; \u043c\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 \u0432 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c\u043e\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0438. \u041f\u0440\u0438 \u043f\u0440\u0435\u0432\u044b\u0448\u0435\u043d\u0438\u0438 \u043b\u0438\u043c\u0438\u0442\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e\u0431\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f.<\/p>\n<\/li>\n<\/ol>\n<p>\u041f\u043e\u043b\u043d\u0443\u044e \u0441\u043f\u0440\u0430\u0432\u043a\u0443 \u043f\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c \u0432 API \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c <a href=\"https:\/\/platform.openai.com\/docs\/api-reference\/chat\/create\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a>. \u041f\u043e\u0438\u0433\u0440\u0430\u0442\u044c\u0441\u044f \u0441 API \u043c\u043e\u0436\u043d\u043e \u0432 <a href=\"https:\/\/platform.openai.com\/playground?mode=chat\" rel=\"noopener noreferrer nofollow\">\u043f\u043b\u0435\u0439\u0433\u0440\u0430\u0443\u043d\u0434\u0435<\/a>.<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u041f\u0435\u0440\u0435\u0432\u043e\u0434\u0447\u0438\u043a \u0432 \u043f\u043b\u0435\u0439\u0433\u0440\u0430\u0443\u043d\u0434\u0435<\/figcaption><\/div>\n<\/figure>\n<h2>GPT-4 API \u0432 JS<\/h2>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043c\u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c GPT-4 API \u0438\u0437 \u0440\u0435\u0430\u043a\u0442\u0430. \u0414\u0430, \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u043b\u0438\u0431\u0430 OpenAIApi, \u043d\u043e \u043e\u043d\u0430 \u043f\u043e\u043a\u0430 \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0441\u0442\u0440\u0438\u043c\u0438\u043d\u0433 \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u043e\u0433\u043e \u043e\u0442\u0432\u0435\u0442\u0430 &#8212; \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043c\u043e\u0433 \u0432\u0438\u0434\u0435\u0442\u044c \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u043e \u043c\u0435\u0440\u0435 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f.<\/p>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435 \u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043a API endpoint \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e:<\/p>\n<pre><code class=\"javascript\">\/** Calls the GPT-4 API with streaming support, providing real-time partial results. @async @function callGPT4APIJSStreaming @param {string} model - The model to use for the API call. @param {string} key - The API key for authentication with the GPT-4 API. @param {Array} prompt - The prompt to be sent to the GPT-4 API (a list of messages). @param {number} temperature - The sampling temperature for the GPT-4 API (0 for deterministic responses). @param {number} maxTokens - The maximum number of tokens in the generated response. @param {Function} onFullResult - Callback function to handle the complete generated response. @param {Function} onPartialResult - Callback function to handle partial results while streaming. @param {Function} onError - Callback function to handle errors during the API call. @returns {Promise&lt;void>} - A promise that resolves when the API call and streaming are complete. *\/ async function callGPT4APIJSStreaming(model, key, prompt, temperature, maxTokens, onFullResult, onPartialResult, onError) {     \/\/ Send the request to the API     try {         const response = await fetch('https:\/\/api.openai.com\/v1\/chat\/completions', {             method: 'POST',             headers: {                 'Content-Type': 'application\/json',                 'Authorization': `Bearer ${key}`,             },             body: JSON.stringify({                 model: model,                 messages: prompt,                 max_tokens: maxTokens,                 n: 1,                 temperature: temperature,                 stream: true,             }),         });          \/\/ If the response is not ok, call the onError callback with the status code and return         if (!response.ok) {             onError(response.status);             return;         }          \/\/ Initialize an empty string to accumulate content         let content = '';          \/\/ Get a reader for the response body stream         const reader = response.body.getReader();         \/\/ Initialize a TextDecoder to decode the response stream         const decoder = new TextDecoder();          \/\/ Continuously read the response stream until done         while (true) {             const {done, value} = await reader.read();              if (done) {                 break;             }              \/\/ Decode the current chunk of the response and split it into lines             const chunk = decoder.decode(value);             const lines = chunk.split('\\n');              \/\/ Process each line of the response             for (const line of lines) {                 if (line.startsWith('data: ')) {                     \/\/ If the line contains the '[DONE]' marker, stop processing                     if (line.includes('[DONE]')) {                         break;                     }                      \/\/ Extract the data object from the line and append the content to the accumulated content                     const data = JSON.parse(line.slice(6));                      if (data.choices &amp;&amp; data.choices[0].delta &amp;&amp; data.choices[0].delta.content) {                <\/code><\/pre>\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-409802","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/409802","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=409802"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/409802\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=409802"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=409802"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=409802"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}