{"id":369475,"date":"2024-05-21T04:04:18","date_gmt":"2024-05-21T04:04:18","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=369475"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=369475","title":{"rendered":"<span>\u0418\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u0443\u0435\u043c Kotlin \u0441\u0435\u0440\u0432\u0438\u0441 \u0441 AI \u0447\u0430\u0442-\u0431\u043e\u0442\u043e\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Spring AI \u0437\u0430 5 \u043c\u0438\u043d\u0443\u0442<\/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<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/86f\/741\/dc3\/86f741dc32c77aa8126b71b627be9360.png\" width=\"761\" height=\"614\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/86f\/741\/dc3\/86f741dc32c77aa8126b71b627be9360.png\"\/><\/figure>\n<p>\u0427\u0430\u0442-\u0431\u043e\u0442\u044b \u0441 \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u044b\u043c \u0438\u0441\u043a\u0443\u0441\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u0438\u043d\u0442\u0435\u043b\u043b\u0435\u043a\u0442\u043e\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0448\u0438\u0440\u043e\u043a\u0443\u044e \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u0441\u043b\u0435 \u0440\u0435\u043b\u0438\u0437\u0430 ChatGPT \u0432 \u043d\u043e\u044f\u0431\u0440\u0435 2022 \u0433\u043e\u0434\u0430. \u0421\u0435\u0439\u0447\u0430\u0441 \u0432\u0440\u044f\u0434 \u043b\u0438 \u043d\u0430\u0439\u0434\u0451\u0442\u0441\u044f \u0447\u0435\u043b\u043e\u0432\u0435\u043a \u0438\u0437 IT, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435 \u0441\u043b\u044b\u0448\u0430\u043b \u043f\u0440\u043e \u0434\u0430\u043d\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u043e\u0442 OpenAI. \u0418\u043c\u0435\u043d\u043d\u043e \u043e\u043d \u0432\u044b\u0437\u0432\u0430\u043b \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0439 \u0431\u0443\u043c \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0444\u0435\u0440\u0435, \u0432\u044b\u043d\u0443\u0434\u0438\u0432 \u043a\u043e\u043d\u043a\u0443\u0440\u0435\u043d\u0442\u043e\u0432 \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0438 \u0430\u043d\u0430\u043b\u043e\u0433\u0438, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0431\u043e\u0440\u043e\u0442\u044c\u0441\u044f \u0437\u0430 \u043c\u0435\u0441\u0442\u043e \u043d\u0430 \u0440\u044b\u043d\u043a\u0435. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u0430\u044f \u043b\u0430\u0432\u0438\u043d\u0430 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0437\u0430\u0442\u0440\u043e\u043d\u0443\u043b\u0430 \u043c\u043d\u043e\u0433\u0438\u0435 \u044f\u0437\u044b\u043a\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u041d\u0435 \u043e\u0431\u043e\u0448\u043b\u0438 \u043e\u043d\u0438 \u0438 Java-\u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u043e. Spring Framework, \u043e\u0434\u0438\u043d \u0438\u0437 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 Java \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u0432 \u043e\u0431\u0437\u0430\u0432\u0451\u043b\u0441\u044f \u043c\u043e\u0434\u0443\u043b\u0435\u043c Spring AI, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0431\u0435\u0449\u0430\u0435\u0442 \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438 \u0418\u0418. <\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0432\u043c\u0435\u0441\u0442\u0435 \u0432\u0437\u0433\u043b\u044f\u043d\u0435\u043c \u043d\u0430 \u043d\u0435\u0433\u043e \u0432 \u0434\u0435\u043b\u0435 \u0438 \u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043d\u0430 \u0434\u0435\u043c\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0435. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0433\u0430\u0439\u0434\u0435 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043c Kotlin \u0441\u0435\u0440\u0432\u0438\u0441 \u043a \u0447\u0430\u0442-\u0431\u043e\u0442\u0443 \u0432\u0441\u0435\u0433\u043e \u0437\u0430 \u043f\u044f\u0442\u044c \u043c\u0438\u043d\u0443\u0442, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f Spring AI!<\/p>\n<p>Spring AI \u2014 \u044d\u0442\u043e \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442, \u0446\u0435\u043b\u044c \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u2014 \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0441 \u0438\u0441\u043a\u0443\u0441\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u0438\u043d\u0442\u0435\u043b\u043b\u0435\u043a\u0442\u043e\u043c (\u043b\u0438\u0431\u043e \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044e \u0441 \u0442\u0430\u043a\u0438\u043c\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c\u0438). \u041d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u0435\u0440\u0441\u0438\u044f 0.8.1-SNAPSHOT. \u0412 \u043d\u0435\u0451 \u0432\u0445\u043e\u0434\u044f\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0447\u0430\u0441\u0442\u0438:<\/p>\n<ul>\n<li>\n<p><strong>Embeddings API<\/strong>. \u0412 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u0445 ML \u044d\u043c\u0431\u0435\u0434\u0434\u0438\u043d\u0433 (embedding) \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043a\u0430\u043a\u0438\u0445-\u043b\u0438\u0431\u043e \u0434\u0430\u043d\u043d\u044b\u0445. \u042d\u043c\u0431\u0435\u0434\u0434\u0438\u043d\u0433\u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u043c \u043c\u044b, \u0432 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440. \u0412 \u0442\u043e\u043c \u0436\u0435 NLP \u043e\u043d\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f, \u0447\u0442\u043e\u0431\u044b \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440 \u043c\u043e\u0433 \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\/\u0438\u043b\u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0442\u0435\u043a\u0441\u0442 (\u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0438\u0442\u044c, \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0442\u044c \u0441\u043c\u044b\u0441\u043b, \u043f\u0435\u0440\u0435\u0444\u0440\u0430\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u043e \u0438\u043b\u0438 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e). Embeddings API \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0442\u0435\u043a\u0441\u0442 \u0432 \u0432\u0435\u043a\u0442\u043e\u0440\u044b.<\/p>\n<\/li>\n<li>\n<p><strong>Chat Completion API<\/strong>. \u0414\u0430\u043d\u043d\u043e\u0435 API \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 AI \u0447\u0430\u0442-\u0431\u043e\u0442\u0430\u043c\u0438. \u0423\u0436\u0435 \u0435\u0441\u0442\u044c \u043a\u043b\u0438\u0435\u043d\u0442\u044b \u0434\u043b\u044f OpenAI, Ollama, Microsoft Azure, HuggingFace, Google Vertex, Amazon Bedrock.<\/p>\n<\/li>\n<li>\n<p><strong>Function API<\/strong>. \u0423 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 OpenAI \u0435\u0441\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430\u044f <a href=\"https:\/\/platform.openai.com\/docs\/guides\/function-calling\" rel=\"noopener noreferrer nofollow\">\u0444\u0438\u0447\u0430 <\/a>\u2014 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0439. \u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442, \u043a\u0430\u043a\u0438\u0435 \u0432\u0445\u043e\u0434\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0435\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0438 \u043c\u043e\u0434\u0435\u043b\u044c \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0432\u0435\u0441\u0442\u0438 JSON, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u043d\u043e \u0432 \u043d\u0435\u0451 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c.\u042d\u0442\u043e \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043a \u043c\u043e\u0434\u0435\u043b\u0438 \u0438 \u043f\u0430\u0440\u0441\u0438\u043d\u0433 \u043e\u0442\u0432\u0435\u0442\u043e\u0432. \u041c\u043e\u0434\u0435\u043b\u044c \u043f\u043e \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0443 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c, \u0447\u0442\u043e \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0438 \u0432\u044b\u0434\u0430\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u043c \u0444\u043e\u0440\u043c\u0430\u0442\u0435. Function API \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u044d\u0442\u043e\u0439 \u0444\u0438\u0447\u0435\u0439 \u2014 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u0432\u044b\u0437\u043e\u0432\u0430 \u0438 \u0442.\u0434.<\/p>\n<\/li>\n<li>\n<p><strong>Image Generation API<\/strong>. API \u0434\u043b\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 \u043c\u043e\u0434\u0435\u043b\u044f\u043c\u0438, \u0437\u0430\u0442\u043e\u0447\u0435\u043d\u043d\u044b\u043c\u0438 \u043d\u0430 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439. \u0415\u0441\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u043a\u043b\u0438\u0435\u043d\u0442\u044b \u0434\u043b\u044f OpenAI (DALL\u00b7E) \u0438 Stability AI (Stable Diffusion).<\/p>\n<\/li>\n<li>\n<p><strong>Prompts<\/strong>. \u041f\u0440\u043e\u043c\u043f\u0442 (prompt) \u2014 \u0432\u0445\u043e\u0434\u043d\u043e\u0439 \u0442\u0435\u043a\u0441\u0442, \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u043e\u0434\u0435\u043b\u044c \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u043a\u043e\u043d\u0442\u0435\u043d\u0442. \u0412 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u043e\u0433\u043e, \u0441 \u043a\u0430\u043a\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u044c\u044e \u0432\u044b \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u0442\u0435, \u0431\u0443\u0434\u0435\u0442 \u043c\u0435\u043d\u044f\u0442\u0441\u044f \u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043f\u0440\u043e\u043c\u0442\u0430. \u0412 Stable Diffusion, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u0442\u044c \u043f\u043e\u0437\u0438\u0442\u0438\u0432\u043d\u044b\u0439 \u043f\u0440\u043e\u043c\u043f\u0442 (\u0447\u0442\u043e \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c), \u0438 \u043d\u0435\u0433\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u043f\u0440\u043e\u043c\u043f\u0442 (\u0447\u0442\u043e \u043c\u044b \u043d\u0435 \u0445\u043e\u0442\u0438\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c), \u0430 \u0432\u0445\u043e\u0434\u043d\u043e\u0439 \u0442\u0435\u043a\u0441\u0442 \u0447\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u043d\u0430\u0431\u043e\u0440 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0445 \u0441\u043b\u043e\u0432 (masterpiece, best quality, photo \u0438 \u0442.\u0434.). \u0410 \u0432 ChatGPT \u043f\u0440\u043e\u043c\u043f\u0442 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u043a\u0430\u043a \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u0438 \u0430\u0441\u0441\u043e\u0446\u0438\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0439 \u0440\u043e\u043b\u044c\u044e. (\u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c <a href=\"https:\/\/platform.openai.com\/docs\/guides\/text-generation\" rel=\"noopener noreferrer nofollow\">\u0442\u0443\u0442<\/a>). \u041c\u043e\u0434\u0443\u043b\u044c Prompts \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043a\u043b\u0430\u0441\u0441\u044b \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043f\u0440\u043e\u043c\u043f\u0442\u0430\u043c\u0438 (\u0448\u0430\u0431\u043b\u043e\u043d\u044b, \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b, \u0443\u0442\u0438\u043b\u0438\u0442\u044b).<\/p>\n<\/li>\n<li>\n<p><strong>Output Parsers<\/strong>. \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c\u044b\u0435 \u043e\u0442 \u043c\u043e\u0434\u0435\u043b\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0432 Java \u043a\u043b\u0430\u0441\u0441\u044b, \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u043f\u0430\u0440\u0441\u0435\u0440\u044b \u0438\u043b\u0438 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 OutputParser.<\/p>\n<\/li>\n<li>\n<p><strong>Vector Databases<\/strong>. \u0412\u0435\u043a\u0442\u043e\u0440\u0430\u044f \u0431\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u2014 \u044d\u0442\u043e \u0431\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0437\u0430\u0442\u043e\u0447\u0435\u043d\u0430 \u043f\u043e\u0434 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u043e\u043c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0438. \u041e\u043d\u0430 \u043d\u0443\u0436\u043d\u0430 \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0442\u043e\u043c \u0431\u0443\u0434\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f AI \u043c\u043e\u0434\u0435\u043b\u044c\u044e. \u041e\u0434\u043d\u043e\u0439 \u0438\u0437 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0445 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0435\u0439 \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u043e\u0439 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0438\u0441\u043a \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e \u0441\u0445\u043e\u0434\u0441\u0442\u0432\u0443, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043d\u0430\u0439\u0442\u0438 \u0432 \u0431\u0430\u0437\u0435 \u0432\u0435\u043a\u0442\u043e\u0440\u044b, \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0445\u043e\u0436\u0438\u0435 \u043d\u0430 \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u0439. \u042d\u0442\u043e\u0442 \u043f\u043e\u0438\u0441\u043a \u0438\u0433\u0440\u0430\u0435\u0442 \u0432\u0430\u0436\u043d\u0443\u044e \u0440\u043e\u043b\u044c \u0432 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445, \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439, \u044f\u0437\u044b\u043a\u043e\u0432\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435. \u0412 Spring AI \u0434\u043b\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u044b\u043c\u0438 \u0431\u0430\u0437\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 VectorStore. \u0412 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0435\u0441\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u0434\u043b\u044f Weaviate, Redis, PineCone, pgvector, Neo4j, Milvus, Chroma, Azure.<\/p>\n<\/li>\n<li>\n<p><strong>ETL Pipeline<\/strong>. ETL \u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043e\u0432\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043a\u0430\u043a &#171;extract, transform, load&#187; (\u0438\u0437\u0432\u043b\u0435\u0447\u044c, \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c, \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c). \u042d\u0442\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0443\u0436\u0435\u043d \u0434\u043b\u044f \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f BI-\u0441\u0438\u0441\u0442\u0435\u043c, \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u043e\u0432 \u0434\u043b\u044f \u0442\u0440\u0435\u043d\u0438\u0440\u043e\u0432\u043a\u0438 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0418\u0418, \u0434\u043e\u043b\u0433\u043e\u0441\u0440\u043e\u0447\u043d\u043e\u0433\u043e \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0438 \u043f\u0440. Spring AI \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c ETL \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u044b \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 &#171;\u0441\u044b\u0440\u043e\u043c&#187; \u0432\u0438\u0434\u0435, \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0438\u0445 \u0432 \u0432\u0435\u043a\u0442\u043e\u0440\u044b \u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0432 \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u0443\u044e \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445. <\/p>\n<\/li>\n<li>\n<p><strong>Generic Model API<\/strong>. \u0414\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u044f \u043d\u0430\u0431\u043e\u0440 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432 \u0434\u043b\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 AI \u043c\u043e\u0434\u0435\u043b\u044f\u043c\u0438. \u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0446\u0435\u043b\u044c \u2014 \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u0438 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u043d\u043e\u0432\u044b\u0445 AI \u043c\u043e\u0434\u0435\u043b\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0432 Spring AI. <\/p>\n<\/li>\n<\/ul>\n<p>\u0412 \u0440\u0430\u043c\u043a\u0430\u0445 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f Spring AI, \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 Spring \u0441\u0435\u0440\u0432\u0438\u0441 \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. \u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0435\u0433\u043e \u0440\u0430\u0431\u043e\u0442\u044b \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442:<\/p>\n<figure class=\"bordered\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/950\/5e3\/fd0\/9505e3fd06021b581ba7d98da2a81ab4.png\" alt=\"\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043a\u0430\u043a \u0447\u0435\u043b\u043e\u0432\u0435\u043a, \u0442\u0430\u043a \u0438 \u041f\u041e\" title=\"\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043a\u0430\u043a \u0447\u0435\u043b\u043e\u0432\u0435\u043a, \u0442\u0430\u043a \u0438 \u041f\u041e\" width=\"508\" height=\"112\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/950\/5e3\/fd0\/9505e3fd06021b581ba7d98da2a81ab4.png\"\/><\/p>\n<div><figcaption>\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043a\u0430\u043a \u0447\u0435\u043b\u043e\u0432\u0435\u043a, \u0442\u0430\u043a \u0438 \u041f\u041e<\/figcaption><\/div>\n<\/figure>\n<p>\u0414\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0431\u0443\u0434\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u044b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b:<\/p>\n<ul>\n<li>\n<p>Kotlin \u0432\u0435\u0440\u0441\u0438\u0438 1.9.22.<\/p>\n<\/li>\n<li>\n<p>Gradle \u0432\u0435\u0440\u0441\u0438\u0438 8.2.<\/p>\n<\/li>\n<li>\n<p>Spring (\u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u043c\u043e\u0434\u0443\u043b\u044c Spring AI).<\/p>\n<\/li>\n<li>\n<p>Ollama (\u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u044f\u0437\u044b\u043a\u043e\u0432\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439). \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u044f \u0431\u0443\u0434\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c OpenChat. \u041e\u043d\u0430 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0440\u0443\u0441\u0441\u043a\u0438\u0439 \u044f\u0437\u044b\u043a \u0438 \u0434\u0430\u0451\u0442 \u043d\u0435\u043f\u043b\u043e\u0445\u043e\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0434\u043b\u044f \u043c\u043e\u0438\u0445 \u0441\u043a\u0440\u043e\u043c\u043d\u044b\u0445 \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432.<\/p>\n<\/li>\n<li>\n<p>Postman (\u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f).<\/p>\n<\/li>\n<\/ul>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u0430\u0448 Spring \u043f\u0440\u043e\u0435\u043a\u0442. \u041c\u043e\u0436\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f <a href=\"https:\/\/start.spring.io\/\" rel=\"noopener noreferrer nofollow\">Spring Initializr<\/a> \u0438\u043b\u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u0432\u0440\u0443\u0447\u043d\u0443\u044e. \u041d\u0435 \u0437\u0430\u0431\u0443\u0434\u044c\u0442\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u0434\u043b\u044f Spring AI, \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u0443\u044e \u043d\u0438\u0436\u0435<\/p>\n<pre><code class=\"kotlin\">implementation(\"org.springframework.ai:spring-ai-ollama-spring-boot-starter:0.8.1-SNAPSHOT\")<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043d\u0430\u0431\u0440\u043e\u0441\u0430\u0435\u043c \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u044b.<br \/>\u041a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440:<\/p>\n<pre><code class=\"kotlin\">@RestController class ChatController(     private val chatService: ChatService ) {     @PostMapping(\"\/chat\")     fun sendMessage(@RequestBody message: String): String {         return chatService.exchange(message)     } }<\/code><\/pre>\n<p>\u0421\u0435\u0440\u0432\u0438\u0441:<\/p>\n<pre><code class=\"kotlin\">@Service class ChatService(     private val client : OllamaApiClient ) {     private val outputParser = BeanOutputParser(SentimentAnalysisResult::class.java)      fun exchange(message: String): String {         return client.sendMessage(message)     } }<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c OllamaApiClient. \u0412 Spring AI \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f ChatClient \u0434\u043b\u044f Ollama, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0451 \u0434\u043b\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 \u043c\u043e\u0434\u0435\u043b\u044c\u044e.<\/p>\n<pre><code class=\"kotlin\">@Component class OllamaApiClient(     properties: OllamaClientProperties ) {     private final var client = OllamaChatClient(OllamaApi(properties.url))      init {         val options = OllamaOptions.create()         options.model = properties.model     }      fun sendMessage(message: String): String {         return client.call(message)     } }<\/code><\/pre>\n<p>OllamaClientProperties:<\/p>\n<pre><code class=\"kotlin\">@ConfigurationProperties(prefix = \"ai.ollama\") data class OllamaClientProperties(     val url: String,     val model: String )<\/code><\/pre>\n<p>\u0410\u0434\u0440\u0435\u0441 \u0438 \u0438\u043c\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0432 application.yml.<br \/>\u041f\u043e\u0441\u043b\u0435 \u043f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0439 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0441\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u043d\u0430\u0448 \u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/388\/144\/6cb\/3881446cb66f513368829d1adc2bbd7f.png\" alt=\"\u0427\u0435\u043c \u0434\u043e\u043b\u044c\u0448\u0435 \u044f \u0441\u043c\u043e\u0442\u0440\u044e \u043d\u0430 \u044d\u0442\u043e\u0442 \u043e\u0442\u0432\u0435\u0442, \u0442\u0435\u043c \u043c\u0435\u043d\u044c\u0448\u0435 \u044f \u0445\u043e\u0447\u0443 \u0434\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0435\u043c\u0443 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0441\u0442\u0430\u0442\u044c\u0438\" title=\"\u0427\u0435\u043c \u0434\u043e\u043b\u044c\u0448\u0435 \u044f \u0441\u043c\u043e\u0442\u0440\u044e \u043d\u0430 \u044d\u0442\u043e\u0442 \u043e\u0442\u0432\u0435\u0442, \u0442\u0435\u043c \u043c\u0435\u043d\u044c\u0448\u0435 \u044f \u0445\u043e\u0447\u0443 \u0434\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0435\u043c\u0443 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0441\u0442\u0430\u0442\u044c\u0438\" width=\"869\" height=\"571\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/388\/144\/6cb\/3881446cb66f513368829d1adc2bbd7f.png\"\/><\/p>\n<div><figcaption>\u0427\u0435\u043c \u0434\u043e\u043b\u044c\u0448\u0435 \u044f \u0441\u043c\u043e\u0442\u0440\u044e \u043d\u0430 \u044d\u0442\u043e\u0442 \u043e\u0442\u0432\u0435\u0442, \u0442\u0435\u043c \u043c\u0435\u043d\u044c\u0448\u0435 \u044f \u0445\u043e\u0447\u0443 \u0434\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0435\u043c\u0443 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0441\u0442\u0430\u0442\u044c\u0438<\/figcaption><\/div>\n<\/figure>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043f\u0440\u043e\u0441\u0438\u0442\u044c \u0447\u0430\u0442-\u0431\u043e\u0442\u0430 \u043e\u0446\u0435\u043d\u0438\u0432\u0430\u0442\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 \u043d\u0430\u0448\u0435\u0433\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043a \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u0437\u0430\u043f\u0440\u043e\u0441\u0443. \u0421\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e PromptTemplate:<\/p>\n<pre><code class=\"kotlin\">private val promptTemplate = PromptTemplate(\"\"\"         \u041a\u0430\u043a\u043e\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 \u0443 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u0430:'{text}'?          \u041e\u043d\u043e \u043f\u043e\u0437\u0438\u0442\u0438\u0432\u043d\u043e\u0435, \u043d\u0435\u0433\u0430\u0442\u0438\u0432\u043d\u043e\u0435 \u0438\u043b\u0438 \u043d\u0435\u0439\u0442\u0440\u0430\u043b\u044c\u043d\u043e\u0435?          \u0423\u043a\u0430\u0436\u0438 \u0441\u0442\u0435\u043f\u0435\u043d\u044c \u0443\u0432\u0435\u0440\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0447\u0438\u0441\u043b\u0430 \u043e\u0442 0.0 \u0434\u043e 1.0.\"     \"\"\") fun exchange(message: String): String {         val prompt = promptTemplateRus.create(mapOf(\"text\" to message))         val generation = client.sendMessage(prompt)         return generation.output.content.toString()     }<\/code><\/pre>\n<p>\u0412 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043c\u043e\u0434\u0435\u043b\u0438, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435, \u0448\u0430\u0431\u043b\u043e\u043d \u043c\u043e\u0436\u043d\u043e \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u044f \u0438\u0437 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c\u044b\u0445 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432. <br \/>\u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 PromptTemplate \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043e\u0431\u044a\u0435\u043a\u0442 \u0442\u0438\u043f\u0430 Prompt, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0438 \u043c\u0435\u0442\u043e\u0434 sendMessage:<\/p>\n<pre><code class=\"kotlin\">fun sendMessage(prompt: Prompt): Generation {         val response = client.call(prompt)         return response.result     }<\/code><\/pre>\n<p>\u041f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441 \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0442\u0430\u043a\u043e\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e99\/778\/ed1\/e99778ed104ad52f0241667fc1a09eb2.PNG\" alt=\"\" title=\"\" width=\"698\" height=\"374\"\/><\/figure>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043d\u0435\u043f\u043b\u043e\u0445\u043e\u0439, \u043d\u043e \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043b\u0443\u0447\u0448\u0435. \u0421\u0435\u0439\u0447\u0430\u0441 \u043d\u0430\u0448\u0435 API \u043e\u0442\u0434\u0430\u0451\u0442 \u043e\u0442\u0432\u0435\u0442 \u0432 \u0432\u0438\u0434\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u0430. \u0422\u0430\u043a\u043e\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u043f\u0430\u0440\u0441\u0438\u0442\u044c, \u043f\u043b\u044e\u0441, \u043c\u043e\u0434\u0435\u043b\u044c \u043c\u043e\u0436\u0435\u0442 \u043f\u0435\u0440\u0435\u0444\u0440\u0430\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u044d\u0442\u043e \u0435\u0449\u0451 \u043d\u0435\u0443\u0434\u043e\u0431\u043d\u0435\u0435 \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043c \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0432\u044b\u0432\u043e\u0434\u0438\u043c\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445. \u041c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u0443\u0435\u043c \u043d\u0430\u0448 \u043a\u043e\u0434 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c data \u043a\u043b\u0430\u0441\u0441 \u0434\u043b\u044f \u043c\u0430\u043f\u043f\u0438\u043d\u0433\u0430 \u0434\u0430\u043d\u043d\u044b\u0445:<\/p>\n<pre><code class=\"kotlin\">data class SentimentAnalysisResult(     val text: String = \"\",     val sentiment: String = \"\",     val confidence: String = \"\" )<\/code><\/pre>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043c Output Parser \u0447\u0442\u043e\u0431\u044b \u0441\u0440\u0430\u0437\u0443 &#171;\u0443\u043f\u0430\u043a\u043e\u0432\u0430\u0442\u044c&#187; \u043e\u0442\u0432\u0435\u0442 \u0432 data \u043a\u043b\u0430\u0441\u0441:<\/p>\n<pre><code class=\"kotlin\"> private val promptTemplate = PromptTemplate(\"\"\"         \u041a\u0430\u043a\u043e\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 \u0443 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u0430:'{text}'?          \u041e\u043d\u043e \u043f\u043e\u0437\u0438\u0442\u0438\u0432\u043d\u043e\u0435, \u043d\u0435\u0433\u0430\u0442\u0438\u0432\u043d\u043e\u0435 \u0438\u043b\u0438 \u043d\u0435\u0439\u0442\u0440\u0430\u043b\u044c\u043d\u043e\u0435?          \u0423\u043a\u0430\u0436\u0438 \u0441\u0442\u0435\u043f\u0435\u043d\u044c \u0443\u0432\u0435\u0440\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0447\u0438\u0441\u043b\u0430 \u043e\u0442 0.0 \u0434\u043e 1.0.{format}\"     \"\"\")     private val outputParser = BeanOutputParser(SentimentAnalysisResult::class.java)      fun exchange(message: String): SentimentAnalysisResult {         val prompt = promptTemplate.create(mapOf(\"text\" to message, \"format\" to outputParser.format))         val answer = client.sendMessage(prompt)         return outputParser.parse(answer.output.content)     }<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0448 \u0437\u0430\u043f\u0440\u043e\u0441 \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0432\u0438\u0434:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a7c\/c1a\/01b\/a7cc1a01b85b201d091e9e34bdb1f119.PNG\" alt=\"\u0423\u0432\u0435\u0440\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0432 \u043e\u0442\u0432\u0435\u0442\u0435 \u0432\u0441\u0451 \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u0430\u0435\u0442\" title=\"\u0423\u0432\u0435\u0440\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0432 \u043e\u0442\u0432\u0435\u0442\u0435 \u0432\u0441\u0451 \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u0430\u0435\u0442\" width=\"706\" height=\"415\"\/><\/p>\n<div><figcaption>\u0423\u0432\u0435\u0440\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0432 \u043e\u0442\u0432\u0435\u0442\u0435 \u0432\u0441\u0451 \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u0430\u0435\u0442<\/figcaption><\/div>\n<\/figure>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c, \u0447\u0442\u043e \u043d\u0430\u0448\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435:<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/aa3\/e17\/6bb\/aa3e176bb85bfe4f92ca08aca83c7905.PNG\" alt=\"\u041d\u0435\u0439\u0442\u0440\u0430\u043b\u044c\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441\" title=\"\u041d\u0435\u0439\u0442\u0440\u0430\u043b\u044c\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441\" width=\"275\" height=\"114\"\/><\/p>\n<div><figcaption>\u041d\u0435\u0439\u0442\u0440\u0430\u043b\u044c\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441<\/figcaption><\/div>\n<\/figure>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/9e4\/3b2\/9ce\/9e43b29ce826be00e354caadb34139b4.PNG\" alt=\"\u041f\u043e\u0437\u0438\u0442\u0438\u0432\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441\" title=\"\u041f\u043e\u0437\u0438\u0442\u0438\u0432\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441\" width=\"302\" height=\"107\"\/><\/p>\n<div><figcaption>\u041f\u043e\u0437\u0438\u0442\u0438\u0432\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441<\/figcaption><\/div>\n<\/figure>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5ee\/ae3\/dd7\/5eeae3dd77d1960bf9ba89b1a9a84507.PNG\" alt=\"\u041d\u0435\u0433\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441\" title=\"\u041d\u0435\u0433\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441\" width=\"263\" height=\"110\"\/><\/p>\n<div><figcaption>\u041d\u0435\u0433\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441<\/figcaption><\/div>\n<\/figure>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f\u043c! \u0414\u0430\u043b\u0435\u0435, \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c, \u043c\u0435\u043d\u044f\u0442\u044c API \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0438\u043b\u0438 \u0448\u0430\u0431\u043b\u043e\u043d\u044b \u0434\u043b\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432.<\/p>\n<p>\u0412 \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u044e\u0449\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u0445\u043e\u0442\u0435\u043b \u0431\u044b \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u0440\u043e \u0442\u044e\u043d\u0438\u043d\u0433 \u043c\u043e\u0434\u0435\u043b\u0438. OllamaChatClient \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0448\u0438\u0440\u043e\u043a\u0438\u0439 \u0441\u043f\u0435\u043a\u0442\u0440 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043c\u043e\u0434\u0435\u043b\u0438, \u0432\u043e\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0437 \u043d\u0438\u0445:<\/p>\n<ul>\n<li>\n<p><strong>temperature<\/strong>. \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043a\u0440\u0435\u0430\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438 \u043c\u043e\u0434\u0435\u043b\u0438. \u0427\u0435\u043c \u0432\u044b\u0448\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0442\u0435\u043c \u043e\u0442\u0432\u0435\u0442\u044b \u0431\u043e\u043b\u0435\u0435 \u043d\u0435\u043e\u0431\u044b\u0447\u043d\u044b\u0435. <\/p>\n<\/li>\n<li>\n<p><strong>frequencyPenalty<\/strong>. &#171;\u041d\u0430\u043a\u0430\u0437\u0430\u043d\u0438\u0435&#187; \u043c\u043e\u0434\u0435\u043b\u0438 \u0437\u0430 \u043f\u043e\u0432\u0442\u043e\u0440\u0435\u043d\u0438\u044f. \u041c\u0435\u043d\u044c\u0448\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u2014 \u0431\u043e\u043b\u044c\u0448\u0435 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0445 \u0441\u043b\u043e\u0432\u0435\u0441\u043d\u044b\u0445 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439 \u0438 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439, \u043c\u0435\u043d\u044c\u0448\u0435 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u043b\u043e\u0432. <\/p>\n<\/li>\n<li>\n<p><strong>presencePenalty<\/strong>. &#171;\u041d\u0430\u043a\u0430\u0437\u0430\u043d\u0438\u0435&#187; \u043c\u043e\u0434\u0435\u043b\u0438 \u0437\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0434\u043d\u0438\u0445 \u0438 \u0442\u0435\u0445 \u0436\u0435 \u0442\u043e\u043a\u0435\u043d\u043e\u0432 \u0432 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u043c \u0442\u0435\u043a\u0441\u0442\u0435. \u0427\u0435\u043c \u043c\u0435\u043d\u044c\u0448\u0435 \u0447\u0438\u0441\u043b\u043e, \u0442\u0435\u043c \u0447\u0430\u0449\u0435 \u043c\u043e\u0433\u0443\u0442 \u043f\u043e\u043f\u0430\u0434\u0430\u0442\u044c\u0441\u044f \u043e\u0434\u043d\u0438 \u0438 \u0442\u0435 \u0436\u0435 \u0441\u043b\u043e\u0432\u0430. <\/p>\n<\/li>\n<li>\n<p><strong>topK<\/strong>. \u0423 \u043c\u043e\u0434\u0435\u043b\u0438 \u0435\u0441\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u0442\u0435\u043a\u0441\u0442. \u0414\u0430\u043d\u043d\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u0442\u043e\u043a\u0435\u043d\u043e\u0432 \u0434\u043b\u044f \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u044f. \u041c\u0435\u043d\u044c\u0448\u0435 \u0447\u0438\u0441\u043b\u043e \u2014 \u043c\u0435\u043d\u044c\u0448\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u043e\u043f\u0446\u0438\u0439.<\/p>\n<\/li>\n<li>\n<p><strong>topP<\/strong>. \u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 \u043a\u0443\u043c\u0443\u043b\u044f\u0442\u0438\u0432\u043d\u043e\u0439 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0442\u043e\u043a\u0435\u043d\u043e\u0432. \u0420\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441\u0445\u043e\u0436\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0441 topK. \u0415\u0441\u0442\u044c \u043d\u0430\u0431\u043e\u0440 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0442\u043e\u043a\u0435\u043d\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043c\u043e\u0434\u0435\u043b\u044c \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c \u0442\u0435\u043a\u0441\u0442. \u0423 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0442\u043e\u043a\u0435\u043d\u0430 \u0435\u0441\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u0430\u044f \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c, \u0447\u0442\u043e \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c. \u0422\u043e\u043a\u0435\u043d\u044b \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0432 \u043d\u0435\u043a\u0438\u0439 \u043f\u0443\u043b \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0442\u043e\u043a\u0435\u043d\u043e\u0432, \u0433\u0434\u0435 \u0438\u0445 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438 \u0441\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u044e\u0442\u0441\u044f. \u041a\u043e\u0433\u0434\u0430 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u0435\u0432\u044b\u0441\u0438\u0442 P, \u0431\u043e\u043b\u044c\u0448\u0435 \u0442\u043e\u043a\u0435\u043d\u044b \u043d\u0435 \u0431\u0443\u0434\u0443\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0438 \u043c\u043e\u0434\u0435\u043b\u044c \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0431\u0438\u0440\u0430\u0442\u044c \u0442\u043e\u043a\u0435\u043d \u0438\u0437 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0445. <\/p>\n<\/li>\n<\/ul>\n<p>\u0418\u0437-\u0437\u0430 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u043f\u043e\u0434\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0434 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442, \u043d\u0430\u043c \u043d\u0435 \u0441\u0438\u043b\u044c\u043d\u043e \u0432\u0430\u0436\u043d\u0430 \u043a\u0440\u0435\u0430\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u0438, \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u0442 \u043b\u0438 \u043e\u043d\u0430 \u043e\u0434\u043d\u0438 \u0438 \u0442\u0435 \u0436\u0435 \u0441\u043b\u043e\u0432\u0430 \u0438\u043b\u0438 \u043d\u0435\u0442, \u0432\u0435\u0434\u044c \u043c\u044b \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u0443\u0432\u0438\u0434\u0438\u043c. \u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u0438\u043b\u044c\u043d\u043e \u0432\u043b\u0438\u044f\u0435\u0442 \u043d\u0430 \u0432\u044b\u0432\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u2014 \u044d\u0442\u043e topP. <br \/>\u041e\u043f\u044b\u0442\u043d\u044b\u043c \u043f\u0443\u0442\u0451\u043c \u0431\u044b\u043b\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043e, \u0447\u0442\u043e \u0432\u044b\u0441\u043e\u043a\u0438\u0439 topP \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u043c\u043e\u0434\u0435\u043b\u044c \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u043c\u0435\u043d\u044f\u0435\u0442 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0443\u0432\u0435\u0440\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0432 \u0441\u0432\u043e\u0451\u043c \u043e\u0442\u0432\u0435\u0442\u0435. \u0414\u043b\u044f \u043d\u0430\u0448\u0438\u0445 \u0446\u0435\u043b\u0435\u0439 \u044d\u0442\u043e \u043d\u0435\u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e (\u0438\u043d\u0430\u0447\u0435 \u043f\u0440\u043e\u0449\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u0441\u0430\u043c\u0438\u043c). \u041f\u043e\u044d\u0442\u043e\u043c\u0443 topP \u0441\u0442\u043e\u0438\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c 0.25 \u0438\u043b\u0438 \u043d\u0438\u0436\u0435. \u041f\u043e \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c \u0432\u044b\u0431\u043e\u0440 \u043d\u0435 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0438\u0430\u043b\u0435\u043d \u0438 \u043d\u0435 \u043f\u043e\u0432\u043b\u0438\u044f\u0435\u0442 \u043d\u0430 \u043e\u0446\u0435\u043d\u043a\u0443 \u0442\u0435\u043a\u0441\u0442\u0430 (\u043f\u043e \u043a\u0440\u0430\u0439\u043d\u0435\u0439 \u043c\u0435\u0440\u0435 \u0434\u043b\u044f \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u0439 \u043c\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438).<\/p>\n<p>\u0412\u043d\u0435\u0441\u0451\u043c \u0438\u0442\u043e\u0433\u043e\u0432\u044b\u0435 \u043f\u0440\u0430\u0432\u043a\u0438 \u0432 \u043a\u043e\u0434.<br \/>application.yml<\/p>\n<pre><code class=\"yaml\">ai:   ollama:     url: \"http:\/\/localhost:11434\"     options:       model: \"openchat\"       temperature: 0.8f       top_k: 100       top_p: 0.25f       frequency_penalty: 0f       presence_penalty: 0f<\/code><\/pre>\n<p>\u041a\u043b\u0430\u0441\u0441 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438<\/p>\n<pre><code class=\"kotlin\">@ConfigurationProperties(prefix = \"ai.ollama\") data class OllamaClientProperties(     val url: String,     val options: OllamaOptions )  data class OllamaOptions(     val model: String,     val temperature: Float,     val topK: Int,     val topP: Float,     val frequencyPenalty: Float,     val presencePenalty: Float )<\/code><\/pre>\n<p>\u041a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u0434\u043b\u044f OllamaApiClient<\/p>\n<pre><code class=\"kotlin\">init {         val options = OllamaOptions.create()         options.model = properties.options.model         options.temperature = properties.options.temperature         options.topK = properties.options.topK         options.topP = properties.options.topP         options.frequencyPenalty = properties.options.frequencyPenalty         options.presencePenalty = properties.options.presencePenalty         client.withDefaultOptions(options)     }<\/code><\/pre>\n<hr\/>\n<p>\u0412\u043e\u0442 \u0438 \u043f\u043e\u0434\u043e\u0448\u0451\u043b \u043a \u043a\u043e\u043d\u0446\u0443 \u0433\u0430\u0439\u0434. \u0412 \u043d\u0451\u043c \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438 \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b Spring AI, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0441 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0435\u0439 AI \u0447\u0430\u0442-\u0431\u043e\u0442\u0430 \u0432 \u0432\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u041a\u043e\u043d\u0435\u0447\u043d\u043e, Spring AI \u043d\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u043c\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u043c\u0438, \u044d\u0442\u043e \u043e\u0431\u0448\u0438\u0440\u043d\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442, \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e \u0432\u044b\u0445\u043e\u0434\u044f\u0442 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f. \u041f\u043e\u043b\u0443\u0447\u0438\u0442 \u043b\u0438 \u043e\u043d \u0448\u0438\u0440\u043e\u043a\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0438\u0435, \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e, \u043d\u043e \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0432 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0438 \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u0430, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043e\u043d\u043e \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u043f\u0435\u0442-\u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432.<\/p>\n<p>\u0418\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432 <a href=\"https:\/\/github.com\/ullaes\/sentiment-analysis\" rel=\"noopener noreferrer nofollow\">\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438<\/a><\/p>\n<p><strong>\u0418\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0438<\/strong><\/p>\n<p><a href=\"https:\/\/docs.spring.io\/spring-ai\/reference\/index.html\" rel=\"noopener noreferrer nofollow\">\u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f Spring AI<\/a><br \/><a href=\"https:\/\/github.com\/ollama\/ollama\" rel=\"noopener noreferrer nofollow\">Ollama<\/a><br \/><a href=\"https:\/\/medium.com\/@daniel.puenteviejo\/the-science-of-control-how-temperature-top-p-and-top-k-shape-large-language-models-853cb0480dae\" rel=\"noopener noreferrer nofollow\">\u041f\u0440\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 \u043c\u043e\u0434\u0435\u043b\u0438<\/a><\/p>\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\/796855\/\"> https:\/\/habr.com\/ru\/articles\/796855\/<\/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<figure class=\"full-width\"><\/figure>\n<p>\u0427\u0430\u0442-\u0431\u043e\u0442\u044b \u0441 \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u044b\u043c \u0438\u0441\u043a\u0443\u0441\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u0438\u043d\u0442\u0435\u043b\u043b\u0435\u043a\u0442\u043e\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0448\u0438\u0440\u043e\u043a\u0443\u044e \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u0441\u043b\u0435 \u0440\u0435\u043b\u0438\u0437\u0430 ChatGPT \u0432 \u043d\u043e\u044f\u0431\u0440\u0435 2022 \u0433\u043e\u0434\u0430. \u0421\u0435\u0439\u0447\u0430\u0441 \u0432\u0440\u044f\u0434 \u043b\u0438 \u043d\u0430\u0439\u0434\u0451\u0442\u0441\u044f \u0447\u0435\u043b\u043e\u0432\u0435\u043a \u0438\u0437 IT, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435 \u0441\u043b\u044b\u0448\u0430\u043b \u043f\u0440\u043e \u0434\u0430\u043d\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u043e\u0442 OpenAI. \u0418\u043c\u0435\u043d\u043d\u043e \u043e\u043d \u0432\u044b\u0437\u0432\u0430\u043b \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0439 \u0431\u0443\u043c \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0444\u0435\u0440\u0435, \u0432\u044b\u043d\u0443\u0434\u0438\u0432 \u043a\u043e\u043d\u043a\u0443\u0440\u0435\u043d\u0442\u043e\u0432 \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0438 \u0430\u043d\u0430\u043b\u043e\u0433\u0438, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0431\u043e\u0440\u043e\u0442\u044c\u0441\u044f \u0437\u0430 \u043c\u0435\u0441\u0442\u043e \u043d\u0430 \u0440\u044b\u043d\u043a\u0435. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u0430\u044f \u043b\u0430\u0432\u0438\u043d\u0430 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0437\u0430\u0442\u0440\u043e\u043d\u0443\u043b\u0430 \u043c\u043d\u043e\u0433\u0438\u0435 \u044f\u0437\u044b\u043a\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u041d\u0435 \u043e\u0431\u043e\u0448\u043b\u0438 \u043e\u043d\u0438 \u0438 Java-\u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u043e. Spring Framework, \u043e\u0434\u0438\u043d \u0438\u0437 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 Java \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u0432 \u043e\u0431\u0437\u0430\u0432\u0451\u043b\u0441\u044f \u043c\u043e\u0434\u0443\u043b\u0435\u043c Spring AI, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0431\u0435\u0449\u0430\u0435\u0442 \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438 \u0418\u0418. <\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0432\u043c\u0435\u0441\u0442\u0435 \u0432\u0437\u0433\u043b\u044f\u043d\u0435\u043c \u043d\u0430 \u043d\u0435\u0433\u043e \u0432 \u0434\u0435\u043b\u0435 \u0438 \u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043d\u0430 \u0434\u0435\u043c\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0435. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0433\u0430\u0439\u0434\u0435 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043c Kotlin \u0441\u0435\u0440\u0432\u0438\u0441 \u043a \u0447\u0430\u0442-\u0431\u043e\u0442\u0443 \u0432\u0441\u0435\u0433\u043e \u0437\u0430 \u043f\u044f\u0442\u044c \u043c\u0438\u043d\u0443\u0442, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f Spring AI!<\/p>\n<p>Spring AI \u2014 \u044d\u0442\u043e \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442, \u0446\u0435\u043b\u044c \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u2014 \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0441 \u0438\u0441\u043a\u0443\u0441\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u0438\u043d\u0442\u0435\u043b\u043b\u0435\u043a\u0442\u043e\u043c (\u043b\u0438\u0431\u043e \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044e \u0441 \u0442\u0430\u043a\u0438\u043c\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c\u0438). \u041d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u0435\u0440\u0441\u0438\u044f 0.8.1-SNAPSHOT. \u0412 \u043d\u0435\u0451 \u0432\u0445\u043e\u0434\u044f\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0447\u0430\u0441\u0442\u0438:<\/p>\n<ul>\n<li>\n<p><strong>Embeddings API<\/strong>. \u0412 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u0445 ML \u044d\u043c\u0431\u0435\u0434\u0434\u0438\u043d\u0433 (embedding) \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043a\u0430\u043a\u0438\u0445-\u043b\u0438\u0431\u043e \u0434\u0430\u043d\u043d\u044b\u0445. \u042d\u043c\u0431\u0435\u0434\u0434\u0438\u043d\u0433\u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u043c \u043c\u044b, \u0432 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440. \u0412 \u0442\u043e\u043c \u0436\u0435 NLP \u043e\u043d\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f, \u0447\u0442\u043e\u0431\u044b \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440 \u043c\u043e\u0433 \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\/\u0438\u043b\u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0442\u0435\u043a\u0441\u0442 (\u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0438\u0442\u044c, \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0442\u044c \u0441\u043c\u044b\u0441\u043b, \u043f\u0435\u0440\u0435\u0444\u0440\u0430\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u043e \u0438\u043b\u0438 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e). Embeddings API \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0442\u0435\u043a\u0441\u0442 \u0432 \u0432\u0435\u043a\u0442\u043e\u0440\u044b.<\/p>\n<\/li>\n<li>\n<p><strong>Chat Completion API<\/strong>. \u0414\u0430\u043d\u043d\u043e\u0435 API \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 AI \u0447\u0430\u0442-\u0431\u043e\u0442\u0430\u043c\u0438. \u0423\u0436\u0435 \u0435\u0441\u0442\u044c \u043a\u043b\u0438\u0435\u043d\u0442\u044b \u0434\u043b\u044f OpenAI, Ollama, Microsoft Azure, HuggingFace, Google Vertex, Amazon Bedrock.<\/p>\n<\/li>\n<li>\n<p><strong>Function API<\/strong>. \u0423 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 OpenAI \u0435\u0441\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430\u044f <a href=\"https:\/\/platform.openai.com\/docs\/guides\/function-calling\" rel=\"noopener noreferrer nofollow\">\u0444\u0438\u0447\u0430 <\/a>\u2014 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0439. \u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442, \u043a\u0430\u043a\u0438\u0435 \u0432\u0445\u043e\u0434\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0435\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0438 \u043c\u043e\u0434\u0435\u043b\u044c \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0432\u0435\u0441\u0442\u0438 JSON, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u043d\u043e \u0432 \u043d\u0435\u0451 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c.\u042d\u0442\u043e \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043a \u043c\u043e\u0434\u0435\u043b\u0438 \u0438 \u043f\u0430\u0440\u0441\u0438\u043d\u0433 \u043e\u0442\u0432\u0435\u0442\u043e\u0432. \u041c\u043e\u0434\u0435\u043b\u044c \u043f\u043e \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0443 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c, \u0447\u0442\u043e \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0438 \u0432\u044b\u0434\u0430\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u043c \u0444\u043e\u0440\u043c\u0430\u0442\u0435. Function API \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u044d\u0442\u043e\u0439 \u0444\u0438\u0447\u0435\u0439 \u2014 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u0432\u044b\u0437\u043e\u0432\u0430 \u0438 \u0442.\u0434.<\/p>\n<\/li>\n<li>\n<p><strong>Image Generation API<\/strong>. API \u0434\u043b\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 \u043c\u043e\u0434\u0435\u043b\u044f\u043c\u0438, \u0437\u0430\u0442\u043e\u0447\u0435\u043d\u043d\u044b\u043c\u0438 \u043d\u0430 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439. \u0415\u0441\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u043a\u043b\u0438\u0435\u043d\u0442\u044b \u0434\u043b\u044f OpenAI (DALL\u00b7E) \u0438 Stability AI (Stable Diffusion).<\/p>\n<\/li>\n<li>\n<p><strong>Prompts<\/strong>. \u041f\u0440\u043e\u043c\u043f\u0442 (prompt) \u2014 \u0432\u0445\u043e\u0434\u043d\u043e\u0439 \u0442\u0435\u043a\u0441\u0442, \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u043e\u0434\u0435\u043b\u044c \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u043a\u043e\u043d\u0442\u0435\u043d\u0442. \u0412 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u043e\u0433\u043e, \u0441 \u043a\u0430\u043a\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u044c\u044e \u0432\u044b \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u0442\u0435, \u0431\u0443\u0434\u0435\u0442 \u043c\u0435\u043d\u044f\u0442\u0441\u044f \u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043f\u0440\u043e\u043c\u0442\u0430. \u0412 Stable Diffusion, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u0442\u044c \u043f\u043e\u0437\u0438\u0442\u0438\u0432\u043d\u044b\u0439 \u043f\u0440\u043e\u043c\u043f\u0442 (\u0447\u0442\u043e \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c), \u0438 \u043d\u0435\u0433\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u043f\u0440\u043e\u043c\u043f\u0442 (\u0447\u0442\u043e \u043c\u044b \u043d\u0435 \u0445\u043e\u0442\u0438\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c), \u0430 \u0432\u0445\u043e\u0434\u043d\u043e\u0439 \u0442\u0435\u043a\u0441\u0442 \u0447\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u043d\u0430\u0431\u043e\u0440 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0445 \u0441\u043b\u043e\u0432 (masterpiece, best quality, photo \u0438 \u0442.\u0434.). \u0410 \u0432 ChatGPT \u043f\u0440\u043e\u043c\u043f\u0442 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u043a\u0430\u043a \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u0438 \u0430\u0441\u0441\u043e\u0446\u0438\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0439 \u0440\u043e\u043b\u044c\u044e. (\u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c <a href=\"https:\/\/platform.openai.com\/docs\/guides\/text-generation\" rel=\"noopener noreferrer nofollow\">\u0442\u0443\u0442<\/a>). \u041c\u043e\u0434\u0443\u043b\u044c Prompts \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043a\u043b\u0430\u0441\u0441\u044b \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043f\u0440\u043e\u043c\u043f\u0442\u0430\u043c\u0438 (\u0448\u0430\u0431\u043b\u043e\u043d\u044b, \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b, \u0443\u0442\u0438\u043b\u0438\u0442\u044b).<\/p>\n<\/li>\n<li>\n<p><strong>Output Parsers<\/strong>. \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c\u044b\u0435 \u043e\u0442 \u043c\u043e\u0434\u0435\u043b\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0432 Java \u043a\u043b\u0430\u0441\u0441\u044b, \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u043f\u0430\u0440\u0441\u0435\u0440\u044b \u0438\u043b\u0438 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 OutputParser.<\/p>\n<\/li>\n<li>\n<p><strong>Vector Databases<\/strong>. \u0412\u0435\u043a\u0442\u043e\u0440\u0430\u044f \u0431\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u2014 \u044d\u0442\u043e \u0431\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0437\u0430\u0442\u043e\u0447\u0435\u043d\u0430 \u043f\u043e\u0434 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u043e\u043c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0438. \u041e\u043d\u0430 \u043d\u0443\u0436\u043d\u0430 \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0442\u043e\u043c \u0431\u0443\u0434\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f AI \u043c\u043e\u0434\u0435\u043b\u044c\u044e. \u041e\u0434\u043d\u043e\u0439 \u0438\u0437 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0445 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0435\u0439 \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u043e\u0439 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0438\u0441\u043a \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e \u0441\u0445\u043e\u0434\u0441\u0442\u0432\u0443, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043d\u0430\u0439\u0442\u0438 \u0432 \u0431\u0430\u0437\u0435 \u0432\u0435\u043a\u0442\u043e\u0440\u044b, \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0445\u043e\u0436\u0438\u0435 \u043d\u0430 \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u0439. \u042d\u0442\u043e\u0442 \u043f\u043e\u0438\u0441\u043a \u0438\u0433\u0440\u0430\u0435\u0442 \u0432\u0430\u0436\u043d\u0443\u044e \u0440\u043e\u043b\u044c \u0432 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445, \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439, \u044f\u0437\u044b\u043a\u043e\u0432\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435. \u0412 Spring AI \u0434\u043b\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u044b\u043c\u0438 \u0431\u0430\u0437\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 VectorStore. \u0412 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0435\u0441\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u0434\u043b\u044f Weaviate, Redis, PineCone, pgvector, Neo4j, Milvus, Chroma, Azure.<\/p>\n<\/li>\n<li>\n<p><strong>ETL Pipeline<\/strong>. ETL \u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043e\u0432\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043a\u0430\u043a &#171;extract, transform, load&#187; (\u0438\u0437\u0432\u043b\u0435\u0447\u044c, \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c, \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c). \u042d\u0442\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0443\u0436\u0435\u043d \u0434\u043b\u044f \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f BI-\u0441\u0438\u0441\u0442\u0435\u043c, \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u043e\u0432 \u0434\u043b\u044f \u0442\u0440\u0435\u043d\u0438\u0440\u043e\u0432\u043a\u0438 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0418\u0418, \u0434\u043e\u043b\u0433\u043e\u0441\u0440\u043e\u0447\u043d\u043e\u0433\u043e \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0438 \u043f\u0440. Spring AI \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c ETL \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u044b \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 &#171;\u0441\u044b\u0440\u043e\u043c&#187; \u0432\u0438\u0434\u0435, \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0438\u0445 \u0432 \u0432\u0435\u043a\u0442\u043e\u0440\u044b \u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0432 \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u0443\u044e \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445. <\/p>\n<\/li>\n<li>\n<p><strong>Generic Model API<\/strong>. \u0414\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u044f \u043d\u0430\u0431\u043e\u0440 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432 \u0434\u043b\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 AI \u043c\u043e\u0434\u0435\u043b\u044f\u043c\u0438. \u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0446\u0435\u043b\u044c \u2014 \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u0438 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u043d\u043e\u0432\u044b\u0445 AI \u043c\u043e\u0434\u0435\u043b\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0432 Spring AI. <\/p>\n<\/li>\n<\/ul>\n<p>\u0412 \u0440\u0430\u043c\u043a\u0430\u0445 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f Spring AI, \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 Spring \u0441\u0435\u0440\u0432\u0438\u0441 \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. \u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0435\u0433\u043e \u0440\u0430\u0431\u043e\u0442\u044b \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442:<\/p>\n<figure class=\"bordered\">\n<div><figcaption>\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043a\u0430\u043a \u0447\u0435\u043b\u043e\u0432\u0435\u043a, \u0442\u0430\u043a \u0438 \u041f\u041e<\/figcaption><\/div>\n<\/figure>\n<p>\u0414\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0431\u0443\u0434\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u044b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b:<\/p>\n<ul>\n<li>\n<p>Kotlin \u0432\u0435\u0440\u0441\u0438\u0438 1.9.22.<\/p>\n<\/li>\n<li>\n<p>Gradle \u0432\u0435\u0440\u0441\u0438\u0438 8.2.<\/p>\n<\/li>\n<li>\n<p>Spring (\u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u043c\u043e\u0434\u0443\u043b\u044c Spring AI).<\/p>\n<\/li>\n<li>\n<p>Ollama (\u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u044f\u0437\u044b\u043a\u043e\u0432\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439). \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u044f \u0431\u0443\u0434\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c OpenChat. \u041e\u043d\u0430 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0440\u0443\u0441\u0441\u043a\u0438\u0439 \u044f\u0437\u044b\u043a \u0438 \u0434\u0430\u0451\u0442 \u043d\u0435\u043f\u043b\u043e\u0445\u043e\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0434\u043b\u044f \u043c\u043e\u0438\u0445 \u0441\u043a\u0440\u043e\u043c\u043d\u044b\u0445 \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432.<\/p>\n<\/li>\n<li>\n<p>Postman (\u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f).<\/p>\n<\/li>\n<\/ul>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u0430\u0448 Spring \u043f\u0440\u043e\u0435\u043a\u0442. \u041c\u043e\u0436\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f <a href=\"https:\/\/start.spring.io\/\" rel=\"noopener noreferrer nofollow\">Spring Initializr<\/a> \u0438\u043b\u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u0432\u0440\u0443\u0447\u043d\u0443\u044e. \u041d\u0435 \u0437\u0430\u0431\u0443\u0434\u044c\u0442\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u0434\u043b\u044f Spring AI, \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u0443\u044e \u043d\u0438\u0436\u0435<\/p>\n<pre><code class=\"kotlin\">implementation(\"org.springframework.ai:spring-ai-ollama-spring-boot-starter:0.8.1-SNAPSHOT\")<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043d\u0430\u0431\u0440\u043e\u0441\u0430\u0435\u043c \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u044b.<br \/>\u041a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440:<\/p>\n<pre><code class=\"kotlin\">@RestController class ChatController(     private val chatService: ChatService ) {     @PostMapping(\"\/chat\")     fun sendMessage(@RequestBody message: String): String {         return chatService.exchange(message)     } }<\/code><\/pre>\n<p>\u0421\u0435\u0440\u0432\u0438\u0441:<\/p>\n<pre><code class=\"kotlin\">@Service class ChatService(     private val client : OllamaApiClient ) {     private val outputParser = BeanOutputParser(SentimentAnalysisResult::class.java)      fun exchange(message: String): String {         return client.sendMessage(message)     } }<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c OllamaApiClient. \u0412 Spring AI \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f ChatClient \u0434\u043b\u044f Ollama, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0451 \u0434\u043b\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 \u043c\u043e\u0434\u0435\u043b\u044c\u044e.<\/p>\n<pre><code class=\"kotlin\">@Component class OllamaApiClient(     properties: OllamaClientProperties ) {     private final var client = OllamaChatClient(OllamaApi(properties.url))      init {         val options = OllamaOptions.create()         options.model = properties.model     }      fun sendMessage(message: String): String {         return client.call(message)     } }<\/code><\/pre>\n<p>OllamaClientProperties:<\/p>\n<pre><code class=\"kotlin\">@ConfigurationProperties(prefix = \"ai.ollama\") data class OllamaClientProperties(     val url: String,     val model: String )<\/code><\/pre>\n<p>\u0410\u0434\u0440\u0435\u0441 \u0438 \u0438\u043c\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0432 application.yml.<br \/>\u041f\u043e\u0441\u043b\u0435 \u043f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0439 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0441\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u043d\u0430\u0448 \u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442:<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u0427\u0435\u043c \u0434\u043e\u043b\u044c\u0448\u0435 \u044f \u0441\u043c\u043e\u0442\u0440\u044e \u043d\u0430 \u044d\u0442\u043e\u0442 \u043e\u0442\u0432\u0435\u0442, \u0442\u0435\u043c \u043c\u0435\u043d\u044c\u0448\u0435 \u044f \u0445\u043e\u0447\u0443 \u0434\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0435\u043c\u0443 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0441\u0442\u0430\u0442\u044c\u0438<\/figcaption><\/div>\n<\/figure>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043f\u0440\u043e\u0441\u0438\u0442\u044c \u0447\u0430\u0442-\u0431\u043e\u0442\u0430 \u043e\u0446\u0435\u043d\u0438\u0432\u0430\u0442\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 \u043d\u0430\u0448\u0435\u0433\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043a \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u0437\u0430\u043f\u0440\u043e\u0441\u0443. \u0421\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e PromptTemplate:<\/p>\n<pre><code class=\"kotlin\">private val promptTemplate = PromptTemplate(\"\"\"         \u041a\u0430\u043a\u043e\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 \u0443 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u0430:'{text}'?          \u041e\u043d\u043e \u043f\u043e\u0437\u0438\u0442\u0438\u0432\u043d\u043e\u0435, \u043d\u0435\u0433\u0430\u0442\u0438\u0432\u043d\u043e\u0435 \u0438\u043b\u0438 \u043d\u0435\u0439\u0442\u0440\u0430\u043b\u044c\u043d\u043e\u0435?          \u0423\u043a\u0430\u0436\u0438 \u0441\u0442\u0435\u043f\u0435\u043d\u044c \u0443\u0432\u0435\u0440\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0447\u0438\u0441\u043b\u0430 \u043e\u0442 0.0 \u0434\u043e 1.0.\"     \"\"\") fun exchange(message: String): String {         val prompt = promptTemplateRus.create(mapOf(\"text\" to message))         val generation = client.sendMessage(prompt)         return generation.output.content.toString()     }<\/code><\/pre>\n<p>\u0412 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043c\u043e\u0434\u0435\u043b\u0438, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435, \u0448\u0430\u0431\u043b\u043e\u043d \u043c\u043e\u0436\u043d\u043e \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u044f \u0438\u0437 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c\u044b\u0445 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432. <br \/>\u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 PromptTemplate \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043e\u0431\u044a\u0435\u043a\u0442 \u0442\u0438\u043f\u0430 Prompt, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0438 \u043c\u0435\u0442\u043e\u0434 sendMessage:<\/p>\n<pre><code class=\"kotlin\">fun sendMessage(prompt: Prompt): Generation {         val response = client.call(prompt)         return response.result     }<\/code><\/pre>\n<p>\u041f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441 \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0442\u0430\u043a\u043e\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043d\u0435\u043f\u043b\u043e\u0445\u043e\u0439, \u043d\u043e \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043b\u0443\u0447\u0448\u0435. \u0421\u0435\u0439\u0447\u0430\u0441 \u043d\u0430\u0448\u0435 API \u043e\u0442\u0434\u0430\u0451\u0442 \u043e\u0442\u0432\u0435\u0442 \u0432 \u0432\u0438\u0434\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u0430. \u0422\u0430\u043a\u043e\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u043f\u0430\u0440\u0441\u0438\u0442\u044c, \u043f\u043b\u044e\u0441, \u043c\u043e\u0434\u0435\u043b\u044c \u043c\u043e\u0436\u0435\u0442 \u043f\u0435\u0440\u0435\u0444\u0440\u0430\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u044d\u0442\u043e \u0435\u0449\u0451 \u043d\u0435\u0443\u0434\u043e\u0431\u043d\u0435\u0435 \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043c \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0432\u044b\u0432\u043e\u0434\u0438\u043c\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445. \u041c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u0443\u0435\u043c \u043d\u0430\u0448 \u043a\u043e\u0434 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c data \u043a\u043b\u0430\u0441\u0441 \u0434\u043b\u044f \u043c\u0430\u043f\u043f\u0438\u043d\u0433\u0430 \u0434\u0430\u043d\u043d\u044b\u0445:<\/p>\n<pre><code class=\"kotlin\">data class SentimentAnalysisResult(     val text: String = \"\",     val sentiment: String = \"\",     val confidence: String = \"\" )<\/code><\/pre>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043c Output Parser \u0447\u0442\u043e\u0431\u044b \u0441\u0440\u0430\u0437\u0443 &#171;\u0443\u043f\u0430\u043a\u043e\u0432\u0430\u0442\u044c&#187; \u043e\u0442\u0432\u0435\u0442 \u0432 data \u043a\u043b\u0430\u0441\u0441:<\/p>\n<pre><code class=\"kotlin\"> private val promptTemplate = PromptTemplate(\"\"\"         \u041a\u0430\u043a\u043e\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 \u0443 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u0430:'{text}'?          \u041e\u043d\u043e \u043f\u043e\u0437\u0438\u0442\u0438\u0432\u043d\u043e\u0435, \u043d\u0435\u0433\u0430\u0442\u0438\u0432\u043d\u043e\u0435 \u0438\u043b\u0438 \u043d\u0435\u0439\u0442\u0440\u0430\u043b\u044c\u043d\u043e\u0435?          \u0423\u043a\u0430\u0436\u0438 \u0441\u0442\u0435\u043f\u0435\u043d\u044c \u0443\u0432\u0435\u0440\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0447\u0438\u0441\u043b\u0430 \u043e\u0442 0.0 \u0434\u043e 1.0.{format}\"     \"\"\")     private val outputParser = BeanOutputParser(SentimentAnalysisResult::class.java)      fun exchange(message: String): SentimentAnalysisResult {         val prompt = promptTemplate.create(mapOf(\"text\" to message, \"format\" to outputParser.format))         val answer = client.sendMessage(prompt)         return outputParser.parse(answer.output.content)     }<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0448 \u0437\u0430\u043f\u0440\u043e\u0441 \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0432\u0438\u0434:<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u0423\u0432\u0435\u0440\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0432 \u043e\u0442\u0432\u0435\u0442\u0435 \u0432\u0441\u0451 \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u0430\u0435\u0442<\/figcaption><\/div>\n<\/figure>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c, \u0447\u0442\u043e \u043d\u0430\u0448\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435:<\/p>\n<figure class=\"\">\n<div><figcaption>\u041d\u0435\u0439\u0442\u0440\u0430\u043b\u044c\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441<\/figcaption><\/div>\n<\/figure>\n<figure class=\"\">\n<div><figcaption>\u041f\u043e\u0437\u0438\u0442\u0438\u0432\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441<\/figcaption><\/div>\n<\/figure>\n<figure class=\"\">\n<div><figcaption>\u041d\u0435\u0433\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441<\/figcaption><\/div>\n<\/figure>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f\u043c! \u0414\u0430\u043b\u0435\u0435, \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c, \u043c\u0435\u043d\u044f\u0442\u044c API \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0438\u043b\u0438 \u0448\u0430\u0431\u043b\u043e\u043d\u044b \u0434\u043b\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432.<\/p>\n<p>\u0412 \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u044e\u0449\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u0445\u043e\u0442\u0435\u043b \u0431\u044b \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u0440\u043e \u0442\u044e\u043d\u0438\u043d\u0433 \u043c\u043e\u0434\u0435\u043b\u0438. OllamaChatClient \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0448\u0438\u0440\u043e\u043a\u0438\u0439 \u0441\u043f\u0435\u043a\u0442\u0440 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043c\u043e\u0434\u0435\u043b\u0438, \u0432\u043e\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0437 \u043d\u0438\u0445:<\/p>\n<ul>\n<li>\n<p><strong>temperature<\/strong>. \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043a\u0440\u0435\u0430\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438 \u043c\u043e\u0434\u0435\u043b\u0438. \u0427\u0435\u043c \u0432\u044b\u0448\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0442\u0435\u043c \u043e\u0442\u0432\u0435\u0442\u044b \u0431\u043e\u043b\u0435\u0435 \u043d\u0435\u043e\u0431\u044b\u0447\u043d\u044b\u0435. <\/p>\n<\/li>\n<li>\n<p><strong>frequencyPenalty<\/strong>. &#171;\u041d\u0430\u043a\u0430\u0437\u0430\u043d\u0438\u0435&#187; \u043c\u043e\u0434\u0435\u043b\u0438 \u0437\u0430 \u043f\u043e\u0432\u0442\u043e\u0440\u0435\u043d\u0438\u044f. \u041c\u0435\u043d\u044c\u0448\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u2014 \u0431\u043e\u043b\u044c\u0448\u0435 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0445 \u0441\u043b\u043e\u0432\u0435\u0441\u043d\u044b\u0445 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439 \u0438 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439, \u043c\u0435\u043d\u044c\u0448\u0435 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u043b\u043e\u0432. <\/p>\n<\/li>\n<li>\n<p><strong>presencePenalty<\/strong>. &#171;\u041d\u0430\u043a\u0430\u0437\u0430\u043d\u0438\u0435&#187; \u043c\u043e\u0434\u0435\u043b\u0438 \u0437\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0434\u043d\u0438\u0445 \u0438 \u0442\u0435\u0445 \u0436\u0435 \u0442\u043e\u043a\u0435\u043d\u043e\u0432 \u0432 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u043c \u0442\u0435\u043a\u0441\u0442\u0435. \u0427\u0435\u043c \u043c\u0435\u043d\u044c\u0448\u0435 \u0447\u0438\u0441\u043b\u043e, \u0442\u0435\u043c \u0447\u0430\u0449\u0435 \u043c\u043e\u0433\u0443\u0442 \u043f\u043e\u043f\u0430\u0434\u0430\u0442\u044c\u0441\u044f \u043e\u0434\u043d\u0438 \u0438 \u0442\u0435 \u0436\u0435 \u0441\u043b\u043e\u0432\u0430. <\/p>\n<\/li>\n<li>\n<p><strong>topK<\/strong>. \u0423 \u043c\u043e\u0434\u0435\u043b\u0438 \u0435\u0441\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u0442\u0435\u043a\u0441\u0442. \u0414\u0430\u043d\u043d\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u0442\u043e\u043a\u0435\u043d\u043e\u0432 \u0434\u043b\u044f \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u044f. \u041c\u0435\u043d\u044c\u0448\u0435 \u0447\u0438\u0441\u043b\u043e \u2014 \u043c\u0435\u043d\u044c\u0448\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u043e\u043f\u0446\u0438\u0439.<\/p>\n<\/li>\n<li>\n<p><strong>topP<\/strong>. \u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 \u043a\u0443\u043c\u0443\u043b\u044f\u0442\u0438\u0432\u043d\u043e\u0439 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438<\/p>\n<\/li>\n<\/ul>\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-369475","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/369475","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=369475"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/369475\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=369475"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=369475"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=369475"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}