{"id":378436,"date":"2024-06-09T15:14:12","date_gmt":"2024-06-09T15:14:12","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=378436"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=378436","title":{"rendered":"<span>\u0414\u0435\u043b\u0430\u0435\u043c \u043d\u0430\u0442\u0438\u0432\u043d\u043e\u0435 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441 \u0418\u0418 \u0438 \u0431\u044d\u043a\u0435\u043d\u0434\u043e\u043c (\u0422\u0443\u0442\u043e\u0440\u0438\u0430\u043b)<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0435 \u0441\u0442\u0430\u0442\u044c\u0438:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/articles\/816327\/\" rel=\"noopener noreferrer nofollow\">\u041a\u0430\u043a \u043c\u044b \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u043b\u0438 \u0418\u0418-\u0441\u0442\u0430\u0440\u0442\u0430\u043f \u043d\u0430 \u0445\u0430\u043a\u0430\u0442\u043e\u043d\u0435 \u0432\u044b\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u0434\u043d\u044f \u0432 \u0413\u0435\u0440\u043c\u0430\u043d\u0438\u0438<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/markparker.me\/blog\/house-md-ai-diagnostician-in-your-phone-passing-the-torch-and-entrusting-a-startup-to-capable-hands\" rel=\"noopener noreferrer nofollow\">House, MD &#8212; AI Diagnostician in Your Phone: Passing the Startup Torch<\/a><\/p>\n<\/li>\n<\/ul>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0442\u043e\u043d\u043a\u043e\u0441\u0442\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f Proof of Concept (PoC) \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0433\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 SwiftUI \u0438 \u0431\u044d\u043a\u0435\u043d\u0434\u0430 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c FastAPI. \u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u044f \u043f\u0440\u043e\u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u044e \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u044b\u0435 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u044b\u0435 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u044b \u0434\u043b\u044f SwiftUI-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u0432 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438 MVVMP \u0432 \u0441\u043e\u0447\u0435\u0442\u0430\u043d\u0438\u0438 \u0441 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0430\u043c\u0438 SOLID \u0438 Dependency Injection (DI). \u0414\u043b\u044f android \u043a\u043e\u0434 \u043c\u043e\u0436\u043d\u043e \u043b\u0435\u0433\u043a\u043e \u043f\u0435\u0440\u0435\u0432\u0435\u0441\u0442\u0438 \u043d\u0430 Kotlin \u0441 Jetpack Compose.<\/p>\n<h3>\u0417\u0430\u0447\u0435\u043c \u043d\u0430\u043c \u043d\u0443\u0436\u0435\u043d \u0431\u044d\u043a\u0435\u043d\u0434<\/h3>\n<p>\u041a\u0442\u043e-\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0437\u0430\u043f\u0438\u0445\u043d\u0443\u0442\u044c \u0432\u0441\u044e \u043b\u043e\u0433\u0438\u043a\u0443 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0432 chatgpt \u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0431\u0435\u0437 \u0431\u044d\u043a\u0435\u043d\u0434\u0430. \u0418 \u044f \u0441\u043e\u0433\u043b\u0430\u0441\u0435\u043d, \u044d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043d\u043e \u0431\u044d\u043a\u0435\u043d\u0434 \u0434\u0430\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0430\u0436\u043d\u044b\u0445 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432.<\/p>\n<p>\u0411\u044d\u043a\u0435\u043d\u0434 \u0441\u043b\u0443\u0436\u0438\u0442 \u043e\u0441\u043d\u043e\u0432\u043e\u0439 \u0434\u043b\u044f \u043b\u044e\u0431\u043e\u0433\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0434\u043b\u044f \u0442\u0435\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0442\u0440\u0435\u0431\u0443\u044e\u0442 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0433\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u043c\u0438, \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0438 \u0438 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432. \u0412\u043e\u0442 \u043f\u043e\u0447\u0435\u043c\u0443 \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0431\u044d\u043a\u044d\u043d\u0434 \u0438\u043c\u0435\u0435\u0442 \u0440\u0435\u0448\u0430\u044e\u0449\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435:<\/p>\n<ol>\n<li>\n<p><strong>\u0411\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c<\/strong>: \u0411\u044d\u043a\u044d\u043d\u0434 \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0437\u0430\u0449\u0438\u0442\u0438\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0434\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438 \u0442\u043e\u043a\u0435\u043d\u044b \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u043e\u0442 \u0430\u0442\u0430\u043a \u0442\u0438\u043f\u0430 MITM (Man-in-the-Middle). \u041e\u043d \u0432\u044b\u0441\u0442\u0443\u043f\u0430\u0435\u0442 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0437\u0430\u0449\u0438\u0449\u0435\u043d\u043d\u043e\u0433\u043e \u0448\u043b\u044e\u0437\u0430 \u043c\u0435\u0436\u0434\u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u043c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e\u043c \u0438 \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u043b\u0438 \u0432\u043d\u0435\u0448\u043d\u0438\u043c\u0438 \u0441\u043b\u0443\u0436\u0431\u0430\u043c\u0438, \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044f \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0438 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e \u0432\u0441\u0435\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u0430 \u0442\u0430\u043a \u0436\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0432 \u0442\u0430\u0439\u043d\u0435 api \u043a\u043b\u044e\u0447\u0438.<\/p>\n<\/li>\n<li>\n<p><strong>\u041a\u043e\u043d\u0442\u0440\u043e\u043b\u044c \u043d\u0430\u0434 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432<\/strong>: \u0423\u043f\u0440\u0430\u0432\u043b\u044f\u044f API \u0438 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435\u043c \u0441 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c\u0438 \u0447\u0435\u0440\u0435\u0437 \u0431\u044d\u043a\u044d\u043d\u0434, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0442\u044c \u0438 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u042d\u0442\u043e \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u044f \u0434\u0440\u043e\u0441\u0441\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u043e\u0439, \u043f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u0437\u043b\u043e\u0443\u043f\u043e\u0442\u0440\u0435\u0431\u043b\u0435\u043d\u0438\u0439 \u0438 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432.<\/p>\n<\/li>\n<li>\n<p><strong>\u0418\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u0441 \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445<\/strong>: \u0411\u044d\u043a\u044d\u043d\u0434 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0431\u0435\u0441\u0448\u043e\u0432\u043d\u0443\u044e \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044e \u0441 \u0431\u0430\u0437\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044f \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438 \u0445\u0440\u0430\u043d\u0438\u0442\u044c, \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0442\u044c \u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438. \u042d\u0442\u043e \u0432\u0430\u0436\u043d\u043e \u0434\u043b\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0442\u0440\u0435\u0431\u0443\u044e\u0442 \u0443\u0447\u0435\u0442\u043d\u044b\u0445 \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439, \u0445\u0440\u0430\u043d\u044f\u0442 \u0438\u0445 \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0442\u0435\u043d\u0438\u044f \u0438\u043b\u0438 \u043d\u0443\u0436\u0434\u0430\u044e\u0442\u0441\u044f \u0432 \u0431\u044b\u0441\u0442\u0440\u043e\u043c \u0438 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u043c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0438 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043e\u0431\u044a\u0435\u043c\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<\/li>\n<li>\n<p><strong>\u041c\u043e\u0434\u0435\u043b\u0438 \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0438 \u0438 Freemium<\/strong>: \u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0443\u0441\u043b\u0443\u0433 \u043f\u043e \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0435 \u0438\u043b\u0438 \u043c\u043e\u0434\u0435\u043b\u0438 freemium \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043d\u0430\u043b\u0438\u0447\u0438\u044f \u0431\u044d\u043a\u0435\u043d\u0434\u0430 \u0434\u043b\u044f \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0447\u0435\u0442\u043e\u0432, \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u043d\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0443\u0440\u043e\u0432\u043d\u044f\u043c\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439. \u0411\u044d\u043a\u044d\u043d\u0434 \u043c\u043e\u0436\u0435\u0442 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043f\u043b\u0430\u0442\u0435\u0436\u0438 \u0438 \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0438, \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044f \u0431\u0435\u0441\u043f\u0435\u0440\u0435\u0431\u043e\u0439\u043d\u0443\u044e \u0440\u0430\u0431\u043e\u0442\u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0438 \u0441\u043e\u0431\u043b\u044e\u0434\u0430\u044f \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u043e \u0437\u0430\u0449\u0438\u0442\u0435 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<\/li>\n<li>\n<p><strong>\u041c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u0435\u043c\u043e\u0441\u0442\u044c \u0438 \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u043d\u0438\u0435<\/strong>: \u0411\u044d\u043a\u044d\u043d\u0434 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u041b\u043e\u0433\u0438\u043a\u0443 \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c \u0431\u0435\u0437 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u0443, \u0447\u0442\u043e \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442 \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u043d\u0438\u0435 \u0438 \u0443\u0441\u043a\u043e\u0440\u044f\u0435\u0442 \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u0435 \u043d\u043e\u0432\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439.<\/p>\n<\/li>\n<\/ol>\n<p>\u041f\u043e \u0441\u0443\u0442\u0438, \u0431\u044d\u043a\u0435\u043d\u0434 \u2014 \u044d\u0442\u043e \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c, \u043d\u043e \u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0439, \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u0435\u043c\u043e\u0439 \u0438 \u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u043e\u0439 \u0441\u0440\u0435\u0434\u044b \u0434\u043b\u044f \u043f\u0440\u043e\u0446\u0432\u0435\u0442\u0430\u043d\u0438\u044f \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<h3>\u041e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u0435 \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0441\u0442\u0435\u043a\u0430<\/h3>\n<ul>\n<li>\n<p><strong>SwiftUI<\/strong>: \u041b\u0443\u0447\u0448\u0438\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0434\u043b\u044f \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0434\u043b\u044f iOS \u043f\u043e\u0441\u043b\u0435 \u0432\u044b\u0445\u043e\u0434\u0430 UIKit. \u041e\u043d \u0434\u0435\u043a\u043b\u0430\u0440\u0430\u0442\u0438\u0432\u0435\u043d \u0438 \u0443\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0435\u043d, \u0430 XCode \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0435\u0437\u0430\u043c\u0435\u043d\u0438\u043c\u044b\u043c \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u043e\u043c \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u044d\u043f\u043b. \u0414\u043b\u044f android \u043a\u043e\u0434 \u043c\u043e\u0436\u043d\u043e \u043b\u0435\u0433\u043a\u043e \u043f\u0435\u0440\u0435\u0432\u0435\u0441\u0442\u0438 \u043d\u0430 Kotlin \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Jetpack Compose.<\/p>\n<\/li>\n<li>\n<p><strong>FastAPI<\/strong>: \u0412\u044b\u0431\u0440\u0430\u043d \u0434\u043b\u044f \u0431\u044d\u043a\u0435\u043d\u0434\u0430 \u0437\u0430 \u0435\u0433\u043e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c, \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 \u0438 \u0434\u0435\u043a\u043b\u0430\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c, \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0440\u0435\u0432\u043e\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e Zed.dev.<\/p>\n<\/li>\n<li>\n<p><strong>ChatGPT API<\/strong>: \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u044f\u0437\u044b\u043a\u043e\u0432\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 (LLM); \u0432\u044b\u0431\u043e\u0440 \u043c\u043e\u0436\u0435\u0442 \u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043a\u0430\u0441\u0442\u043e\u043c\u0438\u0437\u0430\u0446\u0438\u0438.<\/p>\n<\/li>\n<li>\n<p><strong>Ngrok<\/strong>: \u0420\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u0442\u0443\u043d\u043d\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b CLI \u0434\u043b\u044f \u0432\u044b\u0445\u043e\u0434\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442.<\/p>\n<\/li>\n<\/ul>\n<h3>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u043b\u044f iOS<\/h3>\n<h4>\u0422\u0435\u043e\u0440\u0438\u044f: \u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u044b\u0435 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u044b<\/h4>\n<ol>\n<li>\n<p><strong>MVVMP (Model View ViewModel Presenter)<\/strong>:<\/p>\n<\/li>\n<\/ol>\n<ul>\n<li>\n<p><strong>Model<\/strong>: \u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a Question, Answer, Questionary \u0438 FilledQuestionary. \u042d\u0442\u0438 \u043c\u043e\u0434\u0435\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u044b \u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u0430\u043d\u043d\u044b\u0435, \u0441\u043b\u0435\u0434\u0443\u044f \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0443 KISS.<\/p>\n<\/li>\n<li>\n<p><strong>View<\/strong>: \u041e\u0442\u0432\u0435\u0447\u0430\u044e\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0437\u0430 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u0438 \u0434\u0435\u043b\u0435\u0433\u0438\u0440\u0443\u044e\u0442 \u0432\u0441\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438 \u043b\u043e\u0433\u0438\u043a\u0443 \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0435\u0440\u0430\u043c. \u041e\u043d\u0438 \u043d\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u043d\u0438\u043a\u0430\u043a\u043e\u0439 \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0438 \u0438 \u0441\u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u0431\u044b\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u044b\u043c\u0438 \u0438 \u0441\u043e\u0441\u0440\u0435\u0434\u043e\u0442\u043e\u0447\u0435\u043d\u043d\u044b\u043c\u0438 \u043d\u0430 \u0440\u0435\u043d\u0434\u0435\u0440\u0435 UI.<\/p>\n<\/li>\n<li>\n<p><strong>ViewModel<\/strong>: \u0412 SwiftUI ViewModel \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c ObservableObject, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043b\u0443\u0436\u0438\u0442 \u043c\u043e\u0434\u0435\u043b\u044c\u044e \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u044f \u0437\u0430 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438. \u0417\u0434\u0435\u0441\u044c \u043d\u0435\u0442 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0438 \u043b\u043e\u0433\u0438\u043a\u0438.<\/p>\n<\/li>\n<li>\n<p><strong>Presenter<\/strong>: Presenter \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0432\u0441\u0435\u0439 \u043b\u043e\u0433\u0438\u043a\u043e\u0439, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u043e\u0439 \u0441 \u043c\u043e\u0434\u0443\u043b\u0435\u043c (\u044d\u043a\u0440\u0430\u043d\u043e\u043c \u0438\u043b\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c), \u043d\u043e \u043d\u0435 \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u043e\u0439. \u041e\u043d \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u0442 \u0441 \u0434\u043e\u043c\u0435\u043d\u043d\u044b\u043c \u0441\u043b\u043e\u0435\u043c \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0438, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441 API \u0438\u043b\u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<\/li>\n<li>\n<p><strong>Domain Layer<\/strong>: \u042d\u0442\u043e\u0442 \u0441\u043b\u043e\u0439 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u0442 \u0441 \u0432\u043d\u0435\u0448\u043d\u0438\u043c\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c\u0438, \u0442\u0430\u043a\u0438\u043c\u0438 \u043a\u0430\u043a \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445, API \u0438\u043b\u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u044b. \u041e\u043d \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a \u0441\u0435\u0440\u0432\u0438\u0441\u044b, \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u044b, \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u044b, \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438, \u043c\u0430\u043f\u043f\u0435\u0440\u044b, \u0444\u0430\u0431\u0440\u0438\u043a\u0438 \u0438 \u0442. \u0434.<\/p>\n<\/li>\n<li>\n<p>\u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, MP \u0432 MVVMP \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0430\u043c\u0438 \u041c\u0430\u0440\u043a\u0430 \u041f\u0430\u0440\u043a\u0435\u0440\u0430, \u0430 \u043f\u043e\u043b\u043d\u0430\u044f \u0444\u043e\u0440\u043c\u0430 \u2014 \u00abModel View ViewModel by Mark Parker\u00bb.<\/p>\n<\/li>\n<\/ul>\n<ol start=\"2\">\n<li>\n<p><strong>\u041f\u0440\u0438\u043d\u0446\u0438\u043f\u044b \u0421\u041e\u041b\u0418\u0414<\/strong>:<\/p>\n<ul>\n<li>\n<p><strong>\u041f\u0440\u0438\u043d\u0446\u0438\u043f \u0435\u0434\u0438\u043d\u043e\u0439 \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u0438<\/strong>: \u0423 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u0430 \u043f\u0440\u0438\u0447\u0438\u043d\u0430 \u0434\u043b\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439.<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u0438\u043d\u0446\u0438\u043f <strong>\u043e\u0442\u043a\u0440\u044b\u0442\u043e\u0441\u0442\u044c-\u0437\u0430\u043a\u0440\u044b\u0442\u043e\u0441\u0442\u044c<\/strong>: \u041a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u043e\u0442\u043a\u0440\u044b\u0442\u044b \u0434\u043b\u044f \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f, \u043d\u043e \u0437\u0430\u043a\u0440\u044b\u0442\u044b \u0434\u043b\u044f \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438.<\/p>\n<\/li>\n<li>\n<p><strong>\u041f\u0440\u0438\u043d\u0446\u0438\u043f \u0437\u0430\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u041b\u0438\u0441\u043a\u043e\u0432\u0430<\/strong>: \u041e\u0431\u044a\u0435\u043a\u0442\u044b \u0441\u0443\u043f\u0435\u0440\u043a\u043b\u0430\u0441\u0441\u0430 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u043c\u044b \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c\u0438 \u043f\u043e\u0434\u043a\u043b\u0430\u0441\u0441\u043e\u0432.<\/p>\n<\/li>\n<li>\n<p><strong>\u041f\u0440\u0438\u043d\u0446\u0438\u043f \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432<\/strong>: \u041d\u0438 \u043e\u0434\u0438\u043d \u043a\u043b\u0438\u0435\u043d\u0442 \u043d\u0435 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0432\u044b\u043d\u0443\u0436\u0434\u0435\u043d \u0437\u0430\u0432\u0438\u0441\u0435\u0442\u044c \u043e\u0442 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u043d \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442.<\/p>\n<\/li>\n<li>\n<p><strong>\u041f\u0440\u0438\u043d\u0446\u0438\u043f \u0438\u043d\u0432\u0435\u0440\u0441\u0438\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439<\/strong>: \u0417\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u043e\u0442 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u0439, \u0430 \u043d\u0435 \u043e\u0442 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u0438\u043a\u0438, \u0447\u0435\u043c\u0443 \u0441\u043f\u043e\u0441\u043e\u0431\u0441\u0442\u0432\u0443\u0435\u0442 DI.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u0418\u043d\u044a\u0435\u043a\u0446\u0438\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 (DI)<\/strong>: \u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c DI-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0434\u043b\u044f \u0441\u043e\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0430 \u0438\u043d\u0432\u0435\u0440\u0441\u0438\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439.<\/p>\n<\/li>\n<\/ol>\n<h3>\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0431\u044d\u043a\u0435\u043d\u0434\u0430<\/h3>\n<p>\u041a\u043e\u0434 <a href=\"https:\/\/github.com\/HouseMDAI\/house-backend\/blob\/master\/backend\" rel=\"noopener noreferrer nofollow\">\u0431\u044d\u043a\u0435\u043d\u0434\u0430<\/a> \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442. \u042d\u043d\u0434\u043f\u043e\u0438\u043d\u0442\u044b (<a href=\"http:\/\/main.py\" rel=\"noopener noreferrer nofollow\">main.py<\/a>):<\/p>\n<pre><code class=\"python\">from typing import Callable import json from fastapi import FastAPI, Body, Request, Response from .models import (Question, FilledQuestionary, DoctorResponseAnswer, DoctorResponseQuestionary) from .user_card import UserCardSimple from .prompting import get_response   @app.get(\"\/onboarding\", response_model = DoctorResponseQuestionary) def onboarding():     return DoctorResponseQuestionary(question=[Question(text=text) for text in UserCardSimple.__fields__.keys()])  @app.post(\"\/doctor\") def doctor(user_card: UserCardSimple, filled_questionary: FilledQuestionary, message: str = Body(...)):     json_string = get_response(user_card, message, filled_questionary)      loaded = json.loads(json_string.strip())     return loaded <\/code><\/pre>\n<p>&#171;onboarding&#187; \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043f\u0438\u0441\u043e\u043a \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432 \u0430\u043d\u0430\u043c\u043d\u0435\u0437\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043f\u0440\u0438 \u043f\u0435\u0440\u0432\u043e\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u041e\u0442\u0432\u0435\u0442\u044b \u0431\u0443\u0434\u0443\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u044b \u043d\u0430 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0435 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u044b \u0434\u043b\u044f \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0438 \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u043c. &#171;doctor&#187; \u2014 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442: \u043e\u043d \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u043e\u0442\u0432\u0435\u0442\u043e\u0432 \u0438 \u043a\u0430\u0440\u0442\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u043b\u0438\u0431\u043e \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0438.<\/p>\n<p>\u041c\u043e\u0434\u0435\u043b\u0438:<\/p>\n<pre><code class=\"python\">from pydantic import BaseModel   class Question(BaseModel):     text: str  class FilledQuestionary(BaseModel):     filled_questions: dict[str, str]  class DoctorResponseAnswer(BaseModel):     text: str  class DoctorResponseQuestionary(BaseModel):     questions: list[str]  class UserCardSimple(BaseModel):     sex: str     age: int     weight: int     height: int     special_conditions: str <\/code><\/pre>\n<p>\u041f\u0440\u043e\u043c\u043f\u0442\u044b:<\/p>\n<pre><code class=\"python\">import os from openai import OpenAI from .models import FilledQuestionary   api_key = os.environ.get(\"API_KEY\") client = OpenAI(api_key=api_key)  def get_response(user_card: str, message: str, filled_questionary: FilledQuestionary, max_tokens=200):     format_question = \"\"\"{\"questions\":[{\"text\":\"first question\"},{\"text\":\"second question\"}]}\"\"\"     format_advice = \"\"\"{\"text\":\"Advice: Drink more water\"}\"\"\"          system_prompt = f\"\"\"     You are a doctor that gives user an opportunity to swiftly check up health and diagnos an illness using anamnes and a short questionary.      Your task is to ask short questions and give your opinion and advices.     Your questions are accamulated in the filled questionary, which is empty in the first itteration.           Strive to about 1-2 questions per iteration and up to 6 questions in total (can be less). Questions must be short, clear, shouldn't repeat,      and should be relevant to the user's health condition, and should require easy answers.     Ask questions only in the json format {format_question}.      Number of answered questions: {len(filled_questionary.filled_questions)}     If the Number of answered questions is more then 6, you should stop asking questions an`d provide an give your final opinion,      an assumption or an advice in the json format {format_advice}.     \"\"\"          prompt = f\"\"\"request message: {message}; anamnesis: {user_card}; filled questionary: {filled_questionary};\"\"\"      chat_completion = client.chat.completions.create(         messages=[             {                 \"role\": \"system\",                 \"content\": f\"{system_prompt}\",             },             {                 \"role\": \"user\",                 \"content\": f\"{prompt}\",             },         ],         model=\"gpt-3.5-turbo\",         max_tokens=max_tokens     )     return chat_completion.choices[0].message.content <\/code><\/pre>\n<p>\u041c\u043e\u0434\u0443\u043b\u044c \u043f\u0440\u043e\u043c\u043f\u0442\u043e\u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 GPT-3.5 \u043e\u0442 OpenAI \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043e\u0442\u0432\u0435\u0442\u043e\u0432 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u0432\u0432\u043e\u0434\u0430, \u0430\u043d\u0430\u043c\u043d\u0435\u0437\u0430 \u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u044b\u0445 \u0430\u043d\u043a\u0435\u0442. \u041e\u043d \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u0438 \u0441\u043e\u0432\u0435\u0442\u044b \u043f\u043e \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0435 \u0437\u0434\u043e\u0440\u043e\u0432\u044c\u044f. \u041a\u0430\u043a \u0432\u0438\u0434\u0438\u0442\u0435, \u043d\u0438\u0447\u0435\u0433\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0433\u043e \u0437\u0434\u0435\u0441\u044c \u043d\u0435\u0442. \u041a\u043e\u0434 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0440\u0435\u043d, \u0430 \u043f\u0440\u043e\u043c\u043f\u0442\u044b &#8212; \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0430\u0431\u043e\u0440 \u0447\u0435\u0442\u043a\u0438\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439 \u0434\u043b\u044f LLM.<\/p>\n<p>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u0442\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u0441\u0435\u0440\u0432\u0435\u0440 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>fastapi dev main.py<\/code>.<\/p>\n<p>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438:<\/p>\n<ul>\n<li>\n<p><a href=\"http:\/\/fastapi.tiangolo.com\/tutorial\/first-steps\" rel=\"noopener noreferrer nofollow\">fastapi.tiangolo.com\/tutorial\/first-steps<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"http:\/\/pypi.org\/project\/openai\/\" rel=\"noopener noreferrer nofollow\">pypi.org\/project\/openai\/<\/a><\/p>\n<\/li>\n<\/ul>\n<h4>\u041e\u0442\u043a\u0440\u044b\u0442\u0438\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u043c\u0443 \u0445\u043e\u0441\u0442\u0443 \u0447\u0435\u0440\u0435\u0437 \u0418\u043d\u0442\u0435\u0440\u043d\u0435\u0442<\/h4>\n<ol>\n<li>\n<p>\u0417\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0439\u0442\u0435\u0441\u044c \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 <a href=\"http:\/\/ngrok.com\" rel=\"noopener noreferrer nofollow\">ngrok.com<\/a> \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 \u0442\u043e\u043a\u0435\u043d \u0434\u043e\u0441\u0442\u0443\u043f\u0430.<\/p>\n<\/li>\n<li>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 ngrok \u0441 \u0441\u0430\u0439\u0442\u0430 <a href=\"http:\/\/ngrok.com\/download\" rel=\"noopener noreferrer nofollow\">ngrok.com\/download<\/a>.<\/p>\n<\/li>\n<li>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <code>ngrok config add-authtoken &lt;TOKEN><\/code>.<\/p>\n<\/li>\n<li>\n<p>\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u044b <code>ngrok http http:\/\/localhost:8080<\/code> (\u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u0435 \u043f\u043e\u0440\u0442).<\/p>\n<\/li>\n<\/ol>\n<p>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u043f\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0432 <a href=\"https:\/\/ngrok.com\/docs\/getting-started\" rel=\"noopener noreferrer nofollow\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 ngrok<\/a>.<\/p>\n<h4>\u041a\u043e\u0434\u0438\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435<\/h4>\n<p>\u042f \u043d\u0435 \u0431\u0443\u0434\u0443 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0437\u0434\u0435\u0441\u044c \u0432\u0435\u0441\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434, \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0435\u0441\u0442\u044c GitHub. \u041d\u0430\u0439\u0442\u0438 \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443: <a href=\"https:\/\/github.com\/HouseMDAI\/house-ios\/blob\/main\/HouseMDAI\/Main\/HouseMDAI.swift\" rel=\"noopener noreferrer nofollow\">HouseMDAI iOS App<\/a>. \u0412\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e \u044f \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u044e\u0441\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u0432\u0430\u0436\u043d\u044b\u0445 (IMO) \u043c\u043e\u043c\u0435\u043d\u0442\u0430\u0445.<\/p>\n<p>\u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u043a\u0440\u0430\u0442\u043a\u043e\u0433\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447\u0438: \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u043c \u043f\u043e\u043b\u0435\u043c \u043d\u0430 \u0433\u043b\u0430\u0432\u043d\u043e\u043c \u044d\u043a\u0440\u0430\u043d\u0435, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u0430\u0431\u043e\u0440 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043e\u0442\u0432\u0435\u0442. \u0422\u0430\u043a\u0436\u0435 \u043d\u0430\u043c \u043d\u0443\u0436\u0435\u043d \u043e\u0434\u043d\u043e\u0440\u0430\u0437\u043e\u0432\u044b\u0439 \u043e\u043d\u0431\u043e\u0440\u0434\u0438\u043d\u0433. \u0418\u0442\u0430\u043a, \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c \u043a \u043a\u043e\u0434\u0443.<\/p>\n<p>\u041f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u044b \u043c\u043e\u0434\u0435\u043b\u0438, \u0438 \u043e\u043d\u0438 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u044b (\u043f\u0440\u0438\u043d\u0446\u0438\u043f KISS).<\/p>\n<pre><code class=\"swift\">struct Question {     var text: String }  struct Answer {     var text: String }  struct Questionary {     var questions: [Question] }  struct FilledQuestionary {     var filledQuestions: [String: String] } <\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u043e\u043d\u0431\u043e\u0440\u0434\u0438\u043d\u0433. \u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u043c \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c KISS \u0438 SRP (Single Responsibility Principle), \u043d\u0438\u043a\u0430\u043a\u043e\u0439 \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0438 \u0432 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f\u0445, \u0442\u043e\u043b\u044c\u043a\u043e UI. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 &#8212; \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u043f\u0438\u0441\u043e\u043a \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432 \u0441 \u043f\u0440\u043e\u043a\u0440\u0443\u0442\u043a\u043e\u0439. \u0412\u0441\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438 \u043b\u043e\u0433\u0438\u043a\u0430 \u0434\u0435\u043b\u0435\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0435\u0440\u0443. \u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435, \u0447\u0442\u043e \u0437\u0434\u0435\u0441\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u044d\u0442\u043e \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 <code>bindingForQuestion<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439, \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e, \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0432 \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0435\u0440\u0435, \u043d\u043e \u0441\u0435\u0439\u0447\u0430\u0441 \u044d\u0442\u043e \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f.<\/p>\n<pre><code class=\"swift\">import SwiftUI  struct OnboardingView: View {          @StateObject var presenter: OnboardingPresenter          var body: some View {         ScrollView {             Spacer()             VStack {                 ForEach(presenter.questions.questions) { question in                     VStack {                         Text(question.text)                         TextField(\"\", text: bindingForQuestion(question))                             .formItem()                     }                     .padding()                 }             }.padding()                          Button(\"Save\", action: presenter.save)             Spacer()         }     }          private func bindingForQuestion(_ question: Question) -> Binding&lt;String> {         Binding(             get: { presenter.answers.filledQuestions[question.text] ?? \"\" },             set: { presenter.answers.filledQuestions[question.text] = $0 }         )     } } <\/code><\/pre>\n<p>\u0412\u044b \u0431\u0443\u0434\u0435\u0442\u0435 \u0443\u0434\u0438\u0432\u043b\u0435\u043d\u044b, \u043d\u043e \u0432 \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0435\u0440\u0435 \u0442\u0430\u043a\u0436\u0435 \u043d\u0435\u0442 \u043d\u0438\u043a\u0430\u043a\u043e\u0439 \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0438!<\/p>\n<pre><code class=\"swift\">class OnboardingPresenter: ObservableObject {      @Published public var answers: FilledQuestionary     private(set) public var questions: Questionary     private var completion: (FilledQuestionary) -> Void          init(questions: Questionary, answers: FilledQuestionary, completion: @escaping (FilledQuestionary) -> Void) {         self.questions = questions         self.answers = answers         self.completion = completion     }          func save() {         completion(answers)     } } <\/code><\/pre>\n<p>\u0412\u0441\u0435 \u043f\u043e-\u043f\u0440\u0435\u0436\u043d\u0435\u043c\u0443 <em>simple, stupid<\/em> \u0438 \u0438\u043c\u0435\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e <em>\u043e\u0434\u043d\u0443 \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u044c<\/em>. Presenter \u0434\u043e\u043b\u0436\u0435\u043d \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043b\u043e\u0433\u0438\u043a\u0443 \u0441\u0432\u043e\u0435\u0433\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f. \u0411\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0430 \u0443\u0440\u043e\u0432\u043d\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432\u043d\u0435 \u0435\u0433\u043e \u044e\u0440\u0438\u0441\u0434\u0438\u043a\u0446\u0438\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0435\u0440 \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u0435\u043b\u0435\u0433\u0438\u0440\u0443\u0435\u0442 \u0435\u0435 \u043d\u0430\u0432\u0435\u0440\u0445 \u043f\u043e \u0441\u0442\u044d\u043a\u0443 \u0432\u044b\u0437\u043e\u0432\u0430.<\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0438 View, \u0438 Presenter \u043d\u0435 \u0438\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u0440\u0443\u044e\u0442 \u043d\u0438 \u043e\u0434\u043d\u0443 \u0438\u0437 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439, \u0430 \u043f\u043e\u043b\u0443\u0447\u0430\u044e\u0442 \u0438\u0445 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043f\u0440\u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438. \u042d\u0442\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0443 \u0438\u043d\u0432\u0435\u0440\u0441\u0438\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439, \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043c\u043e\u0434\u0443\u043b\u0438 \u0432\u044b\u0441\u043e\u043a\u043e\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u0437\u0430\u0432\u0438\u0441\u0435\u0442\u044c \u043e\u0442 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u043d\u0438\u0437\u043a\u043e\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f, \u043d\u043e \u043e\u0431\u0430 \u0434\u043e\u043b\u0436\u043d\u044b \u0437\u0430\u0432\u0438\u0441\u0435\u0442\u044c \u043e\u0442 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u0439. \u042d\u0442\u043e \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0433\u0438\u0431\u043a\u043e\u0441\u0442\u044c \u0438 \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043b\u0435\u0433\u043a\u043e \u0437\u0430\u043c\u0435\u043d\u044f\u0442\u044c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0438\u043b\u0438 \u0432\u043d\u0435\u0434\u0440\u044f\u0442\u044c \u043c\u0430\u043a\u0435\u0442\u044b \u0434\u043b\u044f \u0446\u0435\u043b\u0435\u0439 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<p>\u041f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u0430 Dependency Injection \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0438\u0437\u0432\u043d\u0435 \u043a\u043b\u0430\u0441\u0441\u0430, \u0430 \u043d\u0435 \u0438\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0432\u043d\u0443\u0442\u0440\u0438 \u043d\u0435\u0433\u043e. \u042d\u0442\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u0441\u0442\u0432\u0443\u0435\u0442 \u0440\u0430\u0437\u0432\u044f\u0437\u043a\u0435 \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u0434\u0430.<\/p>\n<p>\u0425\u043e\u0442\u044f \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u044b \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u044f\u0432\u043d\u043e, \u0441\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u044b \u043c\u043e\u0433\u0443\u0442 \u0438\u0433\u0440\u0430\u0442\u044c \u0432\u0430\u0436\u043d\u0443\u044e \u0440\u043e\u043b\u044c \u0432 \u043a\u043e\u0434\u0435, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0434\u043b\u044f \u0430\u0431\u0441\u0442\u0440\u0430\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u043e\u0431\u043b\u0435\u0433\u0447\u0435\u043d\u0438\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0432 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u044b \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0439, \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0430\u0442\u043e\u0440\u043e\u0432 \u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439, \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043f\u0440\u043e\u0449\u0435 \u0437\u0430\u043c\u0435\u043d\u044f\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u043b\u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u043c\u043e\u043a\u0438 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<blockquote>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u043e\u0432 \u0432 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f\u0445 SwiftUI, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u043c\u043d\u0438\u0442\u044c \u043e\u0431 \u043e\u0434\u043d\u043e\u043c \u0432\u0430\u0436\u043d\u043e\u043c \u043c\u043e\u043c\u0435\u043d\u0442\u0435. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 View \u0432 SwiftUI &#8212; \u044d\u0442\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430, \u043e\u043d\u0430 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u044f\u0432\u043d\u043e\u0433\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u0442\u0438\u043f\u043e\u0432 \u0441\u0432\u043e\u0438\u0445 \u0441\u0432\u043e\u0439\u0441\u0442\u0432. \u042d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0432\u0430\u043c \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0435\u0451 \u0434\u0436\u0435\u043d\u0435\u0440\u0438\u043a\u043e\u043c \u0438 \u043f\u0440\u043e\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0442\u044c \u0442\u0438\u043f \u0447\u0435\u0440\u0435\u0437 \u0432\u0435\u0441\u044c \u0441\u0442\u0435\u043a \u0432\u044b\u0437\u043e\u0432\u043e\u0432, \u0447\u0442\u043e \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u0442 \u043a \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u044e \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430.<\/p>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434, \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u043c\u044b\u0439 <a href=\"https:\/\/github.com\/MarkParker5\/AnyObservableObject\" rel=\"noopener noreferrer nofollow\">MarkParker5\/AnyObservableObject<\/a>. \u042d\u0442\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0440\u043e\u0434\u043d\u044b\u043c \u043e\u0431\u0435\u0440\u0442\u043a\u0430\u043c \u0441\u0432\u043e\u0439\u0441\u0442\u0432 SwiftUI, \u043d\u043e \u0443\u0431\u0438\u0440\u0430\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u0442\u0438\u043f\u0430 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u0432 \u043f\u043e\u043b\u044c\u0437\u0443 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u043d\u0442\u0430\u0439\u043c\u0430. \u0425\u043e\u0442\u044f \u0442\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043c\u043e\u0436\u0435\u0442 \u0432\u043d\u0435\u0441\u0442\u0438 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0438\u0441\u043a\u0438, \u0438\u0445 \u043b\u0435\u0433\u043a\u043e \u0441\u043d\u0438\u0437\u0438\u0442\u044c, \u043d\u0430\u043f\u0438\u0441\u0430\u0432 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0440\u043d\u044b\u0435 xcode \u0442\u0435\u0441\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u044e\u0442 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0442\u0430\u043a \u0436\u0435, \u043a\u0430\u043a \u0432\u044b \u0434\u0435\u043b\u0430\u0435\u0442\u0435 \u044d\u0442\u043e \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u043d\u0442\u0430\u0439\u043c\u0430.<\/p>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u044d\u0442\u0443 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u0443, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u0441\u0432\u043e\u0439 \u043a\u043e\u0434 \u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430\u043c\u0438 \u0432 SwiftUI.<\/p>\n<\/blockquote>\n<p>\u0418\u0442\u0430\u043a, \u0435\u0441\u043b\u0438 \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0435\u0440 \u043d\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0443, \u0442\u043e \u0433\u0434\u0435 \u0436\u0435 \u043e\u043d\u0430? \u042d\u0442\u043e \u0437\u0430\u0434\u0430\u0447\u0430 \u0434\u043b\u044f \u0434\u043e\u043c\u0435\u043d\u043d\u043e\u0433\u043e \u0441\u043b\u043e\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0431\u044b\u0447\u043d\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0441\u0435\u0440\u0432\u0438\u0441\u044b, \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u044b \u0438 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u044b. \u0423 \u043d\u0438\u0445 \u0432\u0441\u0435\u0445 \u043e\u0447\u0435\u043d\u044c \u0441\u0445\u043e\u0436\u0435\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435, \u0438 \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u043c\u0435\u0436\u0434\u0443 \u043d\u0438\u043c\u0438 \u0434\u043e \u0441\u0438\u0445 \u043f\u043e\u0440 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0435\u0434\u043c\u0435\u0442\u043e\u043c \u0434\u0438\u0441\u043a\u0443\u0441\u0441\u0438\u0439. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c <code>OnboardingProvider<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0432\u0441\u044e \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0443 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u043e\u043d\u0431\u043e\u0440\u0434\u0438\u043d\u0433\u0430.<\/p>\n<pre><code class=\"swift\">class OnboardingProvider: ObservableObject {          init() {         loadFilledOnboardingFromDefaults()     }          \/\/ MARK: Interface  @Published private(set) var needsOnboarding: Bool = true          private(set) var filledOnboarding: FilledQuestionary? {         didSet {             if let filledOnboarding {                 saveFilledOnboardingToDefaults(filledQuestionary: filledOnboarding)             }         }     }          func getOnboardingQuestionary() -> Questionary {         \/\/ NOTE: it's better to take the questions from the backend         Questionary(questions: [             Question(text: \"sex\"),             Question(text: \"age\"),             Question(text: \"weight\"),             Question(text: \"height\"),             Question(text: \"special_conditions\"),         ])     }          func saveOnboardingAnswers(filledQuestionary: FilledQuestionary) {         needsOnboarding = false         filledOnboarding = filledQuestionary     }          \/\/ MARK: - Private          private func saveFilledOnboardingToDefaults(filledQuestionary: FilledQuestionary) {         UserDefaults.standard.removeObject(forKey: \"filledOnboarding\")         let encoder = JSONEncoder()         let encoded = try! encoder.encode(filledQuestionary)         UserDefaults.standard.set(encoded, forKey: \"filledOnboarding\")     }          private func loadFilledOnboardingFromDefaults() {         guard let object = UserDefaults.standard.object(forKey: \"filledOnboarding\") else {             needsOnboarding = true             return         }         let savedFilledQuestionary = object as! Data         let decoder = JSONDecoder()         let loadedQuestionary = try! decoder.decode(FilledQuestionary.self, from: savedFilledQuestionary)         self.filledOnboarding = loadedQuestionary         self.needsOnboarding = false     } } <\/code><\/pre>\n<p>\u041e\u043f\u044f\u0442\u044c \u0436\u0435, \u043e\u043d \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u0443 \u0437\u0430\u0434\u0430\u0447\u0443: \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u043e\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 onboarding. \u0422\u0430\u043a\u0430\u044f <em>\u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u044f\u0446\u0438\u044f<\/em> \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0434\u0440\u0443\u0433\u0438\u043c \u043a\u043b\u0430\u0441\u0441\u0430\u043c \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0441 \u043d\u0438\u043c \u0431\u0435\u0437 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0431\u0435\u0441\u043f\u043e\u043a\u043e\u0438\u0442\u044c\u0441\u044f \u043e \u0434\u0435\u0442\u0430\u043b\u044f\u0445 \u0435\u0433\u043e \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u0447\u0442\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u0441\u0442\u0432\u0443\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u0431\u043e\u043b\u0435\u0435 \u0447\u0438\u0441\u0442\u043e\u0439 \u0438 \u0443\u0434\u043e\u0431\u043d\u043e\u0439 \u043a\u043e\u0434\u043e\u0432\u043e\u0439 \u0431\u0430\u0437\u044b.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u043e\u0431\u0435\u0440\u0435\u043c \u0432\u0441\u0435 \u0432\u043c\u0435\u0441\u0442\u0435 \u0432 \u043a\u043e\u0440\u043d\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<pre><code class=\"swift\">import SwiftUI  @main struct HouseMDAI: App {          @StateObject private var onboardingProvider: OnboardingProvider     @StateObject private var onboardingPresenter: OnboardingPresenter     @StateObject private var homePresenter: HomePresenter          init() {         let onboardingProvider = OnboardingProvider()                  let onboardingPresenter = OnboardingPresenter(             questions: onboardingProvider.getOnboardingQuestionary(),             answers: FilledQuestionary(filledQuestions: [:]),             completion: onboardingProvider.saveOnboardingAnswers         )                  let doctor = BackendDoctorProvider(baseUrl: \"http:\/\/localhost:8000\")         let homePresenter = HomePresenter(doctor: doctor)                  _onboardingProvider = StateObject(wrappedValue: onboardingProvider)         _onboardingPresenter = StateObject(wrappedValue: onboardingPresenter)         _homePresenter = StateObject(wrappedValue: homePresenter)     }          var body: some Scene {         WindowGroup {             if onboardingProvider.needsOnboarding {                 OnboardingView(presenter: onboardingPresenter)             } else {                 TabView {                     HomeView(presenter: homePresenter)                     if let profile = onboardingProvider.filledOnboarding {                         ProfileView(profile: profile)                     }                 }             }         }     } \/\/ body } <\/code><\/pre>\n<p>\u042d\u0442\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 SwiftUI \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u0441\u0432\u043e\u0435 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043e\u0431\u0435\u0440\u0442\u043e\u043a \u043f\u043e\u043b\u0435\u0439 <code>StateObject<\/code>. \u041e\u043d\u043e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442 <code>OnboardingProvider<\/code>, <code>OnboardingPresenter<\/code> \u0438 <code>HomePresenter<\/code> \u0432 \u0441\u0432\u043e\u0435\u043c \u043c\u0435\u0442\u043e\u0434\u0435 init. \u041f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440 <code>OnboardingProvider<\/code> \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u043c\u0438, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u043c\u0438 \u0441 \u043e\u043d\u0431\u043e\u0440\u0434\u0438\u043d\u0433\u043e\u043c, \u0430 <code>OnboardingPresenter<\/code> \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u043b\u043e\u0433\u0438\u043a\u043e\u0439 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043e\u043d\u0431\u043e\u0440\u0434\u0438\u043d\u0433\u0430. <code>HomePresenter<\/code> \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0433\u043b\u0430\u0432\u043d\u044b\u043c \u0434\u043e\u043c\u0430\u0448\u043d\u0438\u043c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c.<\/p>\n<p>\u0412 \u0442\u0435\u043b\u0435 \u0441\u0446\u0435\u043d\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f, \u043d\u0443\u0436\u043d\u0430 \u043b\u0438 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u043d\u0430 \u0441\u0430\u0439\u0442\u0435. \u0415\u0441\u043b\u0438 \u0434\u0430, \u0442\u043e \u043e\u043d\u0430 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 <code>OnboardingView<\/code> \u0441 <code>OnboardingPresenter<\/code>. \u0412 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u043d\u0430 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 <code>TabView<\/code>, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 <code>HomeView<\/code> \u0441 <code>HomePresenter<\/code> \u0438, \u0435\u0441\u043b\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e, <code>ProfileView<\/code>.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0441\u0442\u0430\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u0434\u043b\u044f \u0434\u043e\u043c\u0430\u0448\u043d\u0435\u0433\u043e \u044d\u043a\u0440\u0430\u043d\u0430. \u041b\u043e\u0433\u0438\u043a\u0430 \u043f\u0440\u043e\u0441\u0442\u0430:<\/p>\n<ol>\n<li>\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f<\/p>\n<\/li>\n<li>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435, \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432 \u0438\u0437 \u0431\u044d\u043a\u0435\u043d\u0434\u0430<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u0443\u044e push-\u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044e.<\/p>\n<\/li>\n<li>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043e\u0442\u0432\u0435\u0442\u044b \u043a \u0437\u0430\u043f\u0440\u043e\u0441\u0443 \u0438 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u043c 2-4, \u043f\u043e\u043a\u0430 \u0431\u044d\u043a\u0435\u043d\u0434-\u0434\u043e\u043a\u0442\u043e\u0440 \u043d\u0435 \u0432\u0435\u0440\u043d\u0435\u0442 \u043e\u043a\u043e\u043d\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"swift\">struct HomeView: View {          @StateObject var presenter: HomePresenter          var body: some View {         NavigationStack(path: $presenter.navigationPath) {             VStack {             \/\/ 1                 Text(\"How are you?\")                 TextField(\"...\", text: $presenter.message)                     .lineLimit(5...10)                     .formItem()  \/\/ 2                 Button(\"Send\", action: presenter.onSend)             }             .padding()             .navigationDestination(for: NavigationPage.self) { page in                 switch page {                 case .questinary(let questions, let answers):                 \/\/ 3                     QuestionaryView(                         presenter: QuestionaryPresenter(                             questions: questions,                             answers: answers,                             completion: presenter.onQuestionaryFilled                         )                     )                 case .answer(let string):                 \/\/ 5                     VStack {                         Text(\"The doctor says...\")                         Text(string)                             .font(.title2)                             .padding()                     }                 }             }         }     } } <\/code><\/pre>\n<p>\u041f\u043e\u0445\u043e\u0436\u0435, \u044f \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u043b 4-\u0439 \u043f\u0443\u043d\u043a\u0442&#8230; \u0438\u043b\u0438 \u043d\u0435\u0442? \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u043d\u0438\u043a\u0430\u043a\u043e\u0439 \u043b\u043e\u0433\u0438\u043a\u0438, \u044d\u0442\u0443 \u0447\u0430\u0441\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0435\u0433\u043e \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0435\u0440.<\/p>\n<pre><code class=\"swift\">enum NavigationPage: Hashable {     case questinary(Questionary, FilledQuestionary)     case answer(String) }  class HomePresenter: ObservableObject {          @Published var message: String = \"\"     @Published var navigationPath: [NavigationPage] = []          init(message: String = \"\") {         self.message = message     }          func onSend() {         Task {             let doctor = BackendDoctorProvider()             let answer = try! await doctor.sendMessage(message: message)                          switch answer {             case .questions(let questions):                 navigationPath.append(.questinary(questions, FilledQuestionary(filledQuestions: [:])))             case .answer(let string):                 navigationPath.append(.answer(string))             }         }     }          func onQuestionaryFilled(filled: FilledQuestionary) {         Task {             let doctor = BackendDoctorProvider()             let answer = try! await doctor.sendAnswers(message: message, answers: filled)                          switch answer {             case .questions(let newQuestions):                 navigationPath.append(.questinary(newQuestions, filled))             case .answer(let string):                 navigationPath.append(.answer(string))             }         }     } } <\/code><\/pre>\n<p>\u041e\u043d \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0432\u0432\u043e\u0434\u043e\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c \u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442 \u043f\u0443\u0442\u044c \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043e\u0442\u0432\u0435\u0442\u043e\u0432 \u043e\u0442 \u0431\u044d\u043a\u0435\u043d\u0434\u0430.<\/p>\n<p>\u041f\u0440\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043c\u0435\u0442\u043e\u0434 <code>onSend()<\/code> \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0435\u0433\u043e \u043d\u0430 \u0431\u044d\u043a\u0435\u043d\u0434 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>DoctorProvider<\/code> \u0438 \u043e\u0436\u0438\u0434\u0430\u0435\u0442 \u043e\u0442\u0432\u0435\u0442\u0430. \u0412 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u0438\u043f\u0430 \u043e\u0442\u0432\u0435\u0442\u0430 \u043e\u043d \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u043f\u0443\u0442\u044c, \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u044f \u043b\u0438\u0431\u043e \u043d\u0430\u0431\u043e\u0440 \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432, \u043b\u0438\u0431\u043e \u043e\u043a\u043e\u043d\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043e\u0442\u0432\u0435\u0442.<\/p>\n<p>\u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e, \u043a\u043e\u0433\u0434\u0430 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0432\u043e\u043f\u0440\u043e\u0441\u043d\u0438\u043a, \u043c\u0435\u0442\u043e\u0434 <code>onQuestionaryFilled()<\/code> \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u044b\u0439 \u0432\u043e\u043f\u0440\u043e\u0441\u043d\u0438\u043a \u043d\u0430 \u0431\u044d\u043a\u0435\u043d\u0434 \u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442 \u043f\u0443\u0442\u044c \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438.<\/p>\n<p>\u0417\u0434\u0435\u0441\u044c \u0435\u0441\u0442\u044c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u0434\u0430 \u043c\u0435\u0436\u0434\u0443 \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438 <code>onSend()<\/code> \u0438 <code>onQuestionaryFilled()<\/code>, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u043e\u0442\u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u043e\u0434\u0438\u043d \u043c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043e\u0431\u043e\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432. \u041e\u0434\u043d\u0430\u043a\u043e \u043e\u0441\u0442\u0430\u0432\u0438\u043c \u044d\u0442\u043e \u043a\u0430\u043a \u0443\u043f\u0440\u0430\u0436\u043d\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0439 \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u043a\u0438.<\/p>\n<p>\u041c\u043e\u0434\u0443\u043b\u044c Questionary (View+Presenter) \u043f\u043e\u0447\u0442\u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u043e\u043f\u0438\u0435\u0439 Onboarding \u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u0435\u043b\u0435\u0433\u0438\u0440\u0443\u0435\u0442 \u043b\u043e\u0433\u0438\u043a\u0443 \u0434\u043e <code>HomePresenter<\/code>, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u043d\u0435 \u0432\u0438\u0436\u0443 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043a\u043e\u0434. \u041e\u043f\u044f\u0442\u044c \u0436\u0435, \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0435\u0441\u0442\u044c github.<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435, \u0447\u0442\u043e \u044f \u0445\u043e\u0447\u0443 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c, \u044d\u0442\u043e \u0434\u0432\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 <code>DoctorProvider<\/code>, \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u043e\u0431\u044f\u0437\u0430\u043d\u043d\u043e\u0441\u0442\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u044b\u0437\u043e\u0432 API \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0442 <code>DoctorResponse<\/code>.<\/p>\n<pre><code class=\"swift\">protocol DoctorProvider {     func sendMessage(message: String) async throws -> DoctorResponse     func sendAnswers(message: String, answers: FilledQuestionary) async throws -> DoctorResponse }  enum DoctorResponse {     case questions(Questionary)     case answer(String) }<\/code><\/pre>\n<p>\u041f\u0435\u0440\u0432\u0430\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043d\u0430\u0448 \u0431\u044d\u043a\u0435\u043d\u0434:<\/p>\n<pre><code class=\"swift\">class BackendDoctorProvider: DoctorProvider {          private let baseUrl: String          init(baseUrl: String) {         self.baseUrl = baseUrl     }          func sendMessage(message: String) async throws -> DoctorResponse {         try! await sendAnswers(message: message, answers: FilledQuestionary(filledQuestions: [:]))     }          func sendAnswers(message: String, answers: FilledQuestionary) async throws -> DoctorResponse {                  struct DoctorParams: Codable {             var message: String             var userCard: [String: String]             var filledQuestionary: FilledQuestionary         }                  let onboard = OnboardingProvider() \/\/ TODO: DI                      let paramsObject = DoctorParams(             message: message,             userCard: onboard.filledOnboarding!.filledQuestions,             filledQuestionary: answers         )                  let encoder = JSONParameterEncoder.default         encoder.encoder.keyEncodingStrategy = .convertToSnakeCase                  let responseString = try await AF.request(             baseUrl + \"\/doctor\",              method: .post,             parameters: paramsObject,             encoder: encoder         ).serializingString().value                  return try! DoctorResponse(from: responseString)     } }<\/code><\/pre>\n<p>\u0412\u0442\u043e\u0440\u0430\u044f \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 openai api \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e (\u043f\u043e\u0434\u0445\u043e\u0434 backendless) \u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043a\u043e\u043f\u0438\u0435\u0439 \u043c\u043e\u0434\u0443\u043b\u044f \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u043e\u043a \u0438\u0437 \u0431\u044d\u043a\u0435\u043d\u0434\u0430.<\/p>\n<pre><code class=\"swift\">class PromptsProvider {          private(set) public var homeRole = \"\" \/\/ TODO: take from the backend          func message(message: String) -> String {         return message     }          func profile(profile: FilledQuestionary) -> String {         return try! jsonify(object: profile)     }          func answers(filled: FilledQuestionary) -> String {         return try! jsonify(object: filled)     }          \/\/ MARK: - Private          private func jsonify(object: Encodable) throws -> String {         let coder = JSONEncoder()         return String(data: try coder.encode(object), encoding: .utf8) ?? \"\"     } }  class DirectDoctorProvider: DoctorProvider {          private var openAI: OpenAI          init(apiToken: String) {         openAI = OpenAI(apiToken: apiToken)     }          func sendMessage(message: String) async throws -> DoctorResponse {         try! await sendAnswers(message: message, answers: FilledQuestionary(filledQuestions: [:]))     }          func sendAnswers(message: String, answers: FilledQuestionary) async throws -> DoctorResponse {         let promptProvider = PromptsProvider() \/\/ TODO: DI         let profile = OnboardingProvider().filledOnboarding! \/\/ TODO: DI                  let query = ChatQuery(model: .gpt3_5Turbo, messages: [             Chat(role: .system, content: promptProvider.homeRole),             Chat(role: .user, content: promptProvider.profile(profile: profile)),             Chat(role: .user, content: promptProvider.message(message: message)),             Chat(role: .user, content: promptProvider.answers(filled: answers)),         ])                  let result = try await openAI.chats(query: query)         return try! DoctorResponse(from: result.choices[0].message.content ?? \"\")     } }<\/code><\/pre>\n<p>\u041e\u0431\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043b\u0435\u0433\u043a\u043e \u0432\u0437\u0430\u0438\u043c\u043e\u0437\u0430\u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0438\u043d\u044a\u0435\u043a\u0446\u0438\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439:<\/p>\n<pre><code class=\"swift\">let doctor = BackendDoctorProvider(baseUrl: \"http:\/\/localhost:8000\") let homePresenter = HomePresenter(doctor: doctor)<\/code><\/pre>\n<pre><code class=\"swift\">let doctor = DirectDoctorProvider(apiToken: \"\") let homePresenter = HomePresenter(doctor: doctor)<\/code><\/pre>\n<h4>\u0414\u0440\u0443\u0433\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440<\/h4>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440 \u044d\u0442\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u0432 \u0434\u0440\u0443\u0433\u043e\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u0432 \u043c\u043e\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 TwiTreads \u043d\u0430 <a href=\"https:\/\/github.com\/MarkParker5\/TwiTreads\" rel=\"noopener noreferrer nofollow\">github.com\/MarkParker5\/TwiTreads<\/a><\/p>\n<h4>\u0427\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0434\u0430\u043b\u044c\u0448\u0435<\/h4>\n<ul>\n<li>\n<p>\u0418\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u0443\u0439\u0442\u0435 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e \u0438 \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0432 \u0431\u044d\u043a\u0435\u043d\u0434. \u041c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u0448\u0430\u0431\u043b\u043e\u043d FastAPI \u0438\u0437 <a href=\"https:\/\/fastapi.tiangolo.com\/project-generation\" rel=\"noopener noreferrer nofollow\">FastAPI Project Generation<\/a>.<\/p>\n<\/li>\n<li>\n<p>\u0420\u0435\u0430\u043b\u0438\u0437\u0443\u0439\u0442\u0435 \u043b\u043e\u0433\u0438\u043a\u0443 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438.<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0441\u0440\u0435\u0434\u043e\u0442\u043e\u0447\u044c\u0442\u0435\u0441\u044c \u043d\u0430 \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u0438 \u0434\u0438\u0437\u0430\u0439\u043d\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0432\u044b\u0441\u0438\u0442\u044c \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u043e \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043d\u0438\u043c. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043a\u0440\u0430\u0441\u0438\u0432\u044b\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f!<\/p>\n<\/li>\n<\/ul>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>\u041f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u044b \u0438 \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u043a\u043e\u0434 \u0441\u043b\u0443\u0436\u0430\u0442 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438, \u0447\u0442\u043e\u0431\u044b \u0434\u0430\u0442\u044c \u0442\u043e\u043b\u0447\u043e\u043a \u0432\u0430\u0448\u0435\u0439 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435. \u041f\u043e\u043c\u043d\u0438\u0442\u0435, \u0447\u0442\u043e \u043a\u0440\u0430\u0441\u043e\u0442\u0430 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u044f\u0445. \u041d\u0430\u0447\u043d\u0438\u0442\u0435 \u0441 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e, \u0441\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043f\u0440\u043e\u0442\u043e\u0442\u0438\u043f \u0438 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u0441\u0442\u0432\u0443\u0439\u0442\u0435 \u0435\u0433\u043e.<\/p>\n<hr\/>\n<p>\u041e \u0434\u0440\u0443\u0433\u0438\u0445 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 \u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0438\u0448\u0443 \u0432\u00a0<a href=\"https:\/\/t.me\/parker_is_typing\" rel=\"noopener noreferrer nofollow\">\u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c<\/a>.<\/p>\n<hr\/>\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\/816345\/\"> https:\/\/habr.com\/ru\/articles\/816345\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0435 \u0441\u0442\u0430\u0442\u044c\u0438:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/articles\/816327\/\" rel=\"noopener noreferrer nofollow\">\u041a\u0430\u043a \u043c\u044b \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u043b\u0438 \u0418\u0418-\u0441\u0442\u0430\u0440\u0442\u0430\u043f \u043d\u0430 \u0445\u0430\u043a\u0430\u0442\u043e\u043d\u0435 \u0432\u044b\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u0434\u043d\u044f \u0432 \u0413\u0435\u0440\u043c\u0430\u043d\u0438\u0438<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/markparker.me\/blog\/house-md-ai-diagnostician-in-your-phone-passing-the-torch-and-entrusting-a-startup-to-capable-hands\" rel=\"noopener noreferrer nofollow\">House, MD &#8212; AI Diagnostician in Your Phone: Passing the Startup Torch<\/a><\/p>\n<\/li>\n<\/ul>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0442\u043e\u043d\u043a\u043e\u0441\u0442\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f Proof of Concept (PoC) \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0433\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 SwiftUI \u0438 \u0431\u044d\u043a\u0435\u043d\u0434\u0430 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c FastAPI. \u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u044f \u043f\u0440\u043e\u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u044e \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u044b\u0435 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u044b\u0435 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u044b \u0434\u043b\u044f SwiftUI-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u0432 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438 MVVMP \u0432 \u0441\u043e\u0447\u0435\u0442\u0430\u043d\u0438\u0438 \u0441 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0430\u043c\u0438 SOLID \u0438 Dependency Injection (DI). \u0414\u043b\u044f android \u043a\u043e\u0434 \u043c\u043e\u0436\u043d\u043e \u043b\u0435\u0433\u043a\u043e \u043f\u0435\u0440\u0435\u0432\u0435\u0441\u0442\u0438 \u043d\u0430 Kotlin \u0441 Jetpack Compose.<\/p>\n<h3>\u0417\u0430\u0447\u0435\u043c \u043d\u0430\u043c \u043d\u0443\u0436\u0435\u043d \u0431\u044d\u043a\u0435\u043d\u0434<\/h3>\n<p>\u041a\u0442\u043e-\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0437\u0430\u043f\u0438\u0445\u043d\u0443\u0442\u044c \u0432\u0441\u044e \u043b\u043e\u0433\u0438\u043a\u0443 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0432 chatgpt \u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0431\u0435\u0437 \u0431\u044d\u043a\u0435\u043d\u0434\u0430. \u0418 \u044f \u0441\u043e\u0433\u043b\u0430\u0441\u0435\u043d, \u044d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043d\u043e \u0431\u044d\u043a\u0435\u043d\u0434 \u0434\u0430\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0430\u0436\u043d\u044b\u0445 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432.<\/p>\n<p>\u0411\u044d\u043a\u0435\u043d\u0434 \u0441\u043b\u0443\u0436\u0438\u0442 \u043e\u0441\u043d\u043e\u0432\u043e\u0439 \u0434\u043b\u044f \u043b\u044e\u0431\u043e\u0433\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0434\u043b\u044f \u0442\u0435\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0442\u0440\u0435\u0431\u0443\u044e\u0442 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0433\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u043c\u0438, \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0438 \u0438 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432. \u0412\u043e\u0442 \u043f\u043e\u0447\u0435\u043c\u0443 \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0431\u044d\u043a\u044d\u043d\u0434 \u0438\u043c\u0435\u0435\u0442 \u0440\u0435\u0448\u0430\u044e\u0449\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435:<\/p>\n<ol>\n<li>\n<p><strong>\u0411\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c<\/strong>: \u0411\u044d\u043a\u044d\u043d\u0434 \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0437\u0430\u0449\u0438\u0442\u0438\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0434\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438 \u0442\u043e\u043a\u0435\u043d\u044b \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u043e\u0442 \u0430\u0442\u0430\u043a \u0442\u0438\u043f\u0430 MITM (Man-in-the-Middle). \u041e\u043d \u0432\u044b\u0441\u0442\u0443\u043f\u0430\u0435\u0442 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0437\u0430\u0449\u0438\u0449\u0435\u043d\u043d\u043e\u0433\u043e \u0448\u043b\u044e\u0437\u0430 \u043c\u0435\u0436\u0434\u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u043c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e\u043c \u0438 \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u043b\u0438 \u0432\u043d\u0435\u0448\u043d\u0438\u043c\u0438 \u0441\u043b\u0443\u0436\u0431\u0430\u043c\u0438, \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044f \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0438 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e \u0432\u0441\u0435\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u0430 \u0442\u0430\u043a \u0436\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0432 \u0442\u0430\u0439\u043d\u0435 api \u043a\u043b\u044e\u0447\u0438.<\/p>\n<\/li>\n<li>\n<p><strong>\u041a\u043e\u043d\u0442\u0440\u043e\u043b\u044c \u043d\u0430\u0434 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432<\/strong>: \u0423\u043f\u0440\u0430\u0432\u043b\u044f\u044f API \u0438 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435\u043c \u0441 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c\u0438 \u0447\u0435\u0440\u0435\u0437 \u0431\u044d\u043a\u044d\u043d\u0434, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0442\u044c \u0438 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u042d\u0442\u043e \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u044f \u0434\u0440\u043e\u0441\u0441\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u043e\u0439, \u043f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u0437\u043b\u043e\u0443\u043f\u043e\u0442\u0440\u0435\u0431\u043b\u0435\u043d\u0438\u0439 \u0438 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432.<\/p>\n<\/li>\n<li>\n<p><strong>\u0418\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u0441 \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445<\/strong>: \u0411\u044d\u043a\u044d\u043d\u0434 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0431\u0435\u0441\u0448\u043e\u0432\u043d\u0443\u044e \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044e \u0441 \u0431\u0430\u0437\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044f \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438 \u0445\u0440\u0430\u043d\u0438\u0442\u044c, \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0442\u044c \u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438. \u042d\u0442\u043e \u0432\u0430\u0436\u043d\u043e \u0434\u043b\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0442\u0440\u0435\u0431\u0443\u044e\u0442 \u0443\u0447\u0435\u0442\u043d\u044b\u0445 \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439, \u0445\u0440\u0430\u043d\u044f\u0442 \u0438\u0445 \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0442\u0435\u043d\u0438\u044f \u0438\u043b\u0438 \u043d\u0443\u0436\u0434\u0430\u044e\u0442\u0441\u044f \u0432 \u0431\u044b\u0441\u0442\u0440\u043e\u043c \u0438 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u043c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0438 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043e\u0431\u044a\u0435\u043c\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<\/li>\n<li>\n<p><strong>\u041c\u043e\u0434\u0435\u043b\u0438 \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0438 \u0438 Freemium<\/strong>: \u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0443\u0441\u043b\u0443\u0433 \u043f\u043e \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0435 \u0438\u043b\u0438 \u043c\u043e\u0434\u0435\u043b\u0438 freemium \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043d\u0430\u043b\u0438\u0447\u0438\u044f \u0431\u044d\u043a\u0435\u043d\u0434\u0430 \u0434\u043b\u044f \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0447\u0435\u0442\u043e\u0432, \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u043d\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0443\u0440\u043e\u0432\u043d\u044f\u043c\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439. \u0411\u044d\u043a\u044d\u043d\u0434 \u043c\u043e\u0436\u0435\u0442 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043f\u043b\u0430\u0442\u0435\u0436\u0438 \u0438 \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0438, \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044f \u0431\u0435\u0441\u043f\u0435\u0440\u0435\u0431\u043e\u0439\u043d\u0443\u044e \u0440\u0430\u0431\u043e\u0442\u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0438 \u0441\u043e\u0431\u043b\u044e\u0434\u0430\u044f \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u043e \u0437\u0430\u0449\u0438\u0442\u0435 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<\/li>\n<li>\n<p><strong>\u041c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u0435\u043c\u043e\u0441\u0442\u044c \u0438 \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u043d\u0438\u0435<\/strong>: \u0411\u044d\u043a\u044d\u043d\u0434 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u041b\u043e\u0433\u0438\u043a\u0443 \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c \u0431\u0435\u0437 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u0443, \u0447\u0442\u043e \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442 \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u043d\u0438\u0435 \u0438 \u0443\u0441\u043a\u043e\u0440\u044f\u0435\u0442 \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u0435 \u043d\u043e\u0432\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439.<\/p>\n<\/li>\n<\/ol>\n<p>\u041f\u043e \u0441\u0443\u0442\u0438, \u0431\u044d\u043a\u0435\u043d\u0434 \u2014 \u044d\u0442\u043e \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c, \u043d\u043e \u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0439, \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u0435\u043c\u043e\u0439 \u0438 \u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u043e\u0439 \u0441\u0440\u0435\u0434\u044b \u0434\u043b\u044f \u043f\u0440\u043e\u0446\u0432\u0435\u0442\u0430\u043d\u0438\u044f \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<h3>\u041e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u0435 \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0441\u0442\u0435\u043a\u0430<\/h3>\n<ul>\n<li>\n<p><strong>SwiftUI<\/strong>: \u041b\u0443\u0447\u0448\u0438\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0434\u043b\u044f \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0434\u043b\u044f iOS \u043f\u043e\u0441\u043b\u0435 \u0432\u044b\u0445\u043e\u0434\u0430 UIKit. \u041e\u043d \u0434\u0435\u043a\u043b\u0430\u0440\u0430\u0442\u0438\u0432\u0435\u043d \u0438 \u0443\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0435\u043d, \u0430 XCode \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0435\u0437\u0430\u043c\u0435\u043d\u0438\u043c\u044b\u043c \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u043e\u043c \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u044d\u043f\u043b. \u0414\u043b\u044f android \u043a\u043e\u0434 \u043c\u043e\u0436\u043d\u043e \u043b\u0435\u0433\u043a\u043e \u043f\u0435\u0440\u0435\u0432\u0435\u0441\u0442\u0438 \u043d\u0430 Kotlin \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Jetpack Compose.<\/p>\n<\/li>\n<li>\n<p><strong>FastAPI<\/strong>: \u0412\u044b\u0431\u0440\u0430\u043d \u0434\u043b\u044f \u0431\u044d\u043a\u0435\u043d\u0434\u0430 \u0437\u0430 \u0435\u0433\u043e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c, \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 \u0438 \u0434\u0435\u043a\u043b\u0430\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c, \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0440\u0435\u0432\u043e\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e Zed.dev.<\/p>\n<\/li>\n<li>\n<p><strong>ChatGPT API<\/strong>: \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u044f\u0437\u044b\u043a\u043e\u0432\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 (LLM); \u0432\u044b\u0431\u043e\u0440 \u043c\u043e\u0436\u0435\u0442 \u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043a\u0430\u0441\u0442\u043e\u043c\u0438\u0437\u0430\u0446\u0438\u0438.<\/p>\n<\/li>\n<li>\n<p><strong>Ngrok<\/strong>: \u0420\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u0442\u0443\u043d\u043d\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b CLI \u0434\u043b\u044f \u0432\u044b\u0445\u043e\u0434\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442.<\/p>\n<\/li>\n<\/ul>\n<h3>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u043b\u044f iOS<\/h3>\n<h4>\u0422\u0435\u043e\u0440\u0438\u044f: \u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u044b\u0435 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u044b<\/h4>\n<ol>\n<li>\n<p><strong>MVVMP (Model View ViewModel Presenter)<\/strong>:<\/p>\n<\/li>\n<\/ol>\n<ul>\n<li>\n<p><strong>Model<\/strong>: \u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a Question, Answer, Questionary \u0438 FilledQuestionary. \u042d\u0442\u0438 \u043c\u043e\u0434\u0435\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u044b \u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u0430\u043d\u043d\u044b\u0435, \u0441\u043b\u0435\u0434\u0443\u044f \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0443 KISS.<\/p>\n<\/li>\n<li>\n<p><strong>View<\/strong>: \u041e\u0442\u0432\u0435\u0447\u0430\u044e\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0437\u0430 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u0438 \u0434\u0435\u043b\u0435\u0433\u0438\u0440\u0443\u044e\u0442 \u0432\u0441\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438 \u043b\u043e\u0433\u0438\u043a\u0443 \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0435\u0440\u0430\u043c. \u041e\u043d\u0438 \u043d\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u043d\u0438\u043a\u0430\u043a\u043e\u0439 \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0438 \u0438 \u0441\u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u0431\u044b\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u044b\u043c\u0438 \u0438 \u0441\u043e\u0441\u0440\u0435\u0434\u043e\u0442\u043e\u0447\u0435\u043d\u043d\u044b\u043c\u0438 \u043d\u0430 \u0440\u0435\u043d\u0434\u0435\u0440\u0435 UI.<\/p>\n<\/li>\n<li>\n<p><strong>ViewModel<\/strong>: \u0412 SwiftUI ViewModel \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c ObservableObject, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043b\u0443\u0436\u0438\u0442 \u043c\u043e\u0434\u0435\u043b\u044c\u044e \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u044f \u0437\u0430 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438. \u0417\u0434\u0435\u0441\u044c \u043d\u0435\u0442 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0438 \u043b\u043e\u0433\u0438\u043a\u0438.<\/p>\n<\/li>\n<li>\n<p><strong>Presenter<\/strong>: Presenter \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0432\u0441\u0435\u0439 \u043b\u043e\u0433\u0438\u043a\u043e\u0439, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u043e\u0439 \u0441 \u043c\u043e\u0434\u0443\u043b\u0435\u043c (\u044d\u043a\u0440\u0430\u043d\u043e\u043c \u0438\u043b\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c), \u043d\u043e \u043d\u0435 \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u043e\u0439. \u041e\u043d \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u0442 \u0441 \u0434\u043e\u043c\u0435\u043d\u043d\u044b\u043c \u0441\u043b\u043e\u0435\u043c \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0438, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441 API \u0438\u043b\u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<\/li>\n<li>\n<p><strong>Domain Layer<\/strong>: \u042d\u0442\u043e\u0442 \u0441\u043b\u043e\u0439 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u0442 \u0441 \u0432\u043d\u0435\u0448\u043d\u0438\u043c\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c\u0438, \u0442\u0430\u043a\u0438\u043c\u0438 \u043a\u0430\u043a \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445, API \u0438\u043b\u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u044b. \u041e\u043d \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a \u0441\u0435\u0440\u0432\u0438\u0441\u044b, \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u044b, \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u044b, \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438, \u043c\u0430\u043f\u043f\u0435\u0440\u044b, \u0444\u0430\u0431\u0440\u0438\u043a\u0438 \u0438 \u0442. \u0434.<\/p>\n<\/li>\n<li>\n<p>\u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, MP \u0432 MVVMP \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0430\u043c\u0438 \u041c\u0430\u0440\u043a\u0430 \u041f\u0430\u0440\u043a\u0435\u0440\u0430, \u0430 \u043f\u043e\u043b\u043d\u0430\u044f \u0444\u043e\u0440\u043c\u0430 \u2014 \u00abModel View ViewModel by Mark Parker\u00bb.<\/p>\n<\/li>\n<\/ul>\n<ol start=\"2\">\n<li>\n<p><strong>\u041f\u0440\u0438\u043d\u0446\u0438\u043f\u044b \u0421\u041e\u041b\u0418\u0414<\/strong>:<\/p>\n<ul>\n<li>\n<p><strong>\u041f\u0440\u0438\u043d\u0446\u0438\u043f \u0435\u0434\u0438\u043d\u043e\u0439 \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u0438<\/strong>: \u0423 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u0430 \u043f\u0440\u0438\u0447\u0438\u043d\u0430 \u0434\u043b\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439.<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u0438\u043d\u0446\u0438\u043f <strong>\u043e\u0442\u043a\u0440\u044b\u0442\u043e\u0441\u0442\u044c-\u0437\u0430\u043a\u0440\u044b\u0442\u043e\u0441\u0442\u044c<\/strong>: \u041a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u043e\u0442\u043a\u0440\u044b\u0442\u044b \u0434\u043b\u044f \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f, \u043d\u043e \u0437\u0430\u043a\u0440\u044b\u0442\u044b \u0434\u043b\u044f \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438.<\/p>\n<\/li>\n<li>\n<p><strong>\u041f\u0440\u0438\u043d\u0446\u0438\u043f \u0437\u0430\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u041b\u0438\u0441\u043a\u043e\u0432\u0430<\/strong>: \u041e\u0431\u044a\u0435\u043a\u0442\u044b \u0441\u0443\u043f\u0435\u0440\u043a\u043b\u0430\u0441\u0441\u0430 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u043c\u044b \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c\u0438 \u043f\u043e\u0434\u043a\u043b\u0430\u0441\u0441\u043e\u0432.<\/p>\n<\/li>\n<li>\n<p><strong>\u041f\u0440\u0438\u043d\u0446\u0438\u043f \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432<\/strong>: \u041d\u0438 \u043e\u0434\u0438\u043d \u043a\u043b\u0438\u0435\u043d\u0442 \u043d\u0435 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0432\u044b\u043d\u0443\u0436\u0434\u0435\u043d \u0437\u0430\u0432\u0438\u0441\u0435\u0442\u044c \u043e\u0442 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u043d \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442.<\/p>\n<\/li>\n<li>\n<p><strong>\u041f\u0440\u0438\u043d\u0446\u0438\u043f \u0438\u043d\u0432\u0435\u0440\u0441\u0438\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439<\/strong>: \u0417\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u043e\u0442 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u0439, \u0430 \u043d\u0435 \u043e\u0442 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u0438\u043a\u0438, \u0447\u0435\u043c\u0443 \u0441\u043f\u043e\u0441\u043e\u0431\u0441\u0442\u0432\u0443\u0435\u0442 DI.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u0418\u043d\u044a\u0435\u043a\u0446\u0438\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 (DI)<\/strong>: \u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c DI-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0434\u043b\u044f \u0441\u043e\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0430 \u0438\u043d\u0432\u0435\u0440\u0441\u0438\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439.<\/p>\n<\/li>\n<\/ol>\n<h3>\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0431\u044d\u043a\u0435\u043d\u0434\u0430<\/h3>\n<p>\u041a\u043e\u0434 <a href=\"https:\/\/github.com\/HouseMDAI\/house-backend\/blob\/master\/backend\" rel=\"noopener noreferrer nofollow\">\u0431\u044d\u043a\u0435\u043d\u0434\u0430<\/a> \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442. \u042d\u043d\u0434\u043f\u043e\u0438\u043d\u0442\u044b (<a href=\"http:\/\/main.py\" rel=\"noopener noreferrer nofollow\">main.py<\/a>):<\/p>\n<pre><code class=\"python\">from typing import Callable import json from fastapi import FastAPI, Body, Request, Response from .models import (Question, FilledQuestionary, DoctorResponseAnswer, DoctorResponseQuestionary) from .user_card import UserCardSimple from .prompting import get_response   @app.get(\"\/onboarding\", response_model = DoctorResponseQuestionary) def onboarding():     return DoctorResponseQuestionary(question=[Question(text=text) for text in UserCardSimple.__fields__.keys()])  @app.post(\"\/doctor\") def doctor(user_card: UserCardSimple, filled_questionary: FilledQuestionary, message: str = Body(...)):     json_string = get_response(user_card, message, filled_questionary)      loaded = json.loads(json_string.strip())     return loaded <\/code><\/pre>\n<p>&#171;onboarding&#187; \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043f\u0438\u0441\u043e\u043a \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432 \u0430\u043d\u0430\u043c\u043d\u0435\u0437\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043f\u0440\u0438 \u043f\u0435\u0440\u0432\u043e\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u041e\u0442\u0432\u0435\u0442\u044b \u0431\u0443\u0434\u0443\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u044b \u043d\u0430 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0435 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u044b \u0434\u043b\u044f \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0438 \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u043c. &#171;doctor&#187; \u2014 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442: \u043e\u043d \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u043e\u0442\u0432\u0435\u0442\u043e\u0432 \u0438 \u043a\u0430\u0440\u0442\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u043b\u0438\u0431\u043e \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0438.<\/p>\n<p>\u041c\u043e\u0434\u0435\u043b\u0438:<\/p>\n<pre><code class=\"python\">from pydantic import BaseModel   class Question(BaseModel):     text: str  class FilledQuestionary(BaseModel):     filled_questions: dict[str, str]  class DoctorResponseAnswer(BaseModel):     text: str  class DoctorResponseQuestionary(BaseModel):     questions: list[str]  class UserCardSimple(BaseModel):     sex: str     age: int     weight: int     height: int     special_conditions: str <\/code><\/pre>\n<p>\u041f\u0440\u043e\u043c\u043f\u0442\u044b:<\/p>\n<pre><code class=\"python\">import os from openai import OpenAI from .models import FilledQuestionary   api_key = os.environ.get(\"API_KEY\") client = OpenAI(api_key=api_key)  def get_response(user_card: str, message: str, filled_questionary: FilledQuestionary, max_tokens=200):     format_question = \"\"\"{\"questions\":[{\"text\":\"first question\"},{\"text\":\"second question\"}]}\"\"\"     format_advice = \"\"\"{\"text\":\"Advice: Drink more water\"}\"\"\"          system_prompt = f\"\"\"     You are a doctor that gives user an opportunity to swiftly check up health and diagnos an illness using anamnes and a short questionary.      Your task is to ask short questions and give your opinion and advices.     Your questions are accamulated in the filled questionary, which is empty in the first itteration.           Strive to about 1-2 questions per iteration and up to 6 questions in total (can be less). Questions must be short, clear, shouldn't repeat,      and should be relevant to the user's health condition, and should require easy answers.     Ask questions only in the json format {format_question}.      Number of answered questions: {len(filled_questionary.filled_questions)}     If the Number of answered questions is more then 6, you should stop asking questions an`d provide an give your final opinion,      an assumption or an advice in the json format {format_advice}.     \"\"\"          prompt = f\"\"\"request message: {message}; anamnesis: {user_card}; filled questionary: {filled_questionary};\"\"\"      chat_completion = client.chat.completions.create(         messages=[             {                 \"role\": \"system\",                 \"content\": f\"{system_prompt}\",             },             {                 \"role\": \"user\",                 \"content\": f\"{prompt}\",             },         ],         model=\"gpt-3.5-turbo\",         max_tokens=max_tokens     )     return chat_completion.choices[0].message.content <\/code><\/pre>\n<p>\u041c\u043e\u0434\u0443\u043b\u044c \u043f\u0440\u043e\u043c\u043f\u0442\u043e\u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 GPT-3.5 \u043e\u0442 OpenAI \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043e\u0442\u0432\u0435\u0442\u043e\u0432 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u0432\u0432\u043e\u0434\u0430, \u0430\u043d\u0430\u043c\u043d\u0435\u0437\u0430 \u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u044b\u0445 \u0430\u043d\u043a\u0435\u0442. \u041e\u043d \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u0438 \u0441\u043e\u0432\u0435\u0442\u044b \u043f\u043e \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0435 \u0437\u0434\u043e\u0440\u043e\u0432\u044c\u044f. \u041a\u0430\u043a \u0432\u0438\u0434\u0438\u0442\u0435, \u043d\u0438\u0447\u0435\u0433\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0433\u043e \u0437\u0434\u0435\u0441\u044c \u043d\u0435\u0442. \u041a\u043e\u0434 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0440\u0435\u043d, \u0430 \u043f\u0440\u043e\u043c\u043f\u0442\u044b &#8212; \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0430\u0431\u043e\u0440 \u0447\u0435\u0442\u043a\u0438\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439 \u0434\u043b\u044f LLM.<\/p>\n<p>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u0442\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u0441\u0435\u0440\u0432\u0435\u0440 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>fastapi dev main.py<\/code>.<\/p>\n<p>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438:<\/p>\n<ul>\n<li>\n<p><a href=\"http:\/\/fastapi.tiangolo.com\/tutorial\/first-steps\" rel=\"noopener noreferrer nofollow\">fastapi.tiangolo.com\/tutorial\/first-steps<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"http:\/\/pypi.org\/project\/openai\/\" rel=\"noopener noreferrer nofollow\">pypi.org\/project\/openai\/<\/a><\/p>\n<\/li>\n<\/ul>\n<h4>\u041e\u0442\u043a\u0440\u044b\u0442\u0438\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u043c\u0443 \u0445\u043e\u0441\u0442\u0443 \u0447\u0435\u0440\u0435\u0437 \u0418\u043d\u0442\u0435\u0440\u043d\u0435\u0442<\/h4>\n<ol>\n<li>\n<p>\u0417\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0439\u0442\u0435\u0441\u044c \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 <a href=\"http:\/\/ngrok.com\" rel=\"noopener noreferrer nofollow\">ngrok.com<\/a> \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 \u0442\u043e\u043a\u0435\u043d \u0434\u043e\u0441\u0442\u0443\u043f\u0430.<\/p>\n<\/li>\n<li>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 ngrok \u0441 \u0441\u0430\u0439\u0442\u0430 <a href=\"http:\/\/ngrok.com\/download\" rel=\"noopener noreferrer nofollow\">ngrok.com\/download<\/a>.<\/p>\n<\/li>\n<li>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <code>ngrok config add-authtoken &lt;TOKEN><\/code>.<\/p>\n<\/li>\n<li>\n<p>\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u044b <code>ngrok http http:\/\/localhost:8080<\/code> (\u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u0435 \u043f\u043e\u0440\u0442).<\/p>\n<\/li>\n<\/ol>\n<p>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u043f\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0432 <a href=\"https:\/\/ngrok.com\/docs\/getting-started\" rel=\"noopener noreferrer nofollow\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 ngrok<\/a>.<\/p>\n<h4>\u041a\u043e\u0434\u0438\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435<\/h4>\n<p>\u042f \u043d\u0435 \u0431\u0443\u0434\u0443 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0437\u0434\u0435\u0441\u044c \u0432\u0435\u0441\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434, \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0435\u0441\u0442\u044c GitHub. \u041d\u0430\u0439\u0442\u0438 \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443: <a href=\"https:\/\/github.com\/HouseMDAI\/house-ios\/blob\/main\/HouseMDAI\/Main\/HouseMDAI.swift\" rel=\"noopener noreferrer nofollow\">HouseMDAI iOS App<\/a>. \u0412\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e \u044f \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u044e\u0441\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u0432\u0430\u0436\u043d\u044b\u0445 (IMO) \u043c\u043e\u043c\u0435\u043d\u0442\u0430\u0445.<\/p>\n<p>\u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u043a\u0440\u0430\u0442\u043a\u043e\u0433\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447\u0438: \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u043c \u043f\u043e\u043b\u0435\u043c \u043d\u0430 \u0433\u043b\u0430\u0432\u043d\u043e\u043c \u044d\u043a\u0440\u0430\u043d\u0435,<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-378436","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/378436","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=378436"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/378436\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=378436"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=378436"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=378436"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}