@@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-30 20:55+0300\n" +"POT-Creation-Date: 2025-03-24 17:41+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -30,21 +30,21 @@ msgstr "" msgid "Achievements" msgstr "" -#: achievements/models.py:14 ml_model/models.py:12 ml_model/models.py:34 -#: ml_model/models.py:123 +#: achievements/models.py:14 ml_model/models.py:16 ml_model/models.py:38 +#: ml_model/models.py:145 msgid "Slug" msgstr "" -#: achievements/models.py:16 ml_model/models.py:32 ml_model/models.py:121 -#: ml_model/models.py:208 payments/models/payment.py:53 +#: achievements/models.py:16 ml_model/models.py:36 ml_model/models.py:143 +#: ml_model/models.py:232 payments/models/payment.py:53 msgid "Description" msgstr "" #: achievements/models.py:43 authentication/models/business_host.py:21 -#: authentication/models/email_token.py:12 authentication/models/user.py:203 -#: authentication/models/user.py:204 authentication/models/user_telegram.py:30 +#: authentication/models/email_token.py:12 authentication/models/user.py:229 +#: authentication/models/user.py:230 authentication/models/user_telegram.py:30 #: authentication/models/user_vk.py:12 payments/models/invoice.py:15 -#: payments/models/payment.py:26 payments/models/payment_plan.py:50 +#: payments/models/payment.py:26 payments/models/payment_plan.py:63 msgid "User" msgstr "" @@ -61,7 +61,7 @@ msgstr "" msgid "Issued achievement" msgstr "" -#: authentication/models/business_account.py:16 payments/models/promocode.py:68 +#: authentication/models/business_account.py:16 payments/models/promocode.py:69 #: tools/public_api/models.py:35 msgid "Owner" msgstr "" @@ -107,9 +107,9 @@ msgstr "" msgid "Child Business Accounts" msgstr "" -#: authentication/models/business_group.py:8 ml_model/models.py:11 -#: ml_model/models.py:31 ml_model/models.py:206 -#: payments/models/payment_plan.py:26 stories/models.py:12 stories/models.py:35 +#: authentication/models/business_group.py:8 ml_model/models.py:15 +#: ml_model/models.py:35 ml_model/models.py:230 +#: payments/models/payment_plan.py:28 stories/models.py:12 stories/models.py:35 #: tools/chats/models.py:9 msgid "Title" msgstr "" @@ -126,9 +126,9 @@ msgstr "" msgid "Affiliated by" msgstr "" -#: authentication/models/business_host.py:35 authentication/models/user.py:123 -#: authentication/models/whitelist.py:16 ml_model/models.py:103 -#: payments/models/promocode.py:82 +#: authentication/models/business_host.py:35 authentication/models/user.py:132 +#: authentication/models/whitelist.py:16 ml_model/models.py:125 +#: payments/models/promocode.py:83 msgid "Is active" msgstr "" @@ -164,7 +164,7 @@ msgstr "" msgid "PSRN" msgstr "" -#: authentication/models/business_host.py:73 ml_model/models.py:119 +#: authentication/models/business_host.py:73 ml_model/models.py:141 #: tools/public_api/models.py:31 msgid "Name" msgstr "" @@ -265,7 +265,7 @@ msgstr "" msgid "Security" msgstr "" -#: authentication/models/email_token.py:15 ml_model/models.py:210 +#: authentication/models/email_token.py:15 ml_model/models.py:234 msgid "Key" msgstr "" @@ -277,43 +277,43 @@ msgstr "" msgid "Email Tokens" msgstr "" -#: authentication/models/user.py:100 authentication/models/user_telegram.py:10 +#: authentication/models/user.py:109 authentication/models/user_telegram.py:10 msgid "First name" msgstr "" -#: authentication/models/user.py:107 authentication/models/user_telegram.py:13 +#: authentication/models/user.py:116 authentication/models/user_telegram.py:13 msgid "Last name" msgstr "" -#: authentication/models/user.py:110 authentication/models/user_telegram.py:16 +#: authentication/models/user.py:119 authentication/models/user_telegram.py:16 msgid "Username" msgstr "" -#: authentication/models/user.py:117 +#: authentication/models/user.py:126 msgid "Email" msgstr "" -#: authentication/models/user.py:125 +#: authentication/models/user.py:134 msgid "Is staff" msgstr "" -#: authentication/models/user.py:126 +#: authentication/models/user.py:135 msgid "Is superuser" msgstr "" -#: authentication/models/user.py:127 +#: authentication/models/user.py:136 msgid "Is email confirmed" msgstr "" -#: authentication/models/user.py:129 +#: authentication/models/user.py:138 msgid "Is subscribed" msgstr "" -#: authentication/models/user.py:136 +#: authentication/models/user.py:145 msgid "Picture name" msgstr "" -#: authentication/models/user.py:145 authentication/models/utm.py:21 +#: authentication/models/user.py:154 authentication/models/utm.py:21 msgid "UTM" msgstr "" @@ -400,11 +400,16 @@ msgstr "" msgid "Whitelists to cancel policies" msgstr "" -#: authentication/selectors/business_host_selector.py:47 +#: authentication/selectors/business_host_selector.py:38 +#: authentication/selectors/business_host_selector.py:83 +msgid "You haven't rights to access host account information" +msgstr "" + +#: authentication/selectors/business_host_selector.py:54 msgid "Host user is not registered for this account" msgstr "" -#: authentication/selectors/user_selector.py:73 +#: authentication/selectors/user_selector.py:79 msgid "No user with this uid found" msgstr "" @@ -428,289 +433,314 @@ msgstr "" msgid "No business account by this uid at your company" msgstr "" -#: authentication/services/email_service.py:100 +#: authentication/services/email_service.py:119 msgid "Regular users cannot send introductory letters" msgstr "" -#: authentication/services/email_service.py:122 +#: authentication/services/email_service.py:141 msgid "Regular users cannot send invitation letters" msgstr "" -#: authentication/services/user_services.py:45 +#: authentication/services/user_services.py:49 msgid "New user data is invalid" msgstr "" -#: authentication/services/user_services.py:97 +#: authentication/services/user_services.py:113 msgid "Wrong email" msgstr "" -#: authentication/services/user_services.py:105 +#: authentication/services/user_services.py:121 backend/urls.py:41 msgid "Wrong password" msgstr "" -#: authentication/services/user_services.py:108 +#: authentication/services/user_services.py:124 msgid "User has not confirmed his email yet" msgstr "" -#: authentication/services/user_services.py:147 +#: authentication/services/user_services.py:163 msgid "No user like this in a database" msgstr "" -#: authentication/services/user_services.py:164 +#: authentication/services/user_services.py:180 msgid "token is not provided" msgstr "" -#: authentication/services/user_services.py:168 +#: authentication/services/user_services.py:184 msgid "No user token like this in a database" msgstr "" -#: authentication/services/user_services.py:188 +#: authentication/services/user_services.py:204 msgid "No email token provided" msgstr "" -#: authentication/services/user_services.py:192 +#: authentication/services/user_services.py:208 msgid "No token like this in a database" msgstr "" -#: authentication/services/user_services.py:201 +#: authentication/services/user_services.py:217 msgid "Passwords do not match" msgstr "" -#: authentication/services/user_services.py:237 +#: authentication/services/user_services.py:253 msgid "Current password is wrong" msgstr "" -#: ml_model/apps.py:8 ml_model/models.py:82 +#: backend/urls.py:28 +msgid "Requested object does not exists" +msgstr "" + +#: backend/urls.py:35 +msgid "Token is invalid" +msgstr "" + +#: backend/urls.py:47 +msgid "Wrong username" +msgstr "" + +#: messages/serializers.py:39 +#, python-format +msgid "The file size cannot exceed %(max_mb_size)d MB" +msgstr "" + +#: ml_model/apps.py:8 ml_model/models.py:104 msgid "Neuron Models" msgstr "" -#: ml_model/models.py:22 ml_model/models.py:42 +#: ml_model/models.py:26 ml_model/models.py:46 msgid "Category" msgstr "" -#: ml_model/models.py:23 +#: ml_model/models.py:27 msgid "Categories" msgstr "" -#: ml_model/models.py:36 +#: ml_model/models.py:40 msgid "Fill automatically, don't touch" msgstr "" -#: ml_model/models.py:50 +#: ml_model/models.py:54 msgid "Avatar" msgstr "" -#: ml_model/models.py:81 +#: ml_model/models.py:103 msgid "Neuron Model" msgstr "" -#: ml_model/models.py:90 +#: ml_model/models.py:112 msgid "Model" msgstr "" -#: ml_model/models.py:107 +#: ml_model/models.py:129 msgid "Authorization token" msgstr "" -#: ml_model/models.py:111 ml_model/models.py:112 +#: ml_model/models.py:133 ml_model/models.py:134 msgid "Settings" msgstr "" -#: ml_model/models.py:115 +#: ml_model/models.py:137 #, python-format msgid "Settings of %(model_title)s" msgstr "" -#: ml_model/models.py:124 +#: ml_model/models.py:146 msgid "Default" msgstr "" -#: ml_model/models.py:137 +#: ml_model/models.py:159 #, python-format msgid "%(model_title)s | %(version_name)s" msgstr "" -#: ml_model/models.py:143 +#: ml_model/models.py:165 msgid "Model Version" msgstr "" -#: ml_model/models.py:144 +#: ml_model/models.py:166 msgid "Model Versions" msgstr "" -#: ml_model/models.py:153 +#: ml_model/models.py:175 msgid "Versions" msgstr "" -#: ml_model/models.py:154 +#: ml_model/models.py:176 msgid "Link to versions" msgstr "" -#: ml_model/models.py:163 reports/models/error_report.py:12 +#: ml_model/models.py:185 reports/models/error_report.py:12 msgid "Text" msgstr "" -#: ml_model/models.py:164 stories/models.py:36 +#: ml_model/models.py:186 stories/models.py:36 msgid "Image" msgstr "" -#: ml_model/models.py:165 +#: ml_model/models.py:187 msgid "PDF" msgstr "" -#: ml_model/models.py:166 +#: ml_model/models.py:188 +msgid "DOCX" +msgstr "" + +#: ml_model/models.py:189 +msgid "DOC" +msgstr "" + +#: ml_model/models.py:190 msgid "Text File (Notebook)" msgstr "" -#: ml_model/models.py:167 +#: ml_model/models.py:191 msgid "ZIP Archive" msgstr "" -#: ml_model/models.py:168 +#: ml_model/models.py:192 msgid "Audio" msgstr "" -#: ml_model/models.py:174 ml_model/models.py:212 -#: payments/models/promocode.py:40 +#: ml_model/models.py:198 ml_model/models.py:236 +#: payments/models/promocode.py:41 msgid "Type" msgstr "" -#: ml_model/models.py:176 ml_model/models.py:225 +#: ml_model/models.py:200 ml_model/models.py:249 msgid "Required" msgstr "" -#: ml_model/models.py:179 +#: ml_model/models.py:203 #, python-format msgid "%(model_title)s | %(input_type)s" msgstr "" -#: ml_model/models.py:185 +#: ml_model/models.py:209 msgid "Model Input" msgstr "" -#: ml_model/models.py:186 +#: ml_model/models.py:210 msgid "Model Inputs" msgstr "" -#: ml_model/models.py:192 +#: ml_model/models.py:216 msgid "Integer" msgstr "" -#: ml_model/models.py:193 +#: ml_model/models.py:217 msgid "Float" msgstr "" -#: ml_model/models.py:194 +#: ml_model/models.py:218 msgid "String" msgstr "" -#: ml_model/models.py:195 +#: ml_model/models.py:219 msgid "List" msgstr "" -#: ml_model/models.py:198 +#: ml_model/models.py:222 msgid "Float range" msgstr "" -#: ml_model/models.py:202 +#: ml_model/models.py:226 msgid "Integer range" msgstr "" -#: ml_model/models.py:204 +#: ml_model/models.py:228 msgid "Logical" msgstr "" -#: ml_model/models.py:219 +#: ml_model/models.py:243 msgid "Values" msgstr "" -#: ml_model/models.py:221 +#: ml_model/models.py:245 msgid "" "These values can contain different interfaces and default value optional" msgstr "" -#: ml_model/models.py:224 +#: ml_model/models.py:248 msgid "Hidden" msgstr "" -#: ml_model/models.py:230 +#: ml_model/models.py:254 #, python-format msgid "Parameter of %(model_title)s" msgstr "" -#: ml_model/models.py:233 +#: ml_model/models.py:257 msgid "Parameter" msgstr "" -#: ml_model/models.py:234 +#: ml_model/models.py:258 msgid "Parameters" msgstr "" -#: ml_model/models.py:239 +#: ml_model/models.py:263 msgid "Fixed" msgstr "" -#: ml_model/models.py:240 +#: ml_model/models.py:264 msgid "Per generation second" msgstr "" -#: ml_model/models.py:241 +#: ml_model/models.py:265 msgid "Per one text token" msgstr "" -#: ml_model/models.py:242 +#: ml_model/models.py:266 msgid "Per image pixel" msgstr "" -#: ml_model/models.py:245 +#: ml_model/models.py:269 msgid "By input data" msgstr "" -#: ml_model/models.py:246 +#: ml_model/models.py:270 msgid "By output data" msgstr "" -#: ml_model/models.py:247 +#: ml_model/models.py:271 msgid "By all data" msgstr "" -#: ml_model/models.py:250 +#: ml_model/models.py:274 msgid "Strategy" msgstr "" -#: ml_model/models.py:255 +#: ml_model/models.py:279 msgid "Interaction Type" msgstr "" -#: ml_model/models.py:260 payments/models/invoice.py:19 +#: ml_model/models.py:284 payments/models/invoice.py:19 msgid "Cost" msgstr "" -#: ml_model/models.py:261 +#: ml_model/models.py:285 msgid "In RUB, per specified strategy" msgstr "" -#: ml_model/models.py:266 +#: ml_model/models.py:290 msgid "Coefficient" msgstr "" -#: ml_model/models.py:267 +#: ml_model/models.py:291 msgid "Cost multiplier" msgstr "" -#: ml_model/models.py:274 +#: ml_model/models.py:298 msgid "Rate" msgstr "" -#: ml_model/models.py:278 +#: ml_model/models.py:302 msgid "Payment Rule" msgstr "" -#: ml_model/models.py:279 +#: ml_model/models.py:303 msgid "Payment Rules" msgstr "" -#: ml_model/selectors/ml_models_selector.py:56 +#: ml_model/selectors/ml_models_selector.py:79 msgid "no model by this id" msgstr "" @@ -719,20 +749,20 @@ msgstr "" msgid "Unknown bucket destination" msgstr "" -#: ml_model/services/upscaleai.py:126 +#: ml_model/services/upscaleai.py:123 msgid "No image given for improving" msgstr "" -#: payments/apps.py:8 payments/models/payment.py:62 +#: payments/apps.py:9 payments/models/payment.py:62 msgid "Payments" msgstr "" -#: payments/exceptions/insufficient_balance.py:15 +#: payments/exceptions/insufficient_balance.py:18 #, python-format msgid "" -"Token balance: %(balance)d,\n" -"Required amount: %(required)d,\n" -"Needed %(needed)d more" +"Token balance: %(balance).2f,\n" +"Required amount: %(required)s,\n" +"Needed %(needed)s more" msgstr "" #: payments/models/invoice.py:23 @@ -763,95 +793,95 @@ msgstr "" msgid "Payment" msgstr "" -#: payments/models/payment_plan.py:16 +#: payments/models/payment_plan.py:18 msgid "Price" msgstr "" -#: payments/models/payment_plan.py:20 +#: payments/models/payment_plan.py:22 msgid "Tokens per plan" msgstr "" -#: payments/models/payment_plan.py:23 +#: payments/models/payment_plan.py:25 msgid "Is corporate" msgstr "" -#: payments/models/payment_plan.py:24 +#: payments/models/payment_plan.py:26 msgid "Is recurrent" msgstr "" -#: payments/models/payment_plan.py:29 +#: payments/models/payment_plan.py:31 msgid "Duration" msgstr "" -#: payments/models/payment_plan.py:34 +#: payments/models/payment_plan.py:36 msgid "Is visible" msgstr "" -#: payments/models/payment_plan.py:41 payments/models/payment_plan.py:56 +#: payments/models/payment_plan.py:54 payments/models/payment_plan.py:69 msgid "Payment Plan" msgstr "" -#: payments/models/payment_plan.py:42 +#: payments/models/payment_plan.py:55 msgid "Payment Plans" msgstr "" -#: payments/models/payment_plan.py:58 +#: payments/models/payment_plan.py:71 msgid "Last payment at" msgstr "" -#: payments/models/payment_plan.py:59 +#: payments/models/payment_plan.py:72 msgid "Next payment at" msgstr "" -#: payments/models/payment_plan.py:61 +#: payments/models/payment_plan.py:74 msgid "Current balance" msgstr "" -#: payments/models/payment_plan.py:67 +#: payments/models/payment_plan.py:80 msgid "Recurrent billing task" msgstr "" -#: payments/models/payment_plan.py:84 payments/models/payment_plan.py:85 +#: payments/models/payment_plan.py:97 payments/models/payment_plan.py:98 msgid "User Balance" msgstr "" -#: payments/models/promocode.py:44 +#: payments/models/promocode.py:45 msgid "Action Function" msgstr "" -#: payments/models/promocode.py:69 +#: payments/models/promocode.py:70 msgid "Can be only for referral promos" msgstr "" -#: payments/models/promocode.py:77 +#: payments/models/promocode.py:78 msgid "Is personal" msgstr "" -#: payments/models/promocode.py:78 +#: payments/models/promocode.py:79 msgid "Can be activated only one time" msgstr "" -#: payments/models/promocode.py:87 -msgid "Owner can be only for referral promos" +#: payments/models/promocode.py:88 +msgid "Owner can be only for refferal promos" msgstr "" -#: payments/models/promocode.py:95 payments/models/promocode.py:106 +#: payments/models/promocode.py:96 payments/models/promocode.py:107 msgid "Promocode" msgstr "" -#: payments/models/promocode.py:96 +#: payments/models/promocode.py:97 msgid "Promocodes" msgstr "" -#: payments/models/promocode.py:103 +#: payments/models/promocode.py:104 msgid "Activated by" msgstr "" -#: payments/models/promocode.py:134 +#: payments/models/promocode.py:138 msgid "Promocode Activation" msgstr "" -#: payments/models/promocode.py:135 +#: payments/models/promocode.py:139 msgid "Promocode Activations" msgstr "" @@ -955,27 +985,27 @@ msgstr "" msgid "Widgets" msgstr "" -#: tools/apps.py:8 +#: tools/apps.py:9 msgid "Tools" msgstr "" -#: tools/apps.py:14 tools/chats/models.py:23 +#: tools/apps.py:15 tools/chats/models.py:23 msgid "Chats" msgstr "" -#: tools/apps.py:20 +#: tools/apps.py:21 msgid "Copywrite" msgstr "" -#: tools/apps.py:26 +#: tools/apps.py:32 msgid "Public API" msgstr "" -#: tools/apps.py:32 +#: tools/apps.py:38 msgid "Media" msgstr "" -#: tools/apps.py:38 +#: tools/apps.py:44 msgid "Feed" msgstr "" @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-30 20:55+0300\n" +"POT-Creation-Date: 2025-03-24 18:01+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -32,21 +32,21 @@ msgstr "Достижение" msgid "Achievements" msgstr "Достижения" -#: achievements/models.py:14 ml_model/models.py:12 ml_model/models.py:34 -#: ml_model/models.py:123 +#: achievements/models.py:14 ml_model/models.py:16 ml_model/models.py:38 +#: ml_model/models.py:145 msgid "Slug" msgstr "Ярлык" -#: achievements/models.py:16 ml_model/models.py:32 ml_model/models.py:121 -#: ml_model/models.py:208 payments/models/payment.py:53 +#: achievements/models.py:16 ml_model/models.py:36 ml_model/models.py:143 +#: ml_model/models.py:232 payments/models/payment.py:53 msgid "Description" msgstr "Описание" #: achievements/models.py:43 authentication/models/business_host.py:21 -#: authentication/models/email_token.py:12 authentication/models/user.py:203 -#: authentication/models/user.py:204 authentication/models/user_telegram.py:30 +#: authentication/models/email_token.py:12 authentication/models/user.py:229 +#: authentication/models/user.py:230 authentication/models/user_telegram.py:30 #: authentication/models/user_vk.py:12 payments/models/invoice.py:15 -#: payments/models/payment.py:26 payments/models/payment_plan.py:50 +#: payments/models/payment.py:26 payments/models/payment_plan.py:63 msgid "User" msgstr "Пользователь" @@ -64,7 +64,7 @@ msgstr "Достижение %(achievement_title)s пользователя %(us msgid "Issued achievement" msgstr "Выданное достижение" -#: authentication/models/business_account.py:16 payments/models/promocode.py:68 +#: authentication/models/business_account.py:16 payments/models/promocode.py:69 #: tools/public_api/models.py:35 msgid "Owner" msgstr "Владелец" @@ -112,9 +112,9 @@ msgstr "Дочерний Бизнес Аккаунт" msgid "Child Business Accounts" msgstr "Дочерние Бизнес Аккаунты" -#: authentication/models/business_group.py:8 ml_model/models.py:11 -#: ml_model/models.py:31 ml_model/models.py:206 -#: payments/models/payment_plan.py:26 stories/models.py:12 stories/models.py:35 +#: authentication/models/business_group.py:8 ml_model/models.py:15 +#: ml_model/models.py:35 ml_model/models.py:230 +#: payments/models/payment_plan.py:28 stories/models.py:12 stories/models.py:35 #: tools/chats/models.py:9 msgid "Title" msgstr "Название" @@ -131,9 +131,9 @@ msgstr "Бизнес Группы" msgid "Affiliated by" msgstr "Кем привлечена" -#: authentication/models/business_host.py:35 authentication/models/user.py:123 -#: authentication/models/whitelist.py:16 ml_model/models.py:103 -#: payments/models/promocode.py:82 +#: authentication/models/business_host.py:35 authentication/models/user.py:132 +#: authentication/models/whitelist.py:16 ml_model/models.py:125 +#: payments/models/promocode.py:83 msgid "Is active" msgstr "Является активной" @@ -169,7 +169,7 @@ msgstr "ИНН" msgid "PSRN" msgstr "ОГРН" -#: authentication/models/business_host.py:73 ml_model/models.py:119 +#: authentication/models/business_host.py:73 ml_model/models.py:141 #: tools/public_api/models.py:31 msgid "Name" msgstr "Наименование" @@ -270,7 +270,7 @@ msgstr "Админ" msgid "Security" msgstr "Безопасность" -#: authentication/models/email_token.py:15 ml_model/models.py:210 +#: authentication/models/email_token.py:15 ml_model/models.py:234 msgid "Key" msgstr "Ключ" @@ -282,43 +282,43 @@ msgstr "Email Токен" msgid "Email Tokens" msgstr "Email Токены" -#: authentication/models/user.py:100 authentication/models/user_telegram.py:10 +#: authentication/models/user.py:109 authentication/models/user_telegram.py:10 msgid "First name" msgstr "Имя" -#: authentication/models/user.py:107 authentication/models/user_telegram.py:13 +#: authentication/models/user.py:116 authentication/models/user_telegram.py:13 msgid "Last name" msgstr "Фамилия" -#: authentication/models/user.py:110 authentication/models/user_telegram.py:16 +#: authentication/models/user.py:119 authentication/models/user_telegram.py:16 msgid "Username" msgstr "Имя пользователя" -#: authentication/models/user.py:117 +#: authentication/models/user.py:126 msgid "Email" msgstr "Email" -#: authentication/models/user.py:125 +#: authentication/models/user.py:134 msgid "Is staff" msgstr "Административный" -#: authentication/models/user.py:126 +#: authentication/models/user.py:135 msgid "Is superuser" msgstr "Суперюзер" -#: authentication/models/user.py:127 +#: authentication/models/user.py:136 msgid "Is email confirmed" msgstr "Email подтвержден" -#: authentication/models/user.py:129 +#: authentication/models/user.py:138 msgid "Is subscribed" msgstr "Подписан на уведомления" -#: authentication/models/user.py:136 +#: authentication/models/user.py:145 msgid "Picture name" msgstr "Имя аватара" -#: authentication/models/user.py:145 authentication/models/utm.py:21 +#: authentication/models/user.py:154 authentication/models/utm.py:21 msgid "UTM" msgstr "UTM" @@ -405,11 +405,16 @@ msgstr "Вайтлист для отмены политик" msgid "Whitelists to cancel policies" msgstr "Вайтлисты для отмены политик" -#: authentication/selectors/business_host_selector.py:47 +#: authentication/selectors/business_host_selector.py:38 +#: authentication/selectors/business_host_selector.py:83 +msgid "You haven't rights to access host account information" +msgstr "" + +#: authentication/selectors/business_host_selector.py:54 msgid "Host user is not registered for this account" msgstr "Пользователь бизнес-аккаунта не зарегистрирован для этого аккаунта" -#: authentication/selectors/user_selector.py:73 +#: authentication/selectors/user_selector.py:79 msgid "No user with this uid found" msgstr "Не найден пользователь с данным ID" @@ -433,303 +438,328 @@ msgstr "" msgid "No business account by this uid at your company" msgstr "Такого аккаунта нет в вашей компании" -#: authentication/services/email_service.py:100 +#: authentication/services/email_service.py:119 msgid "Regular users cannot send introductory letters" msgstr "Обычные пользователи не могут отсылать письма" -#: authentication/services/email_service.py:122 +#: authentication/services/email_service.py:141 msgid "Regular users cannot send invitation letters" msgstr "Обычные пользователи не могут отправлять письма для приглашений" -#: authentication/services/user_services.py:45 +#: authentication/services/user_services.py:49 msgid "New user data is invalid" msgstr "" -#: authentication/services/user_services.py:97 +#: authentication/services/user_services.py:113 msgid "Wrong email" msgstr "Неверный email" -#: authentication/services/user_services.py:105 +#: authentication/services/user_services.py:121 backend/urls.py:41 msgid "Wrong password" msgstr "Неверный пароль" -#: authentication/services/user_services.py:108 +#: authentication/services/user_services.py:124 msgid "User has not confirmed his email yet" msgstr "Пользователь пока не подтвердил свой email" -#: authentication/services/user_services.py:147 +#: authentication/services/user_services.py:163 msgid "No user like this in a database" msgstr "Такой пользователь отсутствует" -#: authentication/services/user_services.py:164 +#: authentication/services/user_services.py:180 msgid "token is not provided" msgstr "" -#: authentication/services/user_services.py:168 +#: authentication/services/user_services.py:184 msgid "No user token like this in a database" msgstr "" -#: authentication/services/user_services.py:188 +#: authentication/services/user_services.py:204 msgid "No email token provided" msgstr "Токен не получен" -#: authentication/services/user_services.py:192 +#: authentication/services/user_services.py:208 msgid "No token like this in a database" msgstr "Не найдено такого токена" -#: authentication/services/user_services.py:201 +#: authentication/services/user_services.py:217 msgid "Passwords do not match" msgstr "Пароли не совпадают" -#: authentication/services/user_services.py:237 +#: authentication/services/user_services.py:253 msgid "Current password is wrong" msgstr "Текущий пароль неверен" -#: ml_model/apps.py:8 ml_model/models.py:82 +#: backend/urls.py:28 +msgid "Requested object does not exists" +msgstr "" + +#: backend/urls.py:35 +msgid "Token is invalid" +msgstr "" + +#: backend/urls.py:47 +#, fuzzy +#| msgid "Wrong email" +msgid "Wrong username" +msgstr "Неверный email" + +#: messages/serializers.py:39 +#, python-format +msgid "The file size cannot exceed %(max_mb_size)d MB" +msgstr "" + +#: ml_model/apps.py:8 ml_model/models.py:104 msgid "Neuron Models" msgstr "Нейронные Модели" -#: ml_model/models.py:22 ml_model/models.py:42 +#: ml_model/models.py:26 ml_model/models.py:46 msgid "Category" msgstr "Категория" -#: ml_model/models.py:23 +#: ml_model/models.py:27 msgid "Categories" msgstr "Категории" -#: ml_model/models.py:36 +#: ml_model/models.py:40 msgid "Fill automatically, don't touch" msgstr "Заполняется автоматически, не трогать" -#: ml_model/models.py:50 +#: ml_model/models.py:54 msgid "Avatar" msgstr "Аватар" -#: ml_model/models.py:81 +#: ml_model/models.py:103 msgid "Neuron Model" msgstr "Нейронная Модель" -#: ml_model/models.py:90 +#: ml_model/models.py:112 msgid "Model" msgstr "Модель" -#: ml_model/models.py:107 +#: ml_model/models.py:129 msgid "Authorization token" msgstr "Авторизационный токен" -#: ml_model/models.py:111 ml_model/models.py:112 +#: ml_model/models.py:133 ml_model/models.py:134 msgid "Settings" msgstr "Настройки" -#: ml_model/models.py:115 +#: ml_model/models.py:137 #, fuzzy, python-format #| msgid "Settings of %(model_title)" msgid "Settings of %(model_title)s" msgstr "Настройки %(model_title)s" -#: ml_model/models.py:124 +#: ml_model/models.py:146 #, fuzzy #| msgid "Default value" msgid "Default" msgstr "Стандартное значение" -#: ml_model/models.py:137 +#: ml_model/models.py:159 #, python-format msgid "%(model_title)s | %(version_name)s" msgstr "%(model_title)s | %(version_name)s" -#: ml_model/models.py:143 +#: ml_model/models.py:165 msgid "Model Version" msgstr "Версия Модели" -#: ml_model/models.py:144 +#: ml_model/models.py:166 msgid "Model Versions" msgstr "Версии Модели" -#: ml_model/models.py:153 +#: ml_model/models.py:175 msgid "Versions" msgstr "Версии" -#: ml_model/models.py:154 +#: ml_model/models.py:176 msgid "Link to versions" msgstr "Привязка к версиям" -#: ml_model/models.py:163 reports/models/error_report.py:12 +#: ml_model/models.py:185 reports/models/error_report.py:12 msgid "Text" msgstr "Текст" -#: ml_model/models.py:164 stories/models.py:36 +#: ml_model/models.py:186 stories/models.py:36 msgid "Image" msgstr "Картинка" -#: ml_model/models.py:165 +#: ml_model/models.py:187 msgid "PDF" msgstr "PDF" -#: ml_model/models.py:166 +#: ml_model/models.py:188 +msgid "DOCX" +msgstr "" + +#: ml_model/models.py:189 +msgid "DOC" +msgstr "" + +#: ml_model/models.py:190 msgid "Text File (Notebook)" msgstr "Текстовый файл (Блокнот)" -#: ml_model/models.py:167 +#: ml_model/models.py:191 msgid "ZIP Archive" msgstr "ZIP архив" -#: ml_model/models.py:168 +#: ml_model/models.py:192 msgid "Audio" msgstr "Аудио" -#: ml_model/models.py:174 ml_model/models.py:212 -#: payments/models/promocode.py:40 +#: ml_model/models.py:198 ml_model/models.py:236 +#: payments/models/promocode.py:41 msgid "Type" msgstr "Тип" -#: ml_model/models.py:176 ml_model/models.py:225 +#: ml_model/models.py:200 ml_model/models.py:249 msgid "Required" msgstr "Обязательный" -#: ml_model/models.py:179 +#: ml_model/models.py:203 #, python-format msgid "%(model_title)s | %(input_type)s" msgstr "%(model_title)s | %(input_type)s" -#: ml_model/models.py:185 +#: ml_model/models.py:209 #, fuzzy #| msgid "Model" msgid "Model Input" msgstr "Модель" -#: ml_model/models.py:186 +#: ml_model/models.py:210 msgid "Model Inputs" msgstr "Входящий поток модели" -#: ml_model/models.py:192 +#: ml_model/models.py:216 msgid "Integer" msgstr "Целое число" -#: ml_model/models.py:193 +#: ml_model/models.py:217 msgid "Float" msgstr "Вещественное число" -#: ml_model/models.py:194 +#: ml_model/models.py:218 msgid "String" msgstr "Строка" -#: ml_model/models.py:195 +#: ml_model/models.py:219 msgid "List" msgstr "Список" -#: ml_model/models.py:198 +#: ml_model/models.py:222 msgid "Float range" msgstr "Вещественный диапазон" -#: ml_model/models.py:202 +#: ml_model/models.py:226 msgid "Integer range" msgstr "Целочисленный диапазон" -#: ml_model/models.py:204 +#: ml_model/models.py:228 msgid "Logical" msgstr "Логический" -#: ml_model/models.py:219 +#: ml_model/models.py:243 msgid "Values" msgstr "Значения" -#: ml_model/models.py:221 +#: ml_model/models.py:245 msgid "" "These values can contain different interfaces and default value optional" msgstr "" "Значения могут содержать различные интерфейс и, опционально, значение по " "умолчанию" -#: ml_model/models.py:224 +#: ml_model/models.py:248 msgid "Hidden" msgstr "Скрытый" -#: ml_model/models.py:230 +#: ml_model/models.py:254 #, fuzzy, python-format #| msgid "Parameter of %(model_title)" msgid "Parameter of %(model_title)s" msgstr "Параметр %(model_title)s" -#: ml_model/models.py:233 +#: ml_model/models.py:257 msgid "Parameter" msgstr "Параметр" -#: ml_model/models.py:234 +#: ml_model/models.py:258 msgid "Parameters" msgstr "Параметры" -#: ml_model/models.py:239 +#: ml_model/models.py:263 msgid "Fixed" msgstr "Фикса" -#: ml_model/models.py:240 +#: ml_model/models.py:264 msgid "Per generation second" msgstr "За секунду генерации" -#: ml_model/models.py:241 +#: ml_model/models.py:265 msgid "Per one text token" msgstr "За один текстовый токен" -#: ml_model/models.py:242 +#: ml_model/models.py:266 msgid "Per image pixel" msgstr "За один пиксель" -#: ml_model/models.py:245 +#: ml_model/models.py:269 msgid "By input data" msgstr "По входящим данным" -#: ml_model/models.py:246 +#: ml_model/models.py:270 msgid "By output data" msgstr "По исходящим данным" -#: ml_model/models.py:247 +#: ml_model/models.py:271 msgid "By all data" msgstr "По всем данным" -#: ml_model/models.py:250 +#: ml_model/models.py:274 #, fuzzy #| msgid "Category" msgid "Strategy" msgstr "Стратегия" -#: ml_model/models.py:255 +#: ml_model/models.py:279 msgid "Interaction Type" msgstr "Тип взаимодействия" -#: ml_model/models.py:260 payments/models/invoice.py:19 +#: ml_model/models.py:284 payments/models/invoice.py:19 msgid "Cost" msgstr "Цена" -#: ml_model/models.py:261 +#: ml_model/models.py:285 msgid "In RUB, per specified strategy" msgstr "В рублях, за указанную стратегию" -#: ml_model/models.py:266 +#: ml_model/models.py:290 msgid "Coefficient" msgstr "Коэффициент" -#: ml_model/models.py:267 +#: ml_model/models.py:291 msgid "Cost multiplier" msgstr "Цена" -#: ml_model/models.py:274 +#: ml_model/models.py:298 msgid "Rate" msgstr "Ставка" -#: ml_model/models.py:278 +#: ml_model/models.py:302 #, fuzzy #| msgid "Payment Plan" msgid "Payment Rule" msgstr "Платежное правило" -#: ml_model/models.py:279 -#, fuzzy -#| msgid "Payment Plans" +#: ml_model/models.py:303 msgid "Payment Rules" msgstr "Платежные правила" -#: ml_model/selectors/ml_models_selector.py:56 +#: ml_model/selectors/ml_models_selector.py:79 msgid "no model by this id" msgstr "Не найдено моделей по этому ID" @@ -738,21 +768,24 @@ msgstr "Не найдено моделей по этому ID" msgid "Unknown bucket destination" msgstr "Неизвестный бакет для загрузки" -#: ml_model/services/upscaleai.py:126 +#: ml_model/services/upscaleai.py:123 msgid "No image given for improving" msgstr "Нет изображения для улучшения" -#: payments/apps.py:8 payments/models/payment.py:62 +#: payments/apps.py:9 payments/models/payment.py:62 msgid "Payments" msgstr "Платежи" -#: payments/exceptions/insufficient_balance.py:15 +#: payments/exceptions/insufficient_balance.py:18 #, python-format msgid "" -"Token balance: %(balance)d,\n" -"Required amount: %(required)d,\n" -"Needed %(needed)d more" -msgstr "Баланс: %(balance)d токенов. Нужно: %(required)d токенов. Нужно еще: %(needed)d токенов" +"Token balance: %(balance).2f,\n" +"Required amount: %(required)s,\n" +"Needed %(needed)s more" +msgstr "" +"Баланс: %(balance).2f токенов,\n" +"Нужно: %(required)s токенов,\n" +"Нужно еще: %(needed)s токенов" #: payments/models/invoice.py:23 msgid "Generative Model" @@ -782,95 +815,97 @@ msgstr "Статус" msgid "Payment" msgstr "Платеж" -#: payments/models/payment_plan.py:16 +#: payments/models/payment_plan.py:18 msgid "Price" msgstr "Цена" -#: payments/models/payment_plan.py:20 +#: payments/models/payment_plan.py:22 msgid "Tokens per plan" msgstr "Токенов за план" -#: payments/models/payment_plan.py:23 +#: payments/models/payment_plan.py:25 msgid "Is corporate" msgstr "Корпоративный" -#: payments/models/payment_plan.py:24 +#: payments/models/payment_plan.py:26 msgid "Is recurrent" msgstr "Рекуррентный" -#: payments/models/payment_plan.py:29 +#: payments/models/payment_plan.py:31 msgid "Duration" msgstr "Длительность" -#: payments/models/payment_plan.py:34 +#: payments/models/payment_plan.py:36 msgid "Is visible" msgstr "Видимый" -#: payments/models/payment_plan.py:41 payments/models/payment_plan.py:56 +#: payments/models/payment_plan.py:54 payments/models/payment_plan.py:69 msgid "Payment Plan" msgstr "Платежный План" -#: payments/models/payment_plan.py:42 +#: payments/models/payment_plan.py:55 msgid "Payment Plans" msgstr "Платежные Планы" -#: payments/models/payment_plan.py:58 +#: payments/models/payment_plan.py:71 msgid "Last payment at" msgstr "Последнее время платежа" -#: payments/models/payment_plan.py:59 +#: payments/models/payment_plan.py:72 msgid "Next payment at" msgstr "Следующее время платежа" -#: payments/models/payment_plan.py:61 +#: payments/models/payment_plan.py:74 msgid "Current balance" msgstr "Текущий баланс" -#: payments/models/payment_plan.py:67 +#: payments/models/payment_plan.py:80 msgid "Recurrent billing task" msgstr "Рекуррентная задача на платеж" -#: payments/models/payment_plan.py:84 payments/models/payment_plan.py:85 +#: payments/models/payment_plan.py:97 payments/models/payment_plan.py:98 msgid "User Balance" msgstr "Баланс пользователя" -#: payments/models/promocode.py:44 +#: payments/models/promocode.py:45 msgid "Action Function" msgstr "Активирующаяся функция" -#: payments/models/promocode.py:69 +#: payments/models/promocode.py:70 msgid "Can be only for referral promos" msgstr "Может быть только у реферальных промокодов" -#: payments/models/promocode.py:77 +#: payments/models/promocode.py:78 msgid "Is personal" msgstr "Персональный" -#: payments/models/promocode.py:78 +#: payments/models/promocode.py:79 msgid "Can be activated only one time" msgstr "Может быть активирован только один раз" -#: payments/models/promocode.py:87 -msgid "Owner can be only for referral promos" +#: payments/models/promocode.py:88 +#, fuzzy +#| msgid "Owner can be only for referral promos" +msgid "Owner can be only for refferal promos" msgstr "Владелец может быть только у реферальных промокодов" -#: payments/models/promocode.py:95 payments/models/promocode.py:106 +#: payments/models/promocode.py:96 payments/models/promocode.py:107 msgid "Promocode" msgstr "Промокод" -#: payments/models/promocode.py:96 +#: payments/models/promocode.py:97 msgid "Promocodes" msgstr "Промокоды" -#: payments/models/promocode.py:103 +#: payments/models/promocode.py:104 msgid "Activated by" msgstr "Кем активирован" -#: payments/models/promocode.py:134 +#: payments/models/promocode.py:138 msgid "Promocode Activation" msgstr "Активация Промокода" -#: payments/models/promocode.py:135 +#: payments/models/promocode.py:139 msgid "Promocode Activations" msgstr "Активации Промокодов" @@ -974,27 +1009,27 @@ msgstr "Виджет" msgid "Widgets" msgstr "Виджеты" -#: tools/apps.py:8 +#: tools/apps.py:9 msgid "Tools" msgstr "Инструменты" -#: tools/apps.py:14 tools/chats/models.py:23 +#: tools/apps.py:15 tools/chats/models.py:23 msgid "Chats" msgstr "Чаты" -#: tools/apps.py:20 +#: tools/apps.py:21 msgid "Copywrite" msgstr "Копирайт" -#: tools/apps.py:26 +#: tools/apps.py:32 msgid "Public API" msgstr "Публичный API" -#: tools/apps.py:32 +#: tools/apps.py:38 msgid "Media" msgstr "Медиа" -#: tools/apps.py:38 +#: tools/apps.py:44 msgid "Feed" msgstr "Шейр пользователей" @@ -1,11 +1,20 @@ +import base64 import time -from _decimal import Decimal from datetime import timedelta +from decimal import Decimal +from io import BytesIO +from typing import Iterator, Any + +import filetype +from PIL import Image from messages.models import Message -from ml_model.models import ModelCategory +from ml_model.models import ModelCategory, ModelVersion, ModelInput, ModelParameter from ml_model.services.base import SimpleService -from ml_model.tasks import claude_run +from ml_model.tasks import openrouter_run +from tools.chats.models import Chat +from tools.copywrite.models import Copywrite +from tools.public_api.models import APIStore class Claude(SimpleService): @@ -14,36 +23,28 @@ class Claude(SimpleService): contains abstract method make, which makes a generation """ - muted = True - - title = 'Claude' - description = 'Нейросеть, способная генерировать качественный текст из вашего промпта' - category = ModelCategory(title='Чат-боты', slug='chat-bots') - versions = [] - inputs = [] - parameters = [] - - muted = True - TOKEN_PAYMENT_RULES = { - 'claude-instant-1.2': Decimal(0.6), - 'claude-2.1': Decimal(2.572), + TOKENS_COST = { + 'claude-3.7-sonnet:thinking': {'input': Decimal('800'), 'output': Decimal('3000'), 'input_imgs': Decimal('960')}, # 1M tokens } - def __init__(self, store): - super().__init__(store) - - def calculate_price(self, model_name: str, usage: dict[str, int]) -> Decimal: + def calculate_price( + self, version: str, input_tokens: int, output_tokens: int + ) -> Decimal: + price_map = self.TOKENS_COST[version.split('/')[1]] price = ( - usage['input_tokens'] * self.TOKEN_PAYMENT_RULES[model_name] - + usage['output_tokens'] * self.TOKEN_PAYMENT_RULES[model_name] + input_tokens * price_map['input'] / 1_000_000 + + output_tokens * price_map['output'] / 1_000_000 + + price_map['input_imgs'] / 1_000 ) return price.quantize(Decimal('0.1'), rounding='ROUND_UP') - def save_results(self, r: str, t: timedelta, save: bool = True) -> list[Message]: + def save_results( + self, content: Iterator[Any], t: timedelta, save: bool = True + ) -> list[Message]: msgs = [ Message( - content=r, + content=content, content_object=self.store, elapsed_time=t, ) @@ -52,18 +53,83 @@ class Claude(SimpleService): return Message.objects.bulk_create(msgs) return msgs + def make(self, input_message: Message, save: bool = True) -> list[Message]: - callback_data = dict( - { - 'messages': [{'role': 'user', 'content': input_message.content}], - **input_message.info, - } - ) start_time = time.time() - result = claude_run(callback_data) + version = f'anthropic/{input_message.info.pop('version', 'claude-3.7-sonnet:thinking')}' + callback_data = { + 'provider': { + 'order': ['Anthropic'] + }, + **input_message.info + } + messages = self.get_chat_history() + image = input_message.file + if image: + kind = filetype.guess(image.read(20)) + mime = kind.mime if kind else 'application/octet-stream' + normalized_image = Image.open(image) + format = 'jpeg' if kind.extension == 'jpg' else kind.extension + buf = BytesIO() + normalized_image.save(buf, format=format) + image_url = ( + f'data:{mime};base64,{base64.b64encode(buf.getvalue()).decode("utf-8")}' + ) + buf.close() + messages[-1]['content'] = [ + { + 'type': 'text', + 'text': input_message.content + }, + { + 'type': 'image_url', + 'image_url': { + 'url': image_url + } + } + ] + result = openrouter_run(version, messages, callback_data, self.title) process_time = timedelta(seconds=(time.time() - start_time)) - msgs = self.save_results(result['content']['text'], process_time, save) self.handle_invoice( - self.neuron_model, model_name=input_message['model'], usage=result['usage'] + input_message.content_object.model, + version=version, + input_tokens=result[1], + output_tokens=result[2] ) + msgs = self.save_results(result[0], process_time) return msgs + + def get_chat_history(self, message_limit: int = 10, max_character_limit: int = 1500): + if isinstance(self.store, Chat): + air_messages = list( + reversed( + Message.objects.filter( + chats_chats_messages=self.store, is_deleted=False, is_sent=True + ).order_by('-created_at')[:message_limit] + ) + ) + elif isinstance(self.store, APIStore): + air_messages = [] + elif isinstance(self.store, Copywrite): + air_messages = list( + reversed( + Message.objects.filter( + copywrite_copywrites_messages=self.store, + is_deleted=False, + is_sent=True, + ).order_by('-created_at')[:message_limit] + ) + ) + memory = [] + for msg in air_messages: + content = msg.content or '' + if msg.from_model: + memory.append({"role": "assistant", "content": content}) + else: + memory.append({"role": "user", "content": content}) + character_length = sum(len(content['content']) for content in memory) + while character_length > max_character_limit: + memory.pop(0) + character_length = sum(len(content['content']) for content in memory) + + return memory \ No newline at end of file @@ -1,8 +1,8 @@ +import math from decimal import Decimal from django.utils.translation import gettext_lazy as _ -import math class InsufficientBalance(Exception): def __init__( @@ -18,7 +18,11 @@ class InsufficientBalance(Exception): 'Token balance: %(balance).2f,\nRequired amount: %(required)s,\nNeeded %(needed)s more' ) % { 'balance': self.account_balance, - 'required': math.ceil(self.requested_amount) if self.requested_amount % 1 == 0 else f'~{math.ceil(self.requested_amount)}', - 'needed': round(self.needed,2) if self.needed >= 1 else f'~{math.ceil(self.needed)}' + 'required': math.ceil(self.requested_amount) + if self.requested_amount % 1 == 0 + else f'~{math.ceil(self.requested_amount)}', + 'needed': round(self.needed, 2) + if self.needed >= 1 + else f'~{math.ceil(self.needed)}', } super().__init__(result_message)