@purpleschool/gptbot 0.14.24-stage2 → 0.14.25
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/avatar-studio.ts +1 -0
- package/api/controllers/http/image-recognition.ts +15 -0
- package/api/controllers/http/index.ts +1 -0
- package/api/routes.ts +36 -0
- package/build/api/controllers/http/avatar-studio.js +1 -0
- package/build/api/controllers/http/image-recognition.js +17 -0
- package/build/api/controllers/http/index.js +1 -0
- package/build/api/routes.js +24 -0
- package/build/commands/avatar-studio/generation-job/generate-avatar-studio-media-image.command.js +19 -0
- package/build/commands/avatar-studio/generation-job/generate-avatar-studio-talking-avatar.command.js +4 -2
- package/build/commands/avatar-studio/generation-job/index.js +1 -0
- package/build/commands/avatar-studio/media/create-avatar-studio-media-from-file.command.js +1 -0
- package/build/commands/avatar-studio/media/update-avatar-studio-media.command.js +1 -0
- package/build/commands/avatar-studio/scriptwriter/create-avatar-studio-scriptwriter-message.command.js +4 -0
- package/build/commands/avatar-studio/shared/avatar-studio-common.schema.js +13 -4
- package/build/commands/avatar-studio/shared/get-avatar-studio-config.query.js +1 -1
- package/build/commands/avatar-studio/voice/find-avatar-studio-clip-voices.query.js +4 -1
- package/build/commands/avatar-studio/voice/find-avatar-studio-voices.query.js +7 -1
- package/build/commands/avatar-studio/voice/update-avatar-studio-clip-voice.command.js +5 -2
- package/build/commands/tools/image-recognition/delete-all-image-recognition-jobs.command.js +8 -0
- package/build/commands/tools/image-recognition/delete-image-recognition-job-by-uuid.command.js +11 -0
- package/build/commands/tools/image-recognition/find-image-recognition-job-by-uuid.command.js +14 -0
- package/build/commands/tools/image-recognition/find-image-recognition-jobs.command.js +24 -0
- package/build/commands/tools/image-recognition/get-image-recognition-tool-config.command.js +11 -0
- package/build/commands/tools/image-recognition/image-recognition.command.js +19 -0
- package/build/commands/tools/image-recognition/index.js +26 -0
- package/build/commands/tools/image-recognition/retry-image-recognition-job.command.js +24 -0
- package/build/commands/tools/image-recognition/set-reaction-to-image-recognition-job.command.js +28 -0
- package/build/commands/tools/image-recognition/update-image-recognition-job-favorite.command.js +17 -0
- package/build/commands/tools/image-recognition/update-image-recognition-job-title.command.js +17 -0
- package/build/commands/tools/index.js +1 -0
- package/build/constants/avatar-studio/enums/avatar-studio-voice-source.enum.js +1 -0
- package/build/constants/cabinet/enums/statistics-request-type.enum.js +1 -0
- package/build/constants/file/file.constants.js +6 -0
- package/build/models/avatar-studio/avatar-studio.schema.js +25 -14
- package/build/models/tools/image-recognition/image-recognition-category.schema.js +14 -0
- package/build/models/tools/image-recognition/image-recognition-config.schema.js +10 -0
- package/build/models/tools/image-recognition/image-recognition-job.schema.js +22 -0
- package/build/models/tools/image-recognition/image-recognition-model.schema.js +25 -0
- package/build/models/tools/image-recognition/index.js +20 -0
- package/build/models/tools/index.js +1 -0
- package/commands/avatar-studio/generation-job/generate-avatar-studio-media-image.command.ts +19 -0
- package/commands/avatar-studio/generation-job/generate-avatar-studio-talking-avatar.command.ts +6 -4
- package/commands/avatar-studio/generation-job/index.ts +1 -0
- package/commands/avatar-studio/media/create-avatar-studio-media-from-file.command.ts +1 -0
- package/commands/avatar-studio/media/update-avatar-studio-media.command.ts +1 -0
- package/commands/avatar-studio/scriptwriter/create-avatar-studio-scriptwriter-message.command.ts +4 -0
- package/commands/avatar-studio/shared/avatar-studio-common.schema.ts +17 -5
- package/commands/avatar-studio/shared/get-avatar-studio-config.query.ts +2 -2
- package/commands/avatar-studio/voice/find-avatar-studio-clip-voices.query.ts +4 -1
- package/commands/avatar-studio/voice/find-avatar-studio-voices.query.ts +8 -0
- package/commands/avatar-studio/voice/update-avatar-studio-clip-voice.command.ts +6 -3
- package/commands/tools/image-recognition/delete-all-image-recognition-jobs.command.ts +6 -0
- package/commands/tools/image-recognition/delete-image-recognition-job-by-uuid.command.ts +11 -0
- package/commands/tools/image-recognition/find-image-recognition-job-by-uuid.command.ts +16 -0
- package/commands/tools/image-recognition/find-image-recognition-jobs.command.ts +24 -0
- package/commands/tools/image-recognition/get-image-recognition-tool-config.command.ts +10 -0
- package/commands/tools/image-recognition/image-recognition.command.ts +20 -0
- package/commands/tools/image-recognition/index.ts +10 -0
- package/commands/tools/image-recognition/retry-image-recognition-job.command.ts +26 -0
- package/commands/tools/image-recognition/set-reaction-to-image-recognition-job.command.ts +33 -0
- package/commands/tools/image-recognition/update-image-recognition-job-favorite.command.ts +19 -0
- package/commands/tools/image-recognition/update-image-recognition-job-title.command.ts +19 -0
- package/commands/tools/index.ts +1 -0
- package/constants/avatar-studio/enums/avatar-studio-voice-source.enum.ts +1 -0
- package/constants/cabinet/enums/statistics-request-type.enum.ts +1 -0
- package/constants/file/file.constants.ts +6 -0
- package/models/avatar-studio/avatar-studio.schema.ts +34 -4
- package/models/tools/image-recognition/image-recognition-category.schema.ts +14 -0
- package/models/tools/image-recognition/image-recognition-config.schema.ts +10 -0
- package/models/tools/image-recognition/image-recognition-job.schema.ts +25 -0
- package/models/tools/image-recognition/image-recognition-model.schema.ts +28 -0
- package/models/tools/image-recognition/index.ts +4 -0
- package/models/tools/index.ts +1 -0
- package/package.json +1 -1
|
@@ -18,6 +18,12 @@ export const SUPPORTED_FILES = new Map<
|
|
|
18
18
|
['image/webp', { type: FILE_TYPE.IMAGE, size: MAX_IMAGE_UPLOAD_SIZE }],
|
|
19
19
|
['audio/mp3', { type: FILE_TYPE.AUDIO, size: MAX_AUDIO_UPLOAD_SIZE }],
|
|
20
20
|
['audio/mpeg', { type: FILE_TYPE.AUDIO, size: MAX_AUDIO_UPLOAD_SIZE }],
|
|
21
|
+
['audio/webm', { type: FILE_TYPE.AUDIO, size: MAX_AUDIO_UPLOAD_SIZE }],
|
|
22
|
+
['audio/webm;codecs=opus', { type: FILE_TYPE.AUDIO, size: MAX_AUDIO_UPLOAD_SIZE }],
|
|
23
|
+
['video/webm', { type: FILE_TYPE.AUDIO, size: MAX_AUDIO_UPLOAD_SIZE }],
|
|
24
|
+
['audio/mp4', { type: FILE_TYPE.AUDIO, size: MAX_AUDIO_UPLOAD_SIZE }],
|
|
25
|
+
['audio/ogg', { type: FILE_TYPE.AUDIO, size: MAX_AUDIO_UPLOAD_SIZE }],
|
|
26
|
+
['audio/ogg;codecs=opus', { type: FILE_TYPE.AUDIO, size: MAX_AUDIO_UPLOAD_SIZE }],
|
|
21
27
|
['audio/wave', { type: FILE_TYPE.AUDIO, size: MAX_AUDIO_UPLOAD_SIZE }],
|
|
22
28
|
['audio/wav', { type: FILE_TYPE.AUDIO, size: MAX_AUDIO_UPLOAD_SIZE }],
|
|
23
29
|
['audio/x-wav', { type: FILE_TYPE.AUDIO, size: MAX_AUDIO_UPLOAD_SIZE }],
|
|
@@ -45,13 +45,14 @@ export type AvatarStudioWordTiming = z.infer<typeof AvatarStudioWordTimingSchema
|
|
|
45
45
|
|
|
46
46
|
export const AvatarStudioMediaSchema = z.object({
|
|
47
47
|
uuid: z.string().uuid(),
|
|
48
|
-
userId: z.string().uuid(),
|
|
48
|
+
userId: z.string().uuid().nullable(),
|
|
49
49
|
clipId: z.string().uuid().nullable(),
|
|
50
50
|
sceneId: z.string().uuid().nullable(),
|
|
51
51
|
fileId: z.string().uuid(),
|
|
52
52
|
kind: z.nativeEnum(AVATAR_STUDIO_MEDIA_KIND),
|
|
53
53
|
source: z.nativeEnum(AVATAR_STUDIO_MEDIA_SOURCE),
|
|
54
54
|
role: z.nativeEnum(AVATAR_STUDIO_MEDIA_ROLE),
|
|
55
|
+
title: z.string().nullable(),
|
|
55
56
|
prompt: z.string().nullable(),
|
|
56
57
|
toolJobId: z.string().uuid().nullable(),
|
|
57
58
|
durationSeconds: z.number().nullable(),
|
|
@@ -72,10 +73,32 @@ export const AvatarStudioSceneReferenceMediaSchema = z.object({
|
|
|
72
73
|
});
|
|
73
74
|
export type AvatarStudioSceneReferenceMedia = z.infer<typeof AvatarStudioSceneReferenceMediaSchema>;
|
|
74
75
|
|
|
75
|
-
export const
|
|
76
|
+
export const AvatarStudioTrimConfigFields = {
|
|
77
|
+
trimStart: z.number().nonnegative().nullable().default(null),
|
|
78
|
+
trimEnd: z.number().nonnegative().nullable().default(null),
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
export const validateAvatarStudioTrim = (
|
|
82
|
+
{ trimStart, trimEnd }: { trimStart?: number | null; trimEnd?: number | null },
|
|
83
|
+
ctx: z.RefinementCtx,
|
|
84
|
+
): void => {
|
|
85
|
+
if (trimStart != null && trimEnd != null && trimEnd <= trimStart) {
|
|
86
|
+
ctx.addIssue({
|
|
87
|
+
code: z.ZodIssueCode.custom,
|
|
88
|
+
message: 'trimEnd must be greater than trimStart',
|
|
89
|
+
path: ['trimEnd'],
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
export const AvatarStudioSceneVoiceConfigBaseSchema = z.object({
|
|
76
95
|
text: z.string().default(''),
|
|
77
96
|
mediaId: z.string().uuid().nullable().default(null),
|
|
97
|
+
...AvatarStudioTrimConfigFields,
|
|
78
98
|
});
|
|
99
|
+
|
|
100
|
+
export const AvatarStudioSceneVoiceConfigSchema =
|
|
101
|
+
AvatarStudioSceneVoiceConfigBaseSchema.superRefine(validateAvatarStudioTrim);
|
|
79
102
|
export type AvatarStudioSceneVoiceConfig = z.infer<typeof AvatarStudioSceneVoiceConfigSchema>;
|
|
80
103
|
|
|
81
104
|
export const AvatarStudioSceneImageConfigSchema = z.object({
|
|
@@ -84,13 +107,17 @@ export const AvatarStudioSceneImageConfigSchema = z.object({
|
|
|
84
107
|
});
|
|
85
108
|
export type AvatarStudioSceneImageConfig = z.infer<typeof AvatarStudioSceneImageConfigSchema>;
|
|
86
109
|
|
|
87
|
-
export const
|
|
110
|
+
export const AvatarStudioSceneVideoConfigBaseSchema = z.object({
|
|
88
111
|
prompt: z.string().nullable().default(null),
|
|
89
112
|
durationSeconds: z.number().positive().default(5),
|
|
90
113
|
videoMode: z.nativeEnum(AVATAR_STUDIO_VIDEO_MODE).default(AVATAR_STUDIO_VIDEO_MODE.B_ROLL),
|
|
91
114
|
quality: z.nativeEnum(AVATAR_STUDIO_VIDEO_QUALITY).default(AVATAR_STUDIO_VIDEO_QUALITY.P720),
|
|
92
115
|
sound: z.boolean().default(false),
|
|
116
|
+
...AvatarStudioTrimConfigFields,
|
|
93
117
|
});
|
|
118
|
+
|
|
119
|
+
export const AvatarStudioSceneVideoConfigSchema =
|
|
120
|
+
AvatarStudioSceneVideoConfigBaseSchema.superRefine(validateAvatarStudioTrim);
|
|
94
121
|
export type AvatarStudioSceneVideoConfig = z.infer<typeof AvatarStudioSceneVideoConfigSchema>;
|
|
95
122
|
|
|
96
123
|
export const AvatarStudioSceneGenerationJobSchema = z.object({
|
|
@@ -141,10 +168,13 @@ export type AvatarStudioScene = z.infer<typeof AvatarStudioSceneSchema>;
|
|
|
141
168
|
|
|
142
169
|
export const AvatarStudioVoiceSchema = z.object({
|
|
143
170
|
uuid: z.string().uuid(),
|
|
144
|
-
userId: z.string().uuid(),
|
|
171
|
+
userId: z.string().uuid().nullable(),
|
|
145
172
|
clipId: z.string().uuid().nullable(),
|
|
146
173
|
title: z.string(),
|
|
147
174
|
source: z.nativeEnum(AVATAR_STUDIO_VOICE_SOURCE),
|
|
175
|
+
presetKey: z.string().nullable(),
|
|
176
|
+
gender: z.enum(['male', 'female']).nullable(),
|
|
177
|
+
sortOrder: z.number().int().nullable(),
|
|
148
178
|
sampleMediaId: z.string().uuid().nullable(),
|
|
149
179
|
sampleText: z.string().nullable(),
|
|
150
180
|
metadata: JsonObjectSchema.nullable(),
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
export const ImageRecognitionCategorySchema = z.object({
|
|
4
|
+
uuid: z.string(),
|
|
5
|
+
parentId: z.string().nullable(),
|
|
6
|
+
title: z.string(),
|
|
7
|
+
systemPrompt: z.string(),
|
|
8
|
+
order: z.number(),
|
|
9
|
+
status: z.string(),
|
|
10
|
+
createdAt: z.date(),
|
|
11
|
+
updatedAt: z.date(),
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
export type ImageRecognitionCategory = z.infer<typeof ImageRecognitionCategorySchema>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ImageRecognitionModelSchema } from './image-recognition-model.schema';
|
|
3
|
+
import { ImageRecognitionCategorySchema } from './image-recognition-category.schema';
|
|
4
|
+
|
|
5
|
+
export const ImageRecognitionConfigSchema = z.object({
|
|
6
|
+
models: z.array(ImageRecognitionModelSchema),
|
|
7
|
+
categories: z.array(ImageRecognitionCategorySchema),
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
export type ImageRecognitionConfig = z.infer<typeof ImageRecognitionConfigSchema>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { USER_REACTION } from '../../../constants';
|
|
3
|
+
import { ToolJobSchema } from '../../tool-job.schema';
|
|
4
|
+
import { AttachedToolFileSchema } from '../common';
|
|
5
|
+
|
|
6
|
+
export const ImageRecognitionJobParamsSchema = z.object({
|
|
7
|
+
attachedFiles: z.array(AttachedToolFileSchema),
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
export type ImageRecognitionJobParams = z.infer<typeof ImageRecognitionJobParamsSchema>;
|
|
11
|
+
|
|
12
|
+
export const ImageRecognitionJobSchema = ToolJobSchema.extend({
|
|
13
|
+
title: z.string(),
|
|
14
|
+
prompt: z.string().nullable(),
|
|
15
|
+
categoryId: z.string(),
|
|
16
|
+
aiOutput: z.string().nullable(),
|
|
17
|
+
reaction: z.nativeEnum(USER_REACTION).nullable(),
|
|
18
|
+
dislikeReason: z.string().nullable(),
|
|
19
|
+
modelId: z.string(),
|
|
20
|
+
price: z.number(),
|
|
21
|
+
params: ImageRecognitionJobParamsSchema,
|
|
22
|
+
completedAt: z.date().nullable().optional(),
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
export type ImageRecognitionJob = z.infer<typeof ImageRecognitionJobSchema>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { IconVariantsSchema } from '../../icon-variants.schema';
|
|
3
|
+
|
|
4
|
+
export const ImageRecognitionModelParamsSchema = z.object({
|
|
5
|
+
imageAttachment: z.object({
|
|
6
|
+
supported: z.boolean(),
|
|
7
|
+
maxImages: z.number(),
|
|
8
|
+
acceptedTypes: z.array(z.string()),
|
|
9
|
+
}),
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
export type ImageRecognitionModelParams = z.infer<typeof ImageRecognitionModelParamsSchema>;
|
|
13
|
+
|
|
14
|
+
export const ImageRecognitionModelSchema = z.object({
|
|
15
|
+
uuid: z.string(),
|
|
16
|
+
title: z.string(),
|
|
17
|
+
description: z.string(),
|
|
18
|
+
aiModel: z.string(),
|
|
19
|
+
price: z.number(),
|
|
20
|
+
order: z.number(),
|
|
21
|
+
status: z.string(),
|
|
22
|
+
icons: IconVariantsSchema,
|
|
23
|
+
params: ImageRecognitionModelParamsSchema,
|
|
24
|
+
createdAt: z.date(),
|
|
25
|
+
updatedAt: z.date(),
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
export type ImageRecognitionModel = z.infer<typeof ImageRecognitionModelSchema>;
|
package/models/tools/index.ts
CHANGED