@purpleschool/gptbot 0.5.89 → 0.5.91
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api/controllers/http/index.ts +3 -1
- package/api/controllers/http/stt.ts +12 -0
- package/api/controllers/http/tts.ts +13 -0
- package/build/api/controllers/http/index.js +3 -1
- package/build/api/controllers/http/stt.js +14 -0
- package/build/api/controllers/http/tts.js +15 -0
- package/build/commands/index.js +1 -2
- package/build/commands/tools/index.js +20 -0
- package/build/commands/{tools-paraphrase → tools/paraphrase}/find-paraphrase-job-by-uuid.command.js +3 -3
- package/build/commands/{tools-paraphrase → tools/paraphrase}/get-paraphrase-tool-config.command.js +1 -1
- package/build/commands/{tools-paraphrase → tools/paraphrase}/paraphrase.command.js +2 -2
- package/build/commands/tools/stt/delete-all-stt-jobs.command.js +8 -0
- package/build/commands/tools/stt/delete-stt-job-by-uuid.command.js +11 -0
- package/build/commands/tools/stt/find-stt-job-by-uuid.command.js +14 -0
- package/build/commands/tools/stt/find-stt-jobs.command.js +18 -0
- package/build/commands/tools/stt/get-stt-tool-config.command.js +11 -0
- package/build/commands/tools/stt/index.js +23 -0
- package/build/commands/tools/stt/set-reaction-to-stt-job.command.js +18 -0
- package/build/commands/tools/stt/stt.command.js +15 -0
- package/build/commands/{tool → tools/tool}/find-all-tools.command.js +1 -1
- package/build/commands/tools/tts/delete-all-tts-jobs.command.js +8 -0
- package/build/commands/tools/tts/delete-tts-job-by-uuid.command.js +11 -0
- package/build/commands/tools/tts/find-tts-job-by-uuid.command.js +14 -0
- package/build/commands/tools/tts/find-tts-jobs.command.js +18 -0
- package/build/commands/tools/tts/get-tts-tool-config.command.js +11 -0
- package/build/commands/tools/tts/index.js +24 -0
- package/build/commands/tools/tts/set-reaction-to-tts-job.command.js +18 -0
- package/build/commands/tools/tts/tts.command.js +26 -0
- package/build/commands/tools/tts/update-tts-job-title.command.js +17 -0
- package/build/constants/errors/errors.js +96 -7
- package/build/constants/message/enums/user-reaction.enum.js +5 -4
- package/build/helpers/index.js +2 -0
- package/build/helpers/stt/calculate-stt-price.helper.js +7 -0
- package/build/helpers/stt/index.js +17 -0
- package/build/helpers/tts/calculate-tts-price.helper.js +7 -0
- package/build/helpers/tts/index.js +17 -0
- package/build/models/file.schema.js +2 -0
- package/build/models/icon-variants.schema.js +17 -0
- package/build/models/index.js +2 -4
- package/build/models/message.schema.js +1 -1
- package/build/models/tools/index.js +19 -0
- package/build/models/tools/paraphrase/index.js +20 -0
- package/build/models/tools/paraphrase/paraphrase-config.schema.js +11 -0
- package/build/models/{tool-paraphrase-job.schema.js → tools/paraphrase/paraphrase-job.schema.js} +1 -1
- package/build/models/tools/stt/index.js +20 -0
- package/build/models/tools/stt/stt-config.schema.js +8 -0
- package/build/models/tools/stt/stt-job.schema.js +14 -0
- package/build/models/tools/stt/stt-model.schema.js +15 -0
- package/build/models/tools/stt/stt-response.schema.js +8 -0
- package/build/models/tools/tts/index.js +19 -0
- package/build/models/tools/tts/tts-config.schema.js +8 -0
- package/build/models/tools/tts/tts-job.schema.js +21 -0
- package/build/models/tools/tts/tts-model.schema.js +49 -0
- package/commands/index.ts +1 -2
- package/commands/tools/index.ts +4 -0
- package/commands/{tools-paraphrase → tools/paraphrase}/find-paraphrase-job-by-uuid.command.ts +1 -1
- package/commands/{tools-paraphrase → tools/paraphrase}/get-paraphrase-tool-config.command.ts +1 -1
- package/commands/{tools-paraphrase → tools/paraphrase}/paraphrase.command.ts +2 -2
- package/commands/tools/stt/delete-all-stt-jobs.command.ts +6 -0
- package/commands/tools/stt/delete-stt-job-by-uuid.command.ts +11 -0
- package/commands/tools/stt/find-stt-job-by-uuid.command.ts +16 -0
- package/commands/tools/stt/find-stt-jobs.command.ts +18 -0
- package/commands/tools/stt/get-stt-tool-config.command.ts +10 -0
- package/commands/tools/stt/index.ts +7 -0
- package/commands/tools/stt/set-reaction-to-stt-job.command.ts +20 -0
- package/commands/tools/stt/stt.command.ts +17 -0
- package/commands/{tool → tools/tool}/find-all-tools.command.ts +1 -1
- package/commands/tools/tts/delete-all-tts-jobs.command.ts +6 -0
- package/commands/tools/tts/delete-tts-job-by-uuid.command.ts +11 -0
- package/commands/tools/tts/find-tts-job-by-uuid.command.ts +16 -0
- package/commands/tools/tts/find-tts-jobs.command.ts +18 -0
- package/commands/tools/tts/get-tts-tool-config.command.ts +10 -0
- package/commands/tools/tts/index.ts +8 -0
- package/commands/tools/tts/set-reaction-to-tts-job.command.ts +20 -0
- package/commands/tools/tts/tts.command.ts +28 -0
- package/commands/tools/tts/update-tts-job-title.command.ts +19 -0
- package/constants/errors/errors.ts +96 -7
- package/constants/message/enums/user-reaction.enum.ts +4 -6
- package/helpers/index.ts +2 -0
- package/helpers/stt/calculate-stt-price.helper.ts +4 -0
- package/helpers/stt/index.ts +1 -0
- package/helpers/tts/calculate-tts-price.helper.ts +4 -0
- package/helpers/tts/index.ts +1 -0
- package/models/file.schema.ts +2 -0
- package/models/icon-variants.schema.ts +12 -0
- package/models/index.ts +2 -4
- package/models/message.schema.ts +2 -2
- package/models/tools/index.ts +3 -0
- package/models/tools/paraphrase/index.ts +4 -0
- package/models/{tool-paraphrase-config.schema.ts → tools/paraphrase/paraphrase-config.schema.ts} +2 -2
- package/models/{tool-paraphrase-job.schema.ts → tools/paraphrase/paraphrase-job.schema.ts} +1 -1
- package/models/tools/stt/index.ts +4 -0
- package/models/tools/stt/stt-config.schema.ts +8 -0
- package/models/tools/stt/stt-job.schema.ts +14 -0
- package/models/tools/stt/stt-model.schema.ts +15 -0
- package/models/tools/stt/stt-response.schema.ts +8 -0
- package/models/tools/tts/index.ts +3 -0
- package/models/tools/tts/tts-config.schema.ts +6 -0
- package/models/tools/tts/tts-job.schema.ts +23 -0
- package/models/tools/tts/tts-model.schema.ts +52 -0
- package/package.json +1 -1
- package/build/models/tool-paraphrase-config.schema.js +0 -11
- /package/api/controllers/http/{tool-paraphrase.ts → paraphrase.ts} +0 -0
- /package/build/api/controllers/http/{tool-paraphrase.js → paraphrase.js} +0 -0
- /package/build/commands/{tools-paraphrase → tools/paraphrase}/index.js +0 -0
- /package/build/commands/{tool → tools/tool}/index.js +0 -0
- /package/build/models/{tool-paraphrase-model.schema.js → tools/paraphrase/paraphrase-model.schema.js} +0 -0
- /package/build/models/{tool-paraphrase-style.schema.js → tools/paraphrase/paraphrase-style.schema.js} +0 -0
- /package/commands/{tools-paraphrase → tools/paraphrase}/index.ts +0 -0
- /package/commands/{tool → tools/tool}/index.ts +0 -0
- /package/models/{tool-paraphrase-model.schema.ts → tools/paraphrase/paraphrase-model.schema.ts} +0 -0
- /package/models/{tool-paraphrase-style.schema.ts → tools/paraphrase/paraphrase-style.schema.ts} +0 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ToolJobSchema } from '../../../models';
|
|
3
|
+
|
|
4
|
+
export namespace TTSCommand {
|
|
5
|
+
export const RequestSchema = z.object({
|
|
6
|
+
modelId: z.string().uuid(),
|
|
7
|
+
voiceId: z.string().uuid(),
|
|
8
|
+
text: z.string(),
|
|
9
|
+
params: z
|
|
10
|
+
.object({
|
|
11
|
+
speed: z.number().optional(),
|
|
12
|
+
similarity: z.number().optional(),
|
|
13
|
+
stability: z.number().optional(),
|
|
14
|
+
style: z.number().optional(),
|
|
15
|
+
language: z.string().optional(),
|
|
16
|
+
})
|
|
17
|
+
.optional()
|
|
18
|
+
.default({}),
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
22
|
+
|
|
23
|
+
export const ResponseSchema = z.object({
|
|
24
|
+
data: ToolJobSchema,
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
28
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { TTSJobSchema } from '../../../models';
|
|
3
|
+
|
|
4
|
+
export namespace UpdateTTSJobTitleCommand {
|
|
5
|
+
export const RequestSchema = z.object({
|
|
6
|
+
title: z.string().min(1).max(40).trim(),
|
|
7
|
+
});
|
|
8
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
9
|
+
|
|
10
|
+
export const RequestParamsSchema = z.object({
|
|
11
|
+
uuid: z.string(),
|
|
12
|
+
});
|
|
13
|
+
export type RequestParams = z.infer<typeof RequestParamsSchema>;
|
|
14
|
+
|
|
15
|
+
export const ResponseSchema = z.object({
|
|
16
|
+
data: TTSJobSchema,
|
|
17
|
+
});
|
|
18
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
19
|
+
}
|
|
@@ -1131,40 +1131,129 @@ export const ERRORS = {
|
|
|
1131
1131
|
httpCode: 400,
|
|
1132
1132
|
},
|
|
1133
1133
|
AI_VENDOR_CREATE_ERROR: {
|
|
1134
|
-
code: '
|
|
1134
|
+
code: 'A250',
|
|
1135
1135
|
message: 'Произошла ошибка при создании AI Vendor',
|
|
1136
1136
|
httpCode: 500,
|
|
1137
1137
|
},
|
|
1138
1138
|
AI_VENDOR_UPDATE_ERROR: {
|
|
1139
|
-
code: '
|
|
1139
|
+
code: 'A251',
|
|
1140
1140
|
message: 'Произошла ошибка при обновлении AI Vendor',
|
|
1141
1141
|
httpCode: 500,
|
|
1142
1142
|
},
|
|
1143
1143
|
AI_VENDOR_DELETE_ERROR: {
|
|
1144
|
-
code: '
|
|
1144
|
+
code: 'A252',
|
|
1145
1145
|
message: 'Произошла ошибка при удалении AI Vendor',
|
|
1146
1146
|
httpCode: 500,
|
|
1147
1147
|
},
|
|
1148
1148
|
AI_VENDOR_FIND_ERROR: {
|
|
1149
|
-
code: '
|
|
1149
|
+
code: 'A253',
|
|
1150
1150
|
message: 'AI Vendor не найден',
|
|
1151
1151
|
httpCode: 404,
|
|
1152
1152
|
},
|
|
1153
1153
|
AI_MODEL_DOES_NOT_SUPPORT_WEB_SEARCH: {
|
|
1154
|
-
code: '
|
|
1154
|
+
code: 'A254',
|
|
1155
1155
|
message: 'ИИ модель не поддерживает поиск в интернете',
|
|
1156
1156
|
httpCode: 400,
|
|
1157
1157
|
},
|
|
1158
1158
|
WEB_SEARCH_NOT_AVAILABLE_TO_USER: {
|
|
1159
|
-
code: '
|
|
1159
|
+
code: 'A255',
|
|
1160
1160
|
message: 'Поиск в интернете не доступен данному пользователю',
|
|
1161
1161
|
httpCode: 403,
|
|
1162
1162
|
},
|
|
1163
1163
|
CHAT_FILE_ATTACHMENT_NOT_ALLOWED: {
|
|
1164
|
-
code: '
|
|
1164
|
+
code: 'A256',
|
|
1165
1165
|
message: 'Незарегистрированный юзер не может прикреплять файлы',
|
|
1166
1166
|
httpCode: 400,
|
|
1167
1167
|
},
|
|
1168
|
+
STT_CONFIG_ERROR: {
|
|
1169
|
+
code: 'A257',
|
|
1170
|
+
message: 'Произошла ошибка при получении конфигурации STT',
|
|
1171
|
+
httpCode: 400,
|
|
1172
|
+
},
|
|
1173
|
+
STT_MODEL_NOT_FOUND: {
|
|
1174
|
+
code: 'A258',
|
|
1175
|
+
message: 'Не удалось найти указанную модель для STT',
|
|
1176
|
+
httpCode: 400,
|
|
1177
|
+
},
|
|
1178
|
+
STT_FILE_SIZE_EXCEEDED: {
|
|
1179
|
+
code: 'A259',
|
|
1180
|
+
message: 'Размер файла превышает допустимый размер',
|
|
1181
|
+
httpCode: 400,
|
|
1182
|
+
},
|
|
1183
|
+
FFMPEG_PROBE_ERROR: {
|
|
1184
|
+
code: 'A260',
|
|
1185
|
+
message: 'Произошла ошибка при анализе аудио',
|
|
1186
|
+
httpCode: 500,
|
|
1187
|
+
},
|
|
1188
|
+
STT_AUDIO_DURATION_EXCEEDED: {
|
|
1189
|
+
code: 'A261',
|
|
1190
|
+
message: 'Превышена максимальная продолжительность аудио',
|
|
1191
|
+
httpCode: 400,
|
|
1192
|
+
},
|
|
1193
|
+
STT_SEND_REQUEST_ERROR: {
|
|
1194
|
+
code: 'A262',
|
|
1195
|
+
message: 'Произошла ошибка при отправке запроса STT',
|
|
1196
|
+
httpCode: 500,
|
|
1197
|
+
},
|
|
1198
|
+
FILE_FAILED_TO_PROBE_DURATION: {
|
|
1199
|
+
code: 'A263',
|
|
1200
|
+
message: 'Произошла ошибка при анализе аудио',
|
|
1201
|
+
httpCode: 400,
|
|
1202
|
+
},
|
|
1203
|
+
TTS_CONFIG_ERROR: {
|
|
1204
|
+
code: 'A264',
|
|
1205
|
+
message: 'Произошла ошибка при получении конфигурации TTS',
|
|
1206
|
+
httpCode: 500,
|
|
1207
|
+
},
|
|
1208
|
+
TTS_SEND_REQUEST_ERROR: {
|
|
1209
|
+
code: 'A265',
|
|
1210
|
+
message: 'Произошла ошибка при отправке запроса TTS',
|
|
1211
|
+
httpCode: 500,
|
|
1212
|
+
},
|
|
1213
|
+
TTS_MODEL_NOT_FOUND: {
|
|
1214
|
+
code: 'A266',
|
|
1215
|
+
message: 'Не удалось найти указанную модель для TTS',
|
|
1216
|
+
httpCode: 400,
|
|
1217
|
+
},
|
|
1218
|
+
TTS_VOICE_NOT_FOUND: {
|
|
1219
|
+
code: 'A267',
|
|
1220
|
+
message: 'Не удалось найти указанную голос для TTS',
|
|
1221
|
+
httpCode: 400,
|
|
1222
|
+
},
|
|
1223
|
+
TTS_MAX_SYMBOLS_EXCEEDED: {
|
|
1224
|
+
code: 'A268',
|
|
1225
|
+
message: 'Превышена максимальная количество символов',
|
|
1226
|
+
},
|
|
1227
|
+
TTS_SET_REACTION_ERROR: {
|
|
1228
|
+
code: 'A269',
|
|
1229
|
+
message: 'Произошла ошибка при установке оценке сообщения',
|
|
1230
|
+
httpCode: 500,
|
|
1231
|
+
},
|
|
1232
|
+
STT_SET_REACTION_ERROR: {
|
|
1233
|
+
code: 'A270',
|
|
1234
|
+
message: 'Произошла ошибка при установке оценке сообщения',
|
|
1235
|
+
httpCode: 500,
|
|
1236
|
+
},
|
|
1237
|
+
TTS_UPDATE_TITLE_ERROR: {
|
|
1238
|
+
code: 'A271',
|
|
1239
|
+
message: 'Произошла ошибка при обновлении названия чата',
|
|
1240
|
+
httpCode: 500,
|
|
1241
|
+
},
|
|
1242
|
+
STT_UPDATE_TITLE_ERROR: {
|
|
1243
|
+
code: 'A272',
|
|
1244
|
+
message: 'Произошла ошибка при обновлении названия чата',
|
|
1245
|
+
httpCode: 500,
|
|
1246
|
+
},
|
|
1247
|
+
TTS_JOB_DELETE_ERROR: {
|
|
1248
|
+
code: 'A273',
|
|
1249
|
+
message: 'Произошла ошибка при удалении сообщения',
|
|
1250
|
+
httpCode: 500,
|
|
1251
|
+
},
|
|
1252
|
+
STT_JOB_DELETE_ERROR: {
|
|
1253
|
+
code: 'A274',
|
|
1254
|
+
message: 'Произошла ошибка при удалении сообщения',
|
|
1255
|
+
httpCode: 500,
|
|
1256
|
+
},
|
|
1168
1257
|
CHAT_IMAGE_ATTACHMENT_FEATURE_MISSING: {
|
|
1169
1258
|
code: 'A253',
|
|
1170
1259
|
message: 'Функция вложения изображений не указана в запросе',
|
package/helpers/index.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './calculate-stt-price.helper';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './calculate-tts-price.helper';
|
package/models/file.schema.ts
CHANGED
|
@@ -7,7 +7,9 @@ export const FileSchema = z.object({
|
|
|
7
7
|
size: z.number(),
|
|
8
8
|
mimeType: z.string(),
|
|
9
9
|
url: z.string(),
|
|
10
|
+
key: z.string(),
|
|
10
11
|
type: z.nativeEnum(FILE_TYPE),
|
|
12
|
+
duration: z.number().nullable(),
|
|
11
13
|
attachmentCost: z.number(),
|
|
12
14
|
createdAt: z.date(),
|
|
13
15
|
updatedAt: z.date(),
|
package/models/index.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export * from './tools';
|
|
1
2
|
export * from './ai-model-config.schema';
|
|
2
3
|
export * from './ai-model-formatted.schema';
|
|
3
4
|
export * from './ai-model.schema';
|
|
@@ -10,6 +11,7 @@ export * from './course.schema';
|
|
|
10
11
|
export * from './date.schema';
|
|
11
12
|
export * from './feedback.schema';
|
|
12
13
|
export * from './file.schema';
|
|
14
|
+
export * from './icon-variants.schema';
|
|
13
15
|
export * from './lesson.schema';
|
|
14
16
|
export * from './message.schema';
|
|
15
17
|
export * from './midjourney-job.schema';
|
|
@@ -28,10 +30,6 @@ export * from './subscription-upgrade-schema';
|
|
|
28
30
|
export * from './subscription.schema';
|
|
29
31
|
export * from './telegram-user-data.schema';
|
|
30
32
|
export * from './tool-job.schema';
|
|
31
|
-
export * from './tool-paraphrase-config.schema';
|
|
32
|
-
export * from './tool-paraphrase-job.schema';
|
|
33
|
-
export * from './tool-paraphrase-model.schema';
|
|
34
|
-
export * from './tool-paraphrase-model.schema';
|
|
35
33
|
export * from './tool.schema';
|
|
36
34
|
export * from './unregistered-user.schema';
|
|
37
35
|
export * from './user-task.schema';
|
package/models/message.schema.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { IMAGE_FORMAT, MESSAGE_STATUS,
|
|
2
|
+
import { IMAGE_FORMAT, MESSAGE_STATUS, USER_REACTION } from '../constants';
|
|
3
3
|
import { FileSchema } from './file.schema';
|
|
4
4
|
|
|
5
5
|
export const MessageSchema = z.object({
|
|
@@ -8,7 +8,7 @@ export const MessageSchema = z.object({
|
|
|
8
8
|
chatId: z.nullable(z.string().uuid()),
|
|
9
9
|
role: z.string(),
|
|
10
10
|
tokenUsage: z.number(),
|
|
11
|
-
userReaction: z.
|
|
11
|
+
userReaction: z.nativeEnum(USER_REACTION).nullable(),
|
|
12
12
|
files: z.array(FileSchema),
|
|
13
13
|
imageFormat: z.nullable(z.nativeEnum(IMAGE_FORMAT)),
|
|
14
14
|
status: z.nativeEnum(MESSAGE_STATUS),
|
package/models/{tool-paraphrase-config.schema.ts → tools/paraphrase/paraphrase-config.schema.ts}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { ParaphraseStyleSchema } from './
|
|
3
|
-
import { ParaphraseModelSchema } from './
|
|
2
|
+
import { ParaphraseStyleSchema } from './paraphrase-style.schema';
|
|
3
|
+
import { ParaphraseModelSchema } from './paraphrase-model.schema';
|
|
4
4
|
|
|
5
5
|
export const ParaphraseToolConfigSchema = z.object({
|
|
6
6
|
maxSymbols: z.number(),
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { STTResponseSchema } from './stt-response.schema';
|
|
3
|
+
import { ToolJobSchema } from '../../tool-job.schema';
|
|
4
|
+
import { USER_REACTION } from '../../../constants';
|
|
5
|
+
|
|
6
|
+
export const STTJobSchema = ToolJobSchema.extend({
|
|
7
|
+
modelId: z.string(),
|
|
8
|
+
title: z.string(),
|
|
9
|
+
reaction: z.nativeEnum(USER_REACTION).nullable(),
|
|
10
|
+
fileUrl: z.string(),
|
|
11
|
+
aiResponse: STTResponseSchema.nullable(),
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
export type STTJob = z.infer<typeof STTJobSchema>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { IconVariantsSchema } from '../../icon-variants.schema';
|
|
3
|
+
|
|
4
|
+
export const STTModelSchema = z.object({
|
|
5
|
+
uuid: z.string(),
|
|
6
|
+
title: z.string(),
|
|
7
|
+
description: z.string(),
|
|
8
|
+
pricePerSecond: z.number(),
|
|
9
|
+
order: z.number(),
|
|
10
|
+
icons: IconVariantsSchema,
|
|
11
|
+
maxDurationSeconds: z.number(),
|
|
12
|
+
maxSizeMB: z.number(),
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export type STTModel = z.infer<typeof STTModelSchema>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ToolJobSchema } from '../../tool-job.schema';
|
|
3
|
+
import { USER_REACTION } from '../../../constants';
|
|
4
|
+
|
|
5
|
+
export const TTSJobParamsSchema = z.object({
|
|
6
|
+
speed: z.number().optional(),
|
|
7
|
+
similarity: z.number().optional(),
|
|
8
|
+
stability: z.number().optional(),
|
|
9
|
+
style: z.number().optional(),
|
|
10
|
+
});
|
|
11
|
+
export type TTSJobParams = z.infer<typeof TTSJobParamsSchema>;
|
|
12
|
+
|
|
13
|
+
export const TTSJobSchema = ToolJobSchema.extend({
|
|
14
|
+
userInput: z.string(),
|
|
15
|
+
title: z.string(),
|
|
16
|
+
reaction: z.nativeEnum(USER_REACTION).nullable(),
|
|
17
|
+
aiResponse: z.string().nullable(),
|
|
18
|
+
params: TTSJobParamsSchema,
|
|
19
|
+
modelId: z.string(),
|
|
20
|
+
voiceId: z.string(),
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
export type TTSJob = z.infer<typeof TTSJobSchema>;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { IconVariantsSchema } from '../../icon-variants.schema';
|
|
3
|
+
|
|
4
|
+
export const TTSVoiceSchema = z.object({
|
|
5
|
+
id: z.string(),
|
|
6
|
+
icon: z.string(),
|
|
7
|
+
title: z.string(),
|
|
8
|
+
previewUrl: z.string(),
|
|
9
|
+
description: z.string(),
|
|
10
|
+
languages: z.array(
|
|
11
|
+
z.object({
|
|
12
|
+
code: z.string(),
|
|
13
|
+
title: z.string(),
|
|
14
|
+
icon: z.string(),
|
|
15
|
+
order: z.number(),
|
|
16
|
+
}),
|
|
17
|
+
),
|
|
18
|
+
order: z.number(),
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
export const TTSSliderSchema = z.object({
|
|
22
|
+
title: z.string(),
|
|
23
|
+
description: z.string(),
|
|
24
|
+
icons: IconVariantsSchema,
|
|
25
|
+
min: z.number(),
|
|
26
|
+
minLabel: z.string(),
|
|
27
|
+
max: z.number(),
|
|
28
|
+
maxLabel: z.string(),
|
|
29
|
+
step: z.number(),
|
|
30
|
+
default: z.number(),
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
export const TTSModelParams = z
|
|
34
|
+
.object({
|
|
35
|
+
speed: TTSSliderSchema,
|
|
36
|
+
stability: TTSSliderSchema,
|
|
37
|
+
similarity: TTSSliderSchema,
|
|
38
|
+
style: TTSSliderSchema,
|
|
39
|
+
})
|
|
40
|
+
.partial();
|
|
41
|
+
|
|
42
|
+
export const TTSModelSchema = z.object({
|
|
43
|
+
uuid: z.string(),
|
|
44
|
+
title: z.string(),
|
|
45
|
+
description: z.string(),
|
|
46
|
+
pricePerSymbol: z.number(),
|
|
47
|
+
order: z.number(),
|
|
48
|
+
icons: IconVariantsSchema,
|
|
49
|
+
maxInputLength: z.number(),
|
|
50
|
+
params: TTSModelParams,
|
|
51
|
+
voices: z.array(TTSVoiceSchema),
|
|
52
|
+
});
|
package/package.json
CHANGED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ParaphraseToolConfigSchema = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
const tool_paraphrase_style_schema_1 = require("./tool-paraphrase-style.schema");
|
|
6
|
-
const tool_paraphrase_model_schema_1 = require("./tool-paraphrase-model.schema");
|
|
7
|
-
exports.ParaphraseToolConfigSchema = zod_1.z.object({
|
|
8
|
-
maxSymbols: zod_1.z.number(),
|
|
9
|
-
styles: zod_1.z.array(tool_paraphrase_style_schema_1.ParaphraseStyleSchema),
|
|
10
|
-
types: zod_1.z.array(tool_paraphrase_model_schema_1.ParaphraseModelSchema),
|
|
11
|
-
});
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/models/{tool-paraphrase-model.schema.ts → tools/paraphrase/paraphrase-model.schema.ts}
RENAMED
|
File without changes
|
/package/models/{tool-paraphrase-style.schema.ts → tools/paraphrase/paraphrase-style.schema.ts}
RENAMED
|
File without changes
|