{"id":454156,"date":"2025-04-01T16:43:34","date_gmt":"2025-04-01T16:43:34","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=454156"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=454156","title":{"rendered":"<span>\u0423\u043c\u043d\u044b\u0439 \u043f\u043e\u0438\u0441\u043a \u043f\u043e API, \u0438\u043b\u0438 NLP \u043f\u0440\u043e\u0442\u0438\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u043e\u0438\u0441\u043a\u0430<\/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\/f19\/ebe\/0db\/f19ebe0dba68f661751070bec6de4bd2.png\" width=\"1078\" height=\"878\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f19\/ebe\/0db\/f19ebe0dba68f661751070bec6de4bd2.png\"\/><\/figure>\n<p>\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442! \u042d\u0442\u043e \u0418\u0433\u043e\u0440\u044c \u0413\u0443\u0441\u0442\u043e\u043c\u044f\u0441\u043e\u0432, CTO \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 \u0442\u0435\u0445\u043d\u043e\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b \u0432 \u041c\u0422\u0421, \u0438 \u041d\u0438\u043a\u0438\u0442\u0430 \u0411\u043e\u044f\u043d\u0434\u0438\u043d, \u0432\u0435\u0434\u0443\u0449\u0438\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0432 \u0442\u043e\u043c \u0436\u0435 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0435. (\u0414\u0430, \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u0442\u0435\u043a\u0441\u0442 \u0432\u043c\u0435\u0441\u0442\u0435.) \u0420\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043e \u043f\u043e\u0438\u0441\u043a\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 API \u0434\u043b\u044f \u0418\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b \u041c\u0422\u0421. <\/p>\n<p>\u041d\u0430\u0448 \u043a\u043e\u043b\u043b\u0435\u0433\u0430 \u0410\u043b\u0435\u043a\u0441\u0430\u043d\u0434\u0440 \u0411\u0430\u0440\u0434\u0430\u0448 \u043a\u0440\u0443\u0442\u043e \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043b, <a href=\"https:\/\/habr.com\/ru\/companies\/ru_mts\/articles\/832932\/\">\u043a\u0430\u043a \u043c\u044b \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0418\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b<\/a>. \u0422\u0430\u043a \u0432\u043e\u0442: \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u043d\u0430\u0441\u0442\u043e\u043b\u044c\u043a\u043e \u0445\u043e\u0440\u043e\u0448\u043e, \u0447\u0442\u043e \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430.<\/p>\n<p>\u0412 \u044d\u043a\u043e\u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u041c\u0422\u0421 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432 \u2014 \u043e\u0442 \u043f\u0440\u043e\u043a\u0430\u0442\u0430 \u0441\u0430\u043c\u043e\u043a\u0430\u0442\u043e\u0432 \u0434\u043e \u0432\u044b\u0441\u043e\u043a\u043e\u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 <a href=\"https:\/\/theplatform.ru\/\">The Platform<\/a>. \u0421\u0442\u043e\u0438\u043b\u043e \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435 \u0432\u0441\u0442\u0430\u0442\u044c \u043d\u0430 \u043d\u043e\u0433\u0438, \u043a\u0430\u043a \u043d\u0430 \u043d\u0435\u0439 \u0440\u0435\u0437\u043a\u043e \u0432\u044b\u0440\u043e\u0441\u043b\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0439 API. <\/p>\n<p>\u0422\u0430\u043a \u043f\u0435\u0440\u0435\u0434 \u043d\u0430\u043c\u0438 \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u043b\u0430\u0441\u044c \u0434\u0432\u043e\u0439\u043d\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430: \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u044b \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f (HTTPS, gRPC, GraphQL \u0438 \u043f\u0440\u043e\u0447\u0438\u0435), \u043d\u043e \u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u043e\u0438\u0441\u043a \u0434\u0430\u043d\u043d\u044b\u0445 API. \u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u2014 \u043f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c.<\/p>\n<h2>\u0413\u0438\u043f\u043e\u0442\u0435\u0437\u044b \u0438 \u043f\u0435\u0440\u0432\u044b\u0435 \u043f\u043e\u043f\u044b\u0442\u043a\u0438<\/h2>\n<p>\u041a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u0432 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0438\u0437\u0430\u0446\u0438\u044e \u0438 \u043f\u043e\u0438\u0441\u043a \u043f\u043e \u043d\u0435\u0439. \u041d\u043e \u043d\u0430\u043c \u044d\u0442\u043e\u0442 \u043f\u043e\u0434\u0445\u043e\u0434 \u043d\u0435 \u043f\u043e\u043c\u043e\u0433. <\/p>\n<p>\u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u0440\u043e\u0433\u0430 \u043f\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0443 API \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0438\u0437\u0430\u0446\u0438\u044f \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043d\u0435\u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u043e\u0439 \u0434\u043b\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432. \u0414\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0435\u0435 \u0432\u044b\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043a\u0430\u043d\u043e\u043d\u0438\u0447\u043d\u044b\u043c, \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u043c \u043f\u0443\u0442\u0435\u043c \u2014 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0434\u0430\u043b\u0435\u043a\u043e \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0437\u043d\u0430\u0435\u0442 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0441\u0432\u043e\u0435\u0439 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438. \u0415\u0433\u043e \u0446\u0435\u043b\u044c \u043f\u0440\u043e\u0441\u0442\u0430: \u043d\u0430\u0439\u0442\u0438 \u043d\u0443\u0436\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0438 \u043d\u0430\u0447\u0430\u0442\u044c \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c. \u0427\u0435\u043c \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u0442\u0435\u043c \u0443\u0434\u043e\u0431\u043d\u0435\u0435 \u0418\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u0430\u044f \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430, \u0432\u043e\u0442 \u0438 \u0432\u0441\u0451.<\/p>\n<p>\u041e\u043a, \u0440\u043e\u0434\u0438\u043b\u0430\u0441\u044c \u0432\u0442\u043e\u0440\u0430\u044f \u0433\u0438\u043f\u043e\u0442\u0435\u0437\u0430. \u0421\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0445\u043e\u0440\u043e\u0448\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u043f\u043e\u043b\u044f \u0434\u043b\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u041f\u043e\u0447\u0435\u043c\u0443 \u0431\u044b \u043d\u0435 \u043f\u0440\u0438\u043a\u0440\u0443\u0442\u0438\u0442\u044c \u043f\u043e\u043b\u043d\u043e\u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0439 \u043f\u043e\u0438\u0441\u043a? <\/p>\n<p>\u041c\u044b \u0432\u0437\u044f\u043b\u0438 open-source \u0434\u0432\u0438\u0436\u043e\u043a \u0438 \u043f\u0440\u043e\u0438\u043d\u0434\u0435\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u043d\u0430\u0448\u0438 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438. \u0421\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0438\u0441\u044c \u0441 \u0434\u0440\u0443\u0433\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439. \u041c\u043d\u043e\u0433\u0438\u0435 API \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043b\u0438\u0441\u044c \u0434\u0430\u0432\u043d\u043e \u0438 \u0437\u0430\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u043f\u043b\u043e\u0445\u043e. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u043e\u043b\u043d\u043e\u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0439 \u043f\u043e\u0438\u0441\u043a \u0431\u0435\u0441\u0441\u0438\u043b\u0435\u043d, \u0435\u0441\u043b\u0438 \u043d\u0435 \u0432\u044b\u0447\u0438\u0449\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435. \u0414\u0435\u043b\u043e \u043d\u0443\u0436\u043d\u043e\u0435, \u043d\u043e \u0442\u043e\u0433\u0434\u0430 \u043d\u0430\u043c \u043d\u0435 \u0445\u0432\u0430\u0442\u0438\u043b\u043e \u0431\u044b \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u0442\u044c \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0443. <\/p>\n<p>\u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u044f\u0437\u044b\u043a \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0445 API \u0431\u044b\u0432\u0430\u0435\u0442 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u0435\u043d \u0438 \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d \u043a \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432\u043e\u043c\u0443 \u0438\u043b\u0438 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u043c\u0443 \u0434\u043e\u043c\u0435\u043d\u0443. \u041f\u043e\u0440\u043e\u0439 \u0441\u043b\u043e\u0436\u043d\u043e\u0432\u0430\u0442\u043e \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441.<\/p>\n<p>\u0412 \u0442\u0440\u0435\u0442\u0438\u0439 \u0440\u0430\u0437 \u0437\u0430\u043a\u0438\u043d\u0443\u043b\u0438 \u043c\u044b \u043d\u0435\u0432\u043e\u0434: \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b\u0438 \u043c\u043e\u0449\u044c \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u044f\u0437\u044b\u043a\u043e\u0432\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 (LLM) \u0438 \u0441\u043c\u0435\u0436\u043d\u044b\u0445 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0439. \u0418 \u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u043f\u043e\u0439\u043c\u0430\u043b\u0438 \u0437\u043e\u043b\u043e\u0442\u0443\u044e \u0440\u044b\u0431\u043a\u0443. <\/p>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e \u0438\u0441\u043a\u0430\u0442\u044c \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0431\u044b\u043b\u043e \u043d\u0435\u043f\u0440\u043e\u0441\u0442\u043e. \u041f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u0430\u043a\u0435\u0442\u043e\u0432, \u043e\u0431\u043a\u0430\u0442\u0430\u0442\u044c \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435, \u043f\u0440\u043e\u0432\u0435\u0441\u0442\u0438 \u0441\u0435\u0440\u0438\u044e \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0439\u2026 \u043d\u043e \u043e\u0431\u043e \u0432\u0441\u0435\u043c \u043f\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0443.<\/p>\n<h2>\u041f\u0435\u0440\u0432\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u0438 RetrivalQA<\/h2>\n<p>\u0417\u0430\u0434\u0430\u0447\u0430 \u0431\u044b\u043b\u0430 \u0432 \u043d\u043e\u0432\u0438\u043d\u043a\u0443, \u0438 \u043c\u044b \u0438\u0441\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b\u0438 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u043f\u043e\u0438\u0441\u043a\u0430. \u041d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435-\u0442\u043e \u043c\u044b \u0441\u0440\u0430\u0437\u0443 \u0432\u0437\u044f\u043b\u0438 \u0432\u0435\u0440\u043d\u043e\u0435: \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 <a href=\"https:\/\/www.langchain.com\/\">LangChain<\/a>. \u041d\u043e \u0432 API \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u044e\u0442\u0441\u044f \u043a\u043e\u043d\u0444\u0438\u0434\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435. \u0417\u043d\u0430\u0447\u0438\u0442, \u0432\u043d\u0435\u0448\u043d\u044f\u044f LLM \u043d\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u043b\u0430, \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u044f\u044f.<\/p>\n<p>\u041c\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0438 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 class, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u0442\u044c LLM \u0441 LangChain. \u041e\u0441\u0442\u0430\u0432\u0430\u043b\u043e\u0441\u044c \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u0440\u0435\u043c\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u0434\u043e \u0441\u0435\u043a\u0443\u043d\u0434\u044b \u0438\u043b\u0438 \u043d\u0438\u0436\u0435 \u2014 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043d\u0435 \u0445\u043e\u0447\u0435\u0442 \u0436\u0434\u0430\u0442\u044c. \u0418 \u043c\u044b\u2026 \u043d\u0435 \u0441\u043f\u0440\u0430\u0432\u0438\u043b\u0438\u0441\u044c, \u0442\u0430\u043a \u043a\u0430\u043a \u043b\u044e\u0431\u043e\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u0432 LLM \u043f\u043e API \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u043d\u0435 \u043c\u0435\u043d\u0435\u0435 \u0447\u0435\u043c \u0437\u0430 2 \u0441\u0435\u043a\u0443\u043d\u0434\u044b. \u0423\u0432\u044b(<\/p>\n<p>\u0412\u043e\u0442 \u043d\u0430\u0448 class \u0434\u043b\u044f \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f LLM:<\/p>\n<pre><code class=\"python\">class CustomLLM(LLM):     def _call(self, prompt, stop=None):         url = 'your_url'         headers = {             \"Authorization\": f\"Bearer dummy\",              \"Content-Type\": \"application\/json\"         }              payload = {             \"model\": \"LLM_MODEL\",             \"messages\": [{\"role\": \"user\", \"content\": prompt}],             \"temperature\": 0.2         }          response = requests.post(url, headers=headers, json=payload)         if response.status_code == 200:             return response.json()['choices'][0]['message']['content']         else:             logger.error(f\"Request failed with status code {response.status_code}\")             return {\"error\": f\"Request failed with status code {response.status_code}\"}          @property     def _identifying_params(self):         return {\"model\": \"LLM_MODEL\"}          @property     def _llm_type(self):         return \"custom\"   custom_llm = CustomLLM()  qa_chain = RetrievalQA.from_chain_type(llm=custom_llm,                                    chain_type=\"stuff\",                                    retriever=retriever,                                    return_source_documents=True)<\/code><\/pre>\n<h2>\u0422\u043e\u043a\u0435\u043d\u0438\u0437\u0430\u0446\u0438\u044f <\/h2>\n<p>\u0415\u0449\u0435 \u043c\u044b \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0438\u0441\u044c \u0441 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439 \u0442\u043e\u043a\u0435\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445. \u0412 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043d\u0430 \u0440\u0443\u0441\u0441\u043a\u043e\u043c \u044f\u0437\u044b\u043a\u0435. \u0410 \u0432\u0441\u0435 API \u043d\u0430 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u043e\u043c. \u041a\u0430\u043a\u043e\u0439 \u0436\u0435 \u043c\u043e\u0434\u0435\u043b\u044c\u044e \u0434\u0435\u043b\u0430\u0442\u044c \u0432\u0435\u043a\u0442\u043e\u0440\u044b?<\/p>\n<p>\u041f\u0440\u043e\u0431\u043e\u0432\u0430\u043b\u0438 \u0440\u0443\u0441\u0441\u043a\u0438\u0435 <a href=\"https:\/\/huggingface.co\/cointegrated\/rubert-tiny2\">rubert<\/a> \u0438 <a href=\"https:\/\/huggingface.co\/DiTy\/bi-encoder-russian-msmarco\">bi-encoder<\/a>. \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u0441\u043f\u0443\u0441\u0442\u044f \u0434\u043e\u043b\u0433\u0438\u0435 \u0447\u0430\u0441\u044b \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \u0438 \u043f\u043e\u043f\u044b\u0442\u043e\u043a \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c \u0441\u043a\u043e\u0440 \u043c\u044b \u043a\u043e\u043d\u0441\u0442\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043b\u0438, \u0447\u0442\u043e \u044d\u0442\u0438 \u043c\u043e\u0434\u0435\u043b\u0438 \u043d\u0435 \u043f\u043e\u0434\u043e\u0448\u043b\u0438.<\/p>\n<p>\u0422\u043e\u0433\u0434\u0430 \u043c\u044b \u0432\u0435\u0440\u043d\u0443\u043b\u0438\u0441\u044c \u043a \u0441\u0430\u043c\u043e\u043c\u0443 \u043f\u0440\u043e\u0441\u0442\u043e\u043c\u0443 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0443 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043b\u0435\u0433\u043a\u043e\u0439 \u0430\u043d\u0433\u043b\u043e\u044f\u0437\u044b\u0447\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438:<\/p>\n<pre><code class=\"python\">embeddings = HuggingFaceEmbeddings(model_name=\"sentence-transformers\/all-MiniLM-L6-v2\")<\/code><\/pre>\n<h2>\u0412\u044b\u0431\u043e\u0440 \u0431\u0430\u0437\u044b \u0434\u043b\u044f \u0434\u0430\u043d\u043d\u044b\u0445<\/h2>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u043f\u0443\u0441\u0442\u0438\u043c\u0441\u044f \u043d\u0430 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0433\u0434\u0435 \u0436\u0435 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043d\u0430\u0448\u0438 \u044d\u043c\u0431\u0435\u0434\u0434\u0438\u043d\u0433\u0438. \u041d\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u044b\u0435 \u0431\u0430\u0437\u044b: <a href=\"https:\/\/qdrant.tech\/\">Qdrant<\/a>, <a href=\"https:\/\/www.trychroma.com\/\">ChromaDB<\/a> \u0438 <a href=\"https:\/\/weaviate.io\/\">Weaviate<\/a>.<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"234\" width=\"234\">\n<p align=\"left\"><strong>\u0410\u0441\u043f\u0435\u043a\u0442<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"156\" width=\"156\">\n<p align=\"left\"><strong>Qdrant<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\"><strong>ChromaDB<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\"><strong>Weaviate<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"234\" width=\"234\">\n<p align=\"left\"><strong>\u0422\u0438\u043f \u0440\u0435\u0448\u0435\u043d\u0438\u044f<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"156\" width=\"156\">\n<p align=\"left\">\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0435<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0421 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0421 \u0433\u0440\u0430\u0444\u043e\u0432\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0438 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u043c\u0438<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"234\" width=\"234\">\n<p align=\"left\"><strong>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u043c\u043e\u0434\u0435\u043b\u0435\u0439<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"156\" width=\"156\">\n<p align=\"left\">\u0411\u0435\u0437 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0432\u0435\u043a\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438, \u043d\u043e \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0441 \u0432\u043d\u0435\u0448\u043d\u0438\u043c\u0438<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0421 \u043c\u043e\u0434\u0435\u043b\u044f\u043c\u0438 \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432: GPT \u0438 Sentence-BERT<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0418\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0441 \u043c\u043e\u0434\u0435\u043b\u044f\u043c\u0438 BERT, OpenAI \u0438 \u0434\u0440\u0443\u0433\u0438\u043c\u0438<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"234\" width=\"234\">\n<p align=\"left\"><strong>\u041f\u043e\u0438\u0441\u043a<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"156\" width=\"156\">\n<p align=\"left\">HNSW \u0434\u043b\u044f \u0431\u044b\u0441\u0442\u0440\u043e\u0433\u043e \u043f\u043e\u0438\u0441\u043a\u0430 \u043f\u043e \u0441\u0445\u043e\u0436\u0435\u0441\u0442\u0438<\/p>\n<\/td>\n<td>\n<p align=\"left\">HNSW \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u043f\u043e \u0441\u0445\u043e\u0436\u0435\u0441\u0442\u0438<\/p>\n<\/td>\n<td>\n<p align=\"left\">HNSW \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u043f\u043e \u0441\u0445\u043e\u0436\u0435\u0441\u0442\u0438 \u0438 \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u0438<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"234\" width=\"234\">\n<p align=\"left\"><strong>\u0413\u0438\u0431\u043a\u043e\u0441\u0442\u044c<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"156\" width=\"156\">\n<p align=\"left\">\u0412\u044b\u0441\u043e\u043a\u0430\u044f, \u043d\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0432\u043d\u0435\u0448\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0421\u0440\u0435\u0434\u043d\u044f\u044f, \u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u041e\u0447\u0435\u043d\u044c \u0432\u044b\u0441\u043e\u043a\u0430\u044f, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0438 \u0433\u0440\u0430\u0444\u044b<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"234\" width=\"234\">\n<p align=\"left\"><strong>\u041c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u0435\u043c\u043e\u0441\u0442\u044c<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"156\" width=\"156\">\n<p align=\"left\">\u041e\u0442\u043b\u0438\u0447\u043d\u0430\u044f \u0434\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0425\u043e\u0440\u043e\u0448\u0430\u044f<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u041e\u0442\u043b\u0438\u0447\u043d\u0430\u044f, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"234\" width=\"234\">\n<p align=\"left\"><strong>\u0421\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"156\" width=\"156\">\n<p align=\"left\">\u041f\u0440\u043e\u0441\u0442\u0430\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430, \u043d\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u0438<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u041d\u0438\u0437\u043a\u0430\u044f, \u043d\u043e \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0435\u0442 \u0433\u0438\u0431\u043a\u043e\u0441\u0442\u0438<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0421\u043b\u043e\u0436\u043d\u0430\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430, \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0435\u043c\u043a\u0430\u044f, \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0441\u0435\u0440\u0438\u0438 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432 \u043c\u044b \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0438\u0441\u044c \u043d\u0430 \u043d\u0430 Weaviate, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u044d\u0442\u0430 \u0431\u0430\u0437\u0430 \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u043e \u0441\u0435\u0431\u044f \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0430 \u0432 \u0440\u0435\u0448\u0435\u043d\u0438\u0438 \u0437\u0430\u0434\u0430\u0447\u0430 QA \u043f\u043e \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430\u043c Confluence. \u0421\u0435\u0439\u0447\u0430\u0441 \u0432 \u043d\u0435\u043c, \u043f\u043e\u043c\u0438\u043c\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u0430, \u043c\u044b \u0445\u0440\u0430\u043d\u0438\u043c \u0432\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u043c \u043f\u043e \u043d\u0438\u043c \u043f\u043e\u0438\u0441\u043a. \u0422\u0430\u043a\u0436\u0435 Weaviate \u0434\u0430\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043a\u0430\u0441\u0442\u043e\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u043e\u0438\u0441\u043a\u0430, \u043d\u043e \u043e\u0431 \u044d\u0442\u043e\u043c \u043a\u0430\u043a-\u043d\u0438\u0431\u0443\u0434\u044c \u0432 \u0434\u0440\u0443\u0433\u043e\u0439 \u0440\u0430\u0437.<\/p>\n<h2>Ensemble Retrivers \u0438 \u043d\u0430\u0448\u0435 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435<\/h2>\n<p>\u041c\u044b \u0443\u0448\u043b\u0438 \u0432 FAISS(\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 MongoDB): \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c, \u0432\u044b\u0434\u0430\u0435\u0442 \u043d\u0443\u0436\u043d\u044b\u0435 \u043c\u0435\u0442\u0440\u0438\u043a\u0438. \u0412\u043f\u043e\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0438 \u0432\u0437\u044f\u043b\u0438 \u0442\u0435\u0445\u043d\u0438\u043a\u0443 \u0430\u043d\u0441\u0430\u043c\u0431\u043b\u0435\u0432\u043e\u0433\u043e \u0440\u0435\u0442\u0440\u0438\u0432\u0435\u0440\u0430 \u0438\u0437 FAISS \u0438 BM25, \u0447\u0442\u043e \u043d\u0430\u0441 \u0438 \u0441\u043f\u0430\u0441\u043b\u043e. \u0412\u043e\u0442 \u0447\u0430\u0441\u0442\u044c \u043a\u043e\u0434\u0430:<\/p>\n<pre><code class=\"python\">from langchain.retrievers import EnsembleRetriever from langchain_community.retrievers import BM25Retriever from langchain_community.vectorstores import FAISS from langchain_openai import OpenAIEmbeddings  doc_list_1 = [     \"I like apples\",     \"I like oranges\",     \"Apples and oranges are fruits\", ]  # initialize the bm25 retriever and faiss retriever bm25_retriever = BM25Retriever.from_texts(     doc_list_1, metadatas=[{\"source\": 1}] * len(doc_list_1) ) bm25_retriever.k = 2  doc_list_2 = [     \"You like apples\",     \"You like oranges\", ]  embedding = OpenAIEmbeddings() faiss_vectorstore = FAISS.from_texts(     doc_list_2, embedding, metadatas=[{\"source\": 2}] * len(doc_list_2) ) faiss_retriever = faiss_vectorstore.as_retriever(search_kwargs={\"k\": 2})  # initialize the ensemble retriever ensemble_retriever = EnsembleRetriever(     retrievers=[bm25_retriever, faiss_retriever], weights=[0.5, 0.5] )<\/code><\/pre>\n<h2>\u0414\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438<\/h2>\n<p>\u0423 \u043b\u044e\u0431\u043e\u0433\u043e \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043f\u043e\u0438\u0441\u043a\u0430 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c: \u043e\u0440\u0444\u043e\u0433\u0440\u0430\u0444\u0438\u044f \u0438 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u043b\u043e\u0432, \u0440\u0430\u0437\u043d\u044b\u0435 \u044f\u0437\u044b\u043a\u0438 \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435. \u0410 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u0441\u0435 \u0435\u0449\u0435 \u0434\u043e\u043b\u0436\u0435\u043d \u0432\u044b\u0445\u043e\u0434\u0438\u0442\u044c \u043d\u0435 \u0431\u043e\u043b\u0435\u0435 \u0447\u0435\u043c \u0437\u0430 \u0441\u0435\u043a\u0443\u043d\u0434\u0443. <\/p>\n<p>\u041d\u043e \u043c\u044b \u0443\u0432\u0435\u0440\u0435\u043d\u044b, \u0447\u0442\u043e \u0441\u043f\u0440\u0430\u0432\u0438\u043c\u0441\u044f, \u0432\u0435\u0434\u044c \u043d\u0430\u0448 \u043f\u043e\u0434\u0445\u043e\u0434 \u043f\u0435\u0440\u0441\u043f\u0435\u043a\u0442\u0438\u0432\u0435\u043d. \u041c\u044b \u043c\u043e\u0436\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043d\u0430 \u0418\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u0443\u044e \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0443 \u043d\u043e\u0432\u044b\u0435 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438 \u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u2014 \u0438 \u044d\u0442\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f.<\/p>\n<p>\u041d\u0430\u0434\u0435\u0435\u043c\u0441\u044f, \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b \u0431\u044b\u043b \u043f\u043e\u043b\u0435\u0437\u0435\u043d \u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0435\u043d. \u0414\u043e \u0441\u043a\u043e\u0440\u044b\u0445 \u0432\u0441\u0442\u0440\u0435\u0447 \u043d\u0430 \u043f\u043e\u043b\u0435 LLM.<\/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\/892654\/\"> https:\/\/habr.com\/ru\/articles\/892654\/<\/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>\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442! \u042d\u0442\u043e \u0418\u0433\u043e\u0440\u044c \u0413\u0443\u0441\u0442\u043e\u043c\u044f\u0441\u043e\u0432, CTO \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 \u0442\u0435\u0445\u043d\u043e\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b \u0432 \u041c\u0422\u0421, \u0438 \u041d\u0438\u043a\u0438\u0442\u0430 \u0411\u043e\u044f\u043d\u0434\u0438\u043d, \u0432\u0435\u0434\u0443\u0449\u0438\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0432 \u0442\u043e\u043c \u0436\u0435 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0435. (\u0414\u0430, \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u0442\u0435\u043a\u0441\u0442 \u0432\u043c\u0435\u0441\u0442\u0435.) \u0420\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043e \u043f\u043e\u0438\u0441\u043a\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 API \u0434\u043b\u044f \u0418\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b \u041c\u0422\u0421. <\/p>\n<p>\u041d\u0430\u0448 \u043a\u043e\u043b\u043b\u0435\u0433\u0430 \u0410\u043b\u0435\u043a\u0441\u0430\u043d\u0434\u0440 \u0411\u0430\u0440\u0434\u0430\u0448 \u043a\u0440\u0443\u0442\u043e \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043b, <a href=\"https:\/\/habr.com\/ru\/companies\/ru_mts\/articles\/832932\/\">\u043a\u0430\u043a \u043c\u044b \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0418\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b<\/a>. \u0422\u0430\u043a \u0432\u043e\u0442: \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u043d\u0430\u0441\u0442\u043e\u043b\u044c\u043a\u043e \u0445\u043e\u0440\u043e\u0448\u043e, \u0447\u0442\u043e \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430.<\/p>\n<p>\u0412 \u044d\u043a\u043e\u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u041c\u0422\u0421 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432 \u2014 \u043e\u0442 \u043f\u0440\u043e\u043a\u0430\u0442\u0430 \u0441\u0430\u043c\u043e\u043a\u0430\u0442\u043e\u0432 \u0434\u043e \u0432\u044b\u0441\u043e\u043a\u043e\u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 <a href=\"https:\/\/theplatform.ru\/\">The Platform<\/a>. \u0421\u0442\u043e\u0438\u043b\u043e \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435 \u0432\u0441\u0442\u0430\u0442\u044c \u043d\u0430 \u043d\u043e\u0433\u0438, \u043a\u0430\u043a \u043d\u0430 \u043d\u0435\u0439 \u0440\u0435\u0437\u043a\u043e \u0432\u044b\u0440\u043e\u0441\u043b\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0439 API. <\/p>\n<p>\u0422\u0430\u043a \u043f\u0435\u0440\u0435\u0434 \u043d\u0430\u043c\u0438 \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u043b\u0430\u0441\u044c \u0434\u0432\u043e\u0439\u043d\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430: \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u044b \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f (HTTPS, gRPC, GraphQL \u0438 \u043f\u0440\u043e\u0447\u0438\u0435), \u043d\u043e \u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u043e\u0438\u0441\u043a \u0434\u0430\u043d\u043d\u044b\u0445 API. \u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u2014 \u043f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c.<\/p>\n<h2>\u0413\u0438\u043f\u043e\u0442\u0435\u0437\u044b \u0438 \u043f\u0435\u0440\u0432\u044b\u0435 \u043f\u043e\u043f\u044b\u0442\u043a\u0438<\/h2>\n<p>\u041a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u0432 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0438\u0437\u0430\u0446\u0438\u044e \u0438 \u043f\u043e\u0438\u0441\u043a \u043f\u043e \u043d\u0435\u0439. \u041d\u043e \u043d\u0430\u043c \u044d\u0442\u043e\u0442 \u043f\u043e\u0434\u0445\u043e\u0434 \u043d\u0435 \u043f\u043e\u043c\u043e\u0433. <\/p>\n<p>\u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u0440\u043e\u0433\u0430 \u043f\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0443 API \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0438\u0437\u0430\u0446\u0438\u044f \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043d\u0435\u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u043e\u0439 \u0434\u043b\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432. \u0414\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0435\u0435 \u0432\u044b\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043a\u0430\u043d\u043e\u043d\u0438\u0447\u043d\u044b\u043c, \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u043c \u043f\u0443\u0442\u0435\u043c \u2014 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0434\u0430\u043b\u0435\u043a\u043e \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0437\u043d\u0430\u0435\u0442 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0441\u0432\u043e\u0435\u0439 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438. \u0415\u0433\u043e \u0446\u0435\u043b\u044c \u043f\u0440\u043e\u0441\u0442\u0430: \u043d\u0430\u0439\u0442\u0438 \u043d\u0443\u0436\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0438 \u043d\u0430\u0447\u0430\u0442\u044c \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c. \u0427\u0435\u043c \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u0442\u0435\u043c \u0443\u0434\u043e\u0431\u043d\u0435\u0435 \u0418\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u0430\u044f \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430, \u0432\u043e\u0442 \u0438 \u0432\u0441\u0451.<\/p>\n<p>\u041e\u043a, \u0440\u043e\u0434\u0438\u043b\u0430\u0441\u044c \u0432\u0442\u043e\u0440\u0430\u044f \u0433\u0438\u043f\u043e\u0442\u0435\u0437\u0430. \u0421\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0445\u043e\u0440\u043e\u0448\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u043f\u043e\u043b\u044f \u0434\u043b\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u041f\u043e\u0447\u0435\u043c\u0443 \u0431\u044b \u043d\u0435 \u043f\u0440\u0438\u043a\u0440\u0443\u0442\u0438\u0442\u044c \u043f\u043e\u043b\u043d\u043e\u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0439 \u043f\u043e\u0438\u0441\u043a? <\/p>\n<p>\u041c\u044b \u0432\u0437\u044f\u043b\u0438 open-source \u0434\u0432\u0438\u0436\u043e\u043a \u0438 \u043f\u0440\u043e\u0438\u043d\u0434\u0435\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u043d\u0430\u0448\u0438 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438. \u0421\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0438\u0441\u044c \u0441 \u0434\u0440\u0443\u0433\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439. \u041c\u043d\u043e\u0433\u0438\u0435 API \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043b\u0438\u0441\u044c \u0434\u0430\u0432\u043d\u043e \u0438 \u0437\u0430\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u043f\u043b\u043e\u0445\u043e. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u043e\u043b\u043d\u043e\u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0439 \u043f\u043e\u0438\u0441\u043a \u0431\u0435\u0441\u0441\u0438\u043b\u0435\u043d, \u0435\u0441\u043b\u0438 \u043d\u0435 \u0432\u044b\u0447\u0438\u0449\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435. \u0414\u0435\u043b\u043e \u043d\u0443\u0436\u043d\u043e\u0435, \u043d\u043e \u0442\u043e\u0433\u0434\u0430 \u043d\u0430\u043c \u043d\u0435 \u0445\u0432\u0430\u0442\u0438\u043b\u043e \u0431\u044b \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u0442\u044c \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0443. <\/p>\n<p>\u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u044f\u0437\u044b\u043a \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0445 API \u0431\u044b\u0432\u0430\u0435\u0442 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u0435\u043d \u0438 \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d \u043a \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432\u043e\u043c\u0443 \u0438\u043b\u0438 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u043c\u0443 \u0434\u043e\u043c\u0435\u043d\u0443. \u041f\u043e\u0440\u043e\u0439 \u0441\u043b\u043e\u0436\u043d\u043e\u0432\u0430\u0442\u043e \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441.<\/p>\n<p>\u0412 \u0442\u0440\u0435\u0442\u0438\u0439 \u0440\u0430\u0437 \u0437\u0430\u043a\u0438\u043d\u0443\u043b\u0438 \u043c\u044b \u043d\u0435\u0432\u043e\u0434: \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b\u0438 \u043c\u043e\u0449\u044c \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u044f\u0437\u044b\u043a\u043e\u0432\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 (LLM) \u0438 \u0441\u043c\u0435\u0436\u043d\u044b\u0445 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0439. \u0418 \u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u043f\u043e\u0439\u043c\u0430\u043b\u0438 \u0437\u043e\u043b\u043e\u0442\u0443\u044e \u0440\u044b\u0431\u043a\u0443. <\/p>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e \u0438\u0441\u043a\u0430\u0442\u044c \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0431\u044b\u043b\u043e \u043d\u0435\u043f\u0440\u043e\u0441\u0442\u043e. \u041f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u0430\u043a\u0435\u0442\u043e\u0432, \u043e\u0431\u043a\u0430\u0442\u0430\u0442\u044c \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435, \u043f\u0440\u043e\u0432\u0435\u0441\u0442\u0438 \u0441\u0435\u0440\u0438\u044e \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0439\u2026 \u043d\u043e \u043e\u0431\u043e \u0432\u0441\u0435\u043c \u043f\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0443.<\/p>\n<h2>\u041f\u0435\u0440\u0432\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u0438 RetrivalQA<\/h2>\n<p>\u0417\u0430\u0434\u0430\u0447\u0430 \u0431\u044b\u043b\u0430 \u0432 \u043d\u043e\u0432\u0438\u043d\u043a\u0443, \u0438 \u043c\u044b \u0438\u0441\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b\u0438 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u043f\u043e\u0438\u0441\u043a\u0430. \u041d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435-\u0442\u043e \u043c\u044b \u0441\u0440\u0430\u0437\u0443 \u0432\u0437\u044f\u043b\u0438 \u0432\u0435\u0440\u043d\u043e\u0435: \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 <a href=\"https:\/\/www.langchain.com\/\">LangChain<\/a>. \u041d\u043e \u0432 API \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u044e\u0442\u0441\u044f \u043a\u043e\u043d\u0444\u0438\u0434\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435. \u0417\u043d\u0430\u0447\u0438\u0442, \u0432\u043d\u0435\u0448\u043d\u044f\u044f LLM \u043d\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u043b\u0430, \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u044f\u044f.<\/p>\n<p>\u041c\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0438 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 class, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u0442\u044c LLM \u0441 LangChain. \u041e\u0441\u0442\u0430\u0432\u0430\u043b\u043e\u0441\u044c \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u0440\u0435\u043c\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u0434\u043e \u0441\u0435\u043a\u0443\u043d\u0434\u044b \u0438\u043b\u0438 \u043d\u0438\u0436\u0435 \u2014 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043d\u0435 \u0445\u043e\u0447\u0435\u0442 \u0436\u0434\u0430\u0442\u044c. \u0418 \u043c\u044b\u2026 \u043d\u0435 \u0441\u043f\u0440\u0430\u0432\u0438\u043b\u0438\u0441\u044c, \u0442\u0430\u043a \u043a\u0430\u043a \u043b\u044e\u0431\u043e\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u0432 LLM \u043f\u043e API \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u043d\u0435 \u043c\u0435\u043d\u0435\u0435 \u0447\u0435\u043c \u0437\u0430 2 \u0441\u0435\u043a\u0443\u043d\u0434\u044b. \u0423\u0432\u044b(<\/p>\n<p>\u0412\u043e\u0442 \u043d\u0430\u0448 class \u0434\u043b\u044f \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f LLM:<\/p>\n<pre><code class=\"python\">class CustomLLM(LLM):     def _call(self, prompt, stop=None):         url = 'your_url'         headers = {             \"Authorization\": f\"Bearer dummy\",              \"Content-Type\": \"application\/json\"         }              payload = {             \"model\": \"LLM_MODEL\",             \"messages\": [{\"role\": \"user\", \"content\": prompt}],             \"temperature\": 0.2         }          response = requests.post(url, headers=headers, json=payload)         if response.status_code == 200:             return response.json()['choices'][0]['message']['content']         else:             logger.error(f\"Request failed with status code {response.status_code}\")             return {\"error\": f\"Request failed with status code {response.status_code}\"}          @property     def _identifying_params(self):         return {\"model\": \"LLM_MODEL\"}          @property     def _llm_type(self):         return \"custom\"   custom_llm = CustomLLM()  qa_chain = RetrievalQA.from_chain_type(llm=custom_llm,                                    chain_type=\"stuff\",                                    retriever=retriever,                                    return_source_documents=True)<\/code><\/pre>\n<h2>\u0422\u043e\u043a\u0435\u043d\u0438\u0437\u0430\u0446\u0438\u044f <\/h2>\n<p>\u0415\u0449\u0435 \u043c\u044b \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0438\u0441\u044c \u0441 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439 \u0442\u043e\u043a\u0435\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445. \u0412 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043d\u0430 \u0440\u0443\u0441\u0441\u043a\u043e\u043c \u044f\u0437\u044b\u043a\u0435. \u0410 \u0432\u0441\u0435 API \u043d\u0430 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u043e\u043c. \u041a\u0430\u043a\u043e\u0439 \u0436\u0435 \u043c\u043e\u0434\u0435\u043b\u044c\u044e \u0434\u0435\u043b\u0430\u0442\u044c \u0432\u0435\u043a\u0442\u043e\u0440\u044b?<\/p>\n<p>\u041f\u0440\u043e\u0431\u043e\u0432\u0430\u043b\u0438 \u0440\u0443\u0441\u0441\u043a\u0438\u0435 <a href=\"https:\/\/huggingface.co\/cointegrated\/rubert-tiny2\">rubert<\/a> \u0438 <a href=\"https:\/\/huggingface.co\/DiTy\/bi-encoder-russian-msmarco\">bi-encoder<\/a>. \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u0441\u043f\u0443\u0441\u0442\u044f \u0434\u043e\u043b\u0433\u0438\u0435 \u0447\u0430\u0441\u044b \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \u0438 \u043f\u043e\u043f\u044b\u0442\u043e\u043a \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c \u0441\u043a\u043e\u0440 \u043c\u044b \u043a\u043e\u043d\u0441\u0442\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043b\u0438, \u0447\u0442\u043e \u044d\u0442\u0438 \u043c\u043e\u0434\u0435\u043b\u0438 \u043d\u0435 \u043f\u043e\u0434\u043e\u0448\u043b\u0438.<\/p>\n<p>\u0422\u043e\u0433\u0434\u0430 \u043c\u044b \u0432\u0435\u0440\u043d\u0443\u043b\u0438\u0441\u044c \u043a \u0441\u0430\u043c\u043e\u043c\u0443 \u043f\u0440\u043e\u0441\u0442\u043e\u043c\u0443 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0443 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043b\u0435\u0433\u043a\u043e\u0439 \u0430\u043d\u0433\u043b\u043e\u044f\u0437\u044b\u0447\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438:<\/p>\n<pre><code class=\"python\">embeddings = HuggingFaceEmbeddings(model_name=\"sentence-transformers\/all-MiniLM-L6-v2\")<\/code><\/pre>\n<h2>\u0412\u044b\u0431\u043e\u0440 \u0431\u0430\u0437\u044b \u0434\u043b\u044f \u0434\u0430\u043d\u043d\u044b\u0445<\/h2>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u043f\u0443\u0441\u0442\u0438\u043c\u0441\u044f \u043d\u0430 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0433\u0434\u0435 \u0436\u0435 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043d\u0430\u0448\u0438 \u044d\u043c\u0431\u0435\u0434\u0434\u0438\u043d\u0433\u0438. \u041d\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u044b\u0435 \u0431\u0430\u0437\u044b: <a href=\"https:\/\/qdrant.tech\/\">Qdrant<\/a>, <a href=\"https:\/\/www.trychroma.com\/\">ChromaDB<\/a> \u0438 <a href=\"https:\/\/weaviate.io\/\">Weaviate<\/a>.<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"234\" width=\"234\">\n<p align=\"left\"><strong>\u0410\u0441\u043f\u0435\u043a\u0442<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"156\" width=\"156\">\n<p align=\"left\"><strong>Qdrant<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\"><strong>ChromaDB<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\"><strong>Weaviate<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"234\" width=\"234\">\n<p align=\"left\"><strong>\u0422\u0438\u043f \u0440\u0435\u0448\u0435\u043d\u0438\u044f<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"156\" width=\"156\">\n<p align=\"left\">\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0435<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0421 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0421 \u0433\u0440\u0430\u0444\u043e\u0432\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0438 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u043c\u0438<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"234\" width=\"234\">\n<p align=\"left\"><strong>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u043c\u043e\u0434\u0435\u043b\u0435\u0439<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"156\" width=\"156\">\n<p align=\"left\">\u0411\u0435\u0437 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0432\u0435\u043a\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438, \u043d\u043e \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0441 \u0432\u043d\u0435\u0448\u043d\u0438\u043c\u0438<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0421 \u043c\u043e\u0434\u0435\u043b\u044f\u043c\u0438 \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432: GPT \u0438 Sentence-BERT<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0418\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0441 \u043c\u043e\u0434\u0435\u043b\u044f\u043c\u0438 BERT, OpenAI \u0438 \u0434\u0440\u0443\u0433\u0438\u043c\u0438<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"234\" width=\"234\">\n<p align=\"left\"><strong>\u041f\u043e\u0438\u0441\u043a<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"156\" width=\"156\">\n<p align=\"left\">HNSW \u0434\u043b\u044f \u0431\u044b\u0441\u0442\u0440\u043e\u0433\u043e \u043f\u043e\u0438\u0441\u043a\u0430 \u043f\u043e \u0441\u0445\u043e\u0436\u0435\u0441\u0442\u0438<\/p>\n<\/td>\n<td>\n<p align=\"left\">HNSW \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u043f\u043e \u0441\u0445\u043e\u0436\u0435\u0441\u0442\u0438<\/p>\n<\/td>\n<td>\n<p align=\"left\">HNSW \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u043f\u043e \u0441\u0445\u043e\u0436\u0435\u0441\u0442\u0438 \u0438 \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u0438<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"234\" width=\"234\">\n<p align=\"left\"><strong>\u0413\u0438\u0431\u043a\u043e\u0441\u0442\u044c<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"156\" width=\"156\">\n<p align=\"left\">\u0412\u044b\u0441\u043e\u043a\u0430\u044f, \u043d\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0432\u043d\u0435\u0448\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0421\u0440\u0435\u0434\u043d\u044f\u044f, \u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u041e\u0447\u0435\u043d\u044c \u0432\u044b\u0441\u043e\u043a\u0430\u044f, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0438 \u0433\u0440\u0430\u0444\u044b<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"234\" width=\"234\">\n<p align=\"left\"><strong>\u041c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u0435\u043c\u043e\u0441\u0442\u044c<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"156\" width=\"156\">\n<p align=\"left\">\u041e\u0442\u043b\u0438\u0447\u043d\u0430\u044f \u0434\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0425\u043e\u0440\u043e\u0448\u0430\u044f<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u041e\u0442\u043b\u0438\u0447\u043d\u0430\u044f, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"234\" width=\"234\">\n<p align=\"left\"><strong>\u0421\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"156\" width=\"156\">\n<p align=\"left\">\u041f\u0440\u043e\u0441\u0442\u0430\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430, \u043d\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u0438<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u041d\u0438\u0437\u043a\u0430\u044f, \u043d\u043e \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0435\u0442 \u0433\u0438\u0431\u043a\u043e\u0441\u0442\u0438<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0421\u043b\u043e\u0436\u043d\u0430\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430, \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0435\u043c\u043a\u0430\u044f, \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0441\u0435\u0440\u0438\u0438 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432 \u043c\u044b \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0438\u0441\u044c \u043d\u0430 \u043d\u0430 Weaviate, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u044d\u0442\u0430 \u0431\u0430\u0437\u0430 \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u043e \u0441\u0435\u0431\u044f \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0430 \u0432 \u0440\u0435\u0448\u0435\u043d\u0438\u0438 \u0437\u0430\u0434\u0430\u0447\u0430 QA \u043f\u043e \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430\u043c Confluence. \u0421\u0435\u0439\u0447\u0430\u0441 \u0432 \u043d\u0435\u043c, \u043f\u043e\u043c\u0438\u043c\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u0430, \u043c\u044b \u0445\u0440\u0430\u043d\u0438\u043c \u0432\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u043c \u043f\u043e \u043d\u0438\u043c \u043f\u043e\u0438\u0441\u043a. \u0422\u0430\u043a\u0436\u0435 Weaviate \u0434\u0430\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043a\u0430\u0441\u0442\u043e\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u043e\u0438\u0441\u043a\u0430, \u043d\u043e \u043e\u0431 \u044d\u0442\u043e\u043c \u043a\u0430\u043a-\u043d\u0438\u0431\u0443\u0434\u044c \u0432 \u0434\u0440\u0443\u0433\u043e\u0439 \u0440\u0430\u0437.<\/p>\n<h2>Ensemble Retrivers \u0438 \u043d\u0430\u0448\u0435 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435<\/h2>\n<p>\u041c\u044b \u0443\u0448\u043b\u0438 \u0432 FAISS(\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 MongoDB): \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c, \u0432\u044b\u0434\u0430\u0435\u0442 \u043d\u0443\u0436\u043d\u044b\u0435 \u043c\u0435\u0442\u0440\u0438\u043a\u0438. \u0412\u043f\u043e\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0438 \u0432\u0437\u044f\u043b\u0438 \u0442\u0435\u0445\u043d\u0438\u043a\u0443 \u0430\u043d\u0441\u0430\u043c\u0431\u043b\u0435\u0432\u043e\u0433\u043e \u0440\u0435\u0442\u0440\u0438\u0432\u0435\u0440\u0430 \u0438\u0437 FAISS \u0438 BM25, \u0447\u0442\u043e \u043d\u0430\u0441 \u0438 \u0441\u043f\u0430\u0441\u043b\u043e. \u0412\u043e\u0442 \u0447\u0430\u0441\u0442\u044c \u043a\u043e\u0434\u0430:<\/p>\n<pre><code class=\"python\">from langchain.retrievers import EnsembleRetriever from langchain_community.retrievers import BM25Retriever from langchain_community.vectorstores import FAISS from langchain_openai import OpenAIEmbeddings  doc_list_1 = [     \"I like apples\",     \"I like oranges\",     \"Apples and oranges are fruits\", ]  # initialize the bm25 retriever and faiss retriever bm25_retriever = BM25Retriever.from_texts(     doc_list_1, metadatas=[{\"source\": 1}] * len(doc_list_1) ) bm25_retriever.k = 2  doc_list_2 = [     \"You like apples\",     \"You like oranges\", ]  embedding = OpenAIEmbeddings() faiss_vectorstore = FAISS.from_texts(     doc_list_2, embedding, metadatas=[{\"source\": 2}] * len(doc_list_2) ) faiss_retriever = faiss_vectorstore.as_retriever(search_kwargs={\"k\": 2})  # initialize the ensemble retriever ensemble_retriever = EnsembleRetriever(     retrievers=[bm25_retriever, faiss_retriever], weights=[0.5, 0.5] )<\/code><\/pre>\n<h2>\u0414\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438<\/h2>\n<p>\u0423 \u043b\u044e\u0431\u043e\u0433\u043e \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043f\u043e\u0438\u0441\u043a\u0430 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c: \u043e\u0440\u0444\u043e\u0433\u0440\u0430\u0444\u0438\u044f \u0438 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u043b\u043e\u0432, \u0440\u0430\u0437\u043d\u044b\u0435 \u044f\u0437\u044b\u043a\u0438 \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435. \u0410 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u0441\u0435 \u0435\u0449\u0435 \u0434\u043e\u043b\u0436\u0435\u043d \u0432\u044b\u0445\u043e\u0434\u0438\u0442\u044c \u043d\u0435 \u0431\u043e\u043b\u0435\u0435 \u0447\u0435\u043c \u0437\u0430 \u0441\u0435\u043a\u0443\u043d\u0434\u0443. <\/p>\n<p>\u041d\u043e \u043c\u044b \u0443\u0432\u0435\u0440\u0435\u043d\u044b, \u0447\u0442\u043e \u0441\u043f\u0440\u0430\u0432\u0438\u043c\u0441\u044f, \u0432\u0435\u0434\u044c \u043d\u0430\u0448 \u043f\u043e\u0434\u0445\u043e\u0434 \u043f\u0435\u0440\u0441\u043f\u0435\u043a\u0442\u0438\u0432\u0435\u043d. \u041c\u044b \u043c\u043e\u0436\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043d\u0430 \u0418\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u0443\u044e \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0443 \u043d\u043e\u0432\u044b\u0435 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438 \u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u2014 \u0438 \u044d\u0442\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f.<\/p>\n<p>\u041d\u0430\u0434\u0435\u0435\u043c\u0441\u044f, \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b \u0431\u044b\u043b \u043f\u043e\u043b\u0435\u0437\u0435\u043d \u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0435\u043d. \u0414\u043e \u0441\u043a\u043e\u0440\u044b\u0445 \u0432\u0441\u0442\u0440\u0435\u0447 \u043d\u0430 \u043f\u043e\u043b\u0435 LLM.<\/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\/892654\/\"> https:\/\/habr.com\/ru\/articles\/892654\/<\/a><br \/><\/br><\/br><\/p>\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-454156","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/454156","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=454156"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/454156\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=454156"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=454156"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=454156"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}