@purpleschool/gptbot 0.8.70-stage-2 → 0.8.71-stage-2
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/build/commands/chat/get-chats-config.command.js +1 -0
- package/build/commands/message/create-text-message.command.js +1 -1
- package/build/constants/errors/errors.js +8 -3
- package/build/constants/file/enums/file-usage-mode.enum.js +8 -0
- package/build/constants/file/enums/index.js +1 -0
- package/build/models/file-attachment.schema.js +18 -0
- package/build/models/index.js +1 -0
- package/commands/chat/get-chats-config.command.ts +1 -0
- package/commands/message/create-text-message.command.ts +2 -2
- package/constants/errors/errors.ts +8 -3
- package/constants/file/enums/file-usage-mode.enum.ts +4 -0
- package/constants/file/enums/index.ts +1 -0
- package/models/file-attachment.schema.ts +24 -0
- package/models/index.ts +1 -0
- package/package.json +1 -1
|
@@ -8,6 +8,7 @@ var GetChatsConfigCommand;
|
|
|
8
8
|
data: zod_1.z.object({
|
|
9
9
|
maxFileAttachments: zod_1.z.number(),
|
|
10
10
|
imageAttachmentCost: zod_1.z.number(),
|
|
11
|
+
fileSearchAttachmentCost: zod_1.z.number(),
|
|
11
12
|
imagePollingInterval: zod_1.z.number(),
|
|
12
13
|
isWebSearchAvailable: zod_1.z.boolean(),
|
|
13
14
|
isAttachmentAvailable: zod_1.z.boolean(),
|
|
@@ -8,7 +8,7 @@ var CreateTextMessageCommand;
|
|
|
8
8
|
(function (CreateTextMessageCommand) {
|
|
9
9
|
CreateTextMessageCommand.RequestSchema = zod_1.z.object({
|
|
10
10
|
text: zod_1.z.string(),
|
|
11
|
-
files: zod_1.z.array(
|
|
11
|
+
files: zod_1.z.array(models_1.FileAttachmentSchema).optional().default([]),
|
|
12
12
|
features: zod_1.z.array(zod_1.z.nativeEnum(constants_1.AI_MODEL_FEATURE)).optional().default([]),
|
|
13
13
|
});
|
|
14
14
|
CreateTextMessageCommand.RequestParamSchema = models_1.ChatSchema.pick({
|
|
@@ -2637,18 +2637,23 @@ exports.ERRORS = {
|
|
|
2637
2637
|
message: 'Произошла ошибка при получении пользователя',
|
|
2638
2638
|
httpCode: 500,
|
|
2639
2639
|
},
|
|
2640
|
-
|
|
2640
|
+
FILE_CONTENT_EXCEEDS_CONTEXT_LIMIT: {
|
|
2641
2641
|
code: 'A538',
|
|
2642
|
+
message: 'Размер файла превышает лимит контекста модели',
|
|
2643
|
+
httpCode: 400,
|
|
2644
|
+
},
|
|
2645
|
+
IMAGE_GENERATION_MODEL_FIND_ERROR: {
|
|
2646
|
+
code: 'A539',
|
|
2642
2647
|
message: 'Произошла ошибка при получении модели для генерации изображений',
|
|
2643
2648
|
httpCode: 500,
|
|
2644
2649
|
},
|
|
2645
2650
|
COMMUNITY_POST_TRACK_INDEX_REQUIRED: {
|
|
2646
|
-
code: '
|
|
2651
|
+
code: 'A540',
|
|
2647
2652
|
message: 'Индекс трека обязателен для музыкального поста',
|
|
2648
2653
|
httpCode: 400,
|
|
2649
2654
|
},
|
|
2650
2655
|
COMMUNITY_POST_TRACK_INDEX_OUT_OF_RANGE: {
|
|
2651
|
-
code: '
|
|
2656
|
+
code: 'A541',
|
|
2652
2657
|
message: 'Индекс трека выходит за пределы допустимого диапазона',
|
|
2653
2658
|
httpCode: 400,
|
|
2654
2659
|
},
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FILE_USAGE_MODE = void 0;
|
|
4
|
+
var FILE_USAGE_MODE;
|
|
5
|
+
(function (FILE_USAGE_MODE) {
|
|
6
|
+
FILE_USAGE_MODE["SEARCH"] = "search";
|
|
7
|
+
FILE_USAGE_MODE["CONTEXT"] = "context";
|
|
8
|
+
})(FILE_USAGE_MODE || (exports.FILE_USAGE_MODE = FILE_USAGE_MODE = {}));
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FileAttachmentSchema = exports.ImageFileAttachmentSchema = exports.TextFileAttachmentSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const constants_1 = require("../constants");
|
|
6
|
+
exports.TextFileAttachmentSchema = zod_1.z.object({
|
|
7
|
+
fileId: zod_1.z.string().uuid(),
|
|
8
|
+
type: zod_1.z.enum([constants_1.FILE_TYPE.TEXT, constants_1.FILE_TYPE.DOCUMENT]),
|
|
9
|
+
usageMode: zod_1.z.nativeEnum(constants_1.FILE_USAGE_MODE),
|
|
10
|
+
});
|
|
11
|
+
exports.ImageFileAttachmentSchema = zod_1.z.object({
|
|
12
|
+
fileId: zod_1.z.string().uuid(),
|
|
13
|
+
type: zod_1.z.literal(constants_1.FILE_TYPE.IMAGE),
|
|
14
|
+
});
|
|
15
|
+
exports.FileAttachmentSchema = zod_1.z.discriminatedUnion('type', [
|
|
16
|
+
exports.TextFileAttachmentSchema,
|
|
17
|
+
exports.ImageFileAttachmentSchema,
|
|
18
|
+
]);
|
package/build/models/index.js
CHANGED
|
@@ -28,6 +28,7 @@ __exportStar(require("./course.schema"), exports);
|
|
|
28
28
|
__exportStar(require("./date.schema"), exports);
|
|
29
29
|
__exportStar(require("./feedback.schema"), exports);
|
|
30
30
|
__exportStar(require("./file.schema"), exports);
|
|
31
|
+
__exportStar(require("./file-attachment.schema"), exports);
|
|
31
32
|
__exportStar(require("./key-value.schema"), exports);
|
|
32
33
|
__exportStar(require("./form-submission.schema"), exports);
|
|
33
34
|
__exportStar(require("./icon-variants.schema"), exports);
|
|
@@ -5,6 +5,7 @@ export namespace GetChatsConfigCommand {
|
|
|
5
5
|
data: z.object({
|
|
6
6
|
maxFileAttachments: z.number(),
|
|
7
7
|
imageAttachmentCost: z.number(),
|
|
8
|
+
fileSearchAttachmentCost: z.number(),
|
|
8
9
|
imagePollingInterval: z.number(),
|
|
9
10
|
isWebSearchAvailable: z.boolean(),
|
|
10
11
|
isAttachmentAvailable: z.boolean(),
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { AI_MODEL_FEATURE } from '../../constants';
|
|
2
|
-
import { ChatSchema, MessageSchema } from '../../models';
|
|
2
|
+
import { ChatSchema, FileAttachmentSchema, MessageSchema } from '../../models';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
|
|
5
5
|
export namespace CreateTextMessageCommand {
|
|
6
6
|
export const RequestSchema = z.object({
|
|
7
7
|
text: z.string(),
|
|
8
|
-
files: z.array(
|
|
8
|
+
files: z.array(FileAttachmentSchema).optional().default([]),
|
|
9
9
|
features: z.array(z.nativeEnum(AI_MODEL_FEATURE)).optional().default([]),
|
|
10
10
|
});
|
|
11
11
|
|
|
@@ -2645,18 +2645,23 @@ export const ERRORS = {
|
|
|
2645
2645
|
message: 'Произошла ошибка при получении пользователя',
|
|
2646
2646
|
httpCode: 500,
|
|
2647
2647
|
},
|
|
2648
|
-
|
|
2648
|
+
FILE_CONTENT_EXCEEDS_CONTEXT_LIMIT: {
|
|
2649
2649
|
code: 'A538',
|
|
2650
|
+
message: 'Размер файла превышает лимит контекста модели',
|
|
2651
|
+
httpCode: 400,
|
|
2652
|
+
},
|
|
2653
|
+
IMAGE_GENERATION_MODEL_FIND_ERROR: {
|
|
2654
|
+
code: 'A539',
|
|
2650
2655
|
message: 'Произошла ошибка при получении модели для генерации изображений',
|
|
2651
2656
|
httpCode: 500,
|
|
2652
2657
|
},
|
|
2653
2658
|
COMMUNITY_POST_TRACK_INDEX_REQUIRED: {
|
|
2654
|
-
code: '
|
|
2659
|
+
code: 'A540',
|
|
2655
2660
|
message: 'Индекс трека обязателен для музыкального поста',
|
|
2656
2661
|
httpCode: 400,
|
|
2657
2662
|
},
|
|
2658
2663
|
COMMUNITY_POST_TRACK_INDEX_OUT_OF_RANGE: {
|
|
2659
|
-
code: '
|
|
2664
|
+
code: 'A541',
|
|
2660
2665
|
message: 'Индекс трека выходит за пределы допустимого диапазона',
|
|
2661
2666
|
httpCode: 400,
|
|
2662
2667
|
},
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { FILE_TYPE, FILE_USAGE_MODE } from '../constants';
|
|
3
|
+
|
|
4
|
+
export const TextFileAttachmentSchema = z.object({
|
|
5
|
+
fileId: z.string().uuid(),
|
|
6
|
+
type: z.enum([FILE_TYPE.TEXT, FILE_TYPE.DOCUMENT]),
|
|
7
|
+
usageMode: z.nativeEnum(FILE_USAGE_MODE),
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
export type TextFileAttachment = z.infer<typeof TextFileAttachmentSchema>;
|
|
11
|
+
|
|
12
|
+
export const ImageFileAttachmentSchema = z.object({
|
|
13
|
+
fileId: z.string().uuid(),
|
|
14
|
+
type: z.literal(FILE_TYPE.IMAGE),
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export type ImageFileAttachment = z.infer<typeof ImageFileAttachmentSchema>;
|
|
18
|
+
|
|
19
|
+
export const FileAttachmentSchema = z.discriminatedUnion('type', [
|
|
20
|
+
TextFileAttachmentSchema,
|
|
21
|
+
ImageFileAttachmentSchema,
|
|
22
|
+
]);
|
|
23
|
+
|
|
24
|
+
export type FileAttachment = z.infer<typeof FileAttachmentSchema>;
|
package/models/index.ts
CHANGED
|
@@ -12,6 +12,7 @@ export * from './course.schema';
|
|
|
12
12
|
export * from './date.schema';
|
|
13
13
|
export * from './feedback.schema';
|
|
14
14
|
export * from './file.schema';
|
|
15
|
+
export * from './file-attachment.schema';
|
|
15
16
|
export * from './key-value.schema';
|
|
16
17
|
export * from './form-submission.schema';
|
|
17
18
|
export * from './icon-variants.schema';
|