@purpleschool/gptbot 0.14.8-stage-2 → 0.14.10-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/api/controllers/http/agents/agent-files.ts +5 -0
- package/api/controllers/http/agents/index.ts +1 -0
- package/build/api/controllers/http/agents/agent-files.js +7 -0
- package/build/api/controllers/http/agents/index.js +1 -0
- package/build/commands/agents/agent-dialog/get-cabinet-price-preview.command.js +2 -0
- package/build/commands/agents/agent-dialog/get-dialog-context-length.command.js +5 -7
- package/build/commands/agents/agent-dialog/send-cabinet-message.command.js +1 -0
- package/build/commands/agents/agent-files/index.js +17 -0
- package/build/commands/agents/agent-files/upload-agent-chat-file.command.js +25 -0
- package/build/commands/agents/index.js +1 -0
- package/build/commands/b2b-compatible/anthropic-messages.command.js +1 -1
- package/build/constants/agents/enums/index.js +1 -0
- package/build/constants/agents/enums/message-file-type.enum.js +12 -0
- package/build/constants/canvas-edge/enums/input-output-type.enum.js +1 -0
- package/build/models/agents/agent-dialog-message-file.schema.js +14 -0
- package/build/models/agents/agent-dialog-message.schema.js +2 -1
- package/build/models/agents/index.js +1 -0
- package/build/models/canvas-node.schema.js +1 -0
- package/build/models/tools/video/video-job.schema.js +2 -0
- package/build/models/tools/video/video-model.schema.js +7 -0
- package/commands/agents/agent-dialog/get-cabinet-price-preview.command.ts +2 -0
- package/commands/agents/agent-dialog/get-dialog-context-length.command.ts +5 -9
- package/commands/agents/agent-dialog/send-cabinet-message.command.ts +2 -3
- package/commands/agents/agent-files/index.ts +1 -0
- package/commands/agents/agent-files/upload-agent-chat-file.command.ts +29 -0
- package/commands/agents/index.ts +1 -0
- package/commands/b2b-compatible/anthropic-messages.command.ts +1 -1
- package/constants/agents/enums/index.ts +1 -0
- package/constants/agents/enums/message-file-type.enum.ts +8 -0
- package/constants/canvas-edge/enums/input-output-type.enum.ts +1 -0
- package/models/agents/agent-dialog-message-file.schema.ts +14 -0
- package/models/agents/agent-dialog-message.schema.ts +2 -1
- package/models/agents/index.ts +1 -0
- package/models/canvas-node.schema.ts +1 -0
- package/models/tools/video/video-job.schema.ts +2 -0
- package/models/tools/video/video-model.schema.ts +7 -0
- package/package.json +1 -1
|
@@ -5,6 +5,7 @@ export * from './agent-lead-form';
|
|
|
5
5
|
export * from './agent-lead';
|
|
6
6
|
export * from './agent-tool';
|
|
7
7
|
export * from './agent-document';
|
|
8
|
+
export * from './agent-files';
|
|
8
9
|
export * from './agent-template';
|
|
9
10
|
export * from './agent';
|
|
10
11
|
export * from './agent-statistics';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AGENT_FILES_ROUTES = exports.AGENT_FILES_CONTROLLER_PRIVATE = void 0;
|
|
4
|
+
exports.AGENT_FILES_CONTROLLER_PRIVATE = 'private/agents-files';
|
|
5
|
+
exports.AGENT_FILES_ROUTES = {
|
|
6
|
+
UPLOAD: (agentId) => `${agentId}/files`,
|
|
7
|
+
};
|
|
@@ -21,6 +21,7 @@ __exportStar(require("./agent-lead-form"), exports);
|
|
|
21
21
|
__exportStar(require("./agent-lead"), exports);
|
|
22
22
|
__exportStar(require("./agent-tool"), exports);
|
|
23
23
|
__exportStar(require("./agent-document"), exports);
|
|
24
|
+
__exportStar(require("./agent-files"), exports);
|
|
24
25
|
__exportStar(require("./agent-template"), exports);
|
|
25
26
|
__exportStar(require("./agent"), exports);
|
|
26
27
|
__exportStar(require("./agent-statistics"), exports);
|
|
@@ -8,7 +8,9 @@ var GetCabinetPricePreviewCommand;
|
|
|
8
8
|
agentId: zod_1.z.string().uuid(),
|
|
9
9
|
});
|
|
10
10
|
GetCabinetPricePreviewCommand.RequestBodySchema = zod_1.z.object({
|
|
11
|
+
/** Длина текста сообщения (без контента файлов — его резолвит rugpt-agents по fileIds) */
|
|
11
12
|
inputLength: zod_1.z.number().int().min(0),
|
|
13
|
+
/** Идентификаторы предзагруженных файлов */
|
|
12
14
|
fileIds: zod_1.z.array(zod_1.z.string().uuid()).optional(),
|
|
13
15
|
useWebSearch: zod_1.z.boolean().optional(),
|
|
14
16
|
/** Если не передан — расчёт для нового диалога (история пустая) */
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.GetDialogContextLengthCommand = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
-
const message_attachment_schema_1 = require("../../../models/agents/message-attachment.schema");
|
|
6
5
|
var GetDialogContextLengthCommand;
|
|
7
6
|
(function (GetDialogContextLengthCommand) {
|
|
8
7
|
GetDialogContextLengthCommand.RequestSchema = zod_1.z.object({
|
|
@@ -10,19 +9,18 @@ var GetDialogContextLengthCommand;
|
|
|
10
9
|
agentId: zod_1.z.string().uuid(),
|
|
11
10
|
/** Если не передан — история пустая (расчёт для нового диалога) */
|
|
12
11
|
dialogId: zod_1.z.string().uuid().optional(),
|
|
12
|
+
/** Длина текста нового сообщения пользователя (без контента файлов) */
|
|
13
13
|
inputLength: zod_1.z.number().int().min(0),
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
type: message_attachment_schema_1.MessageAttachmentTypeEnum,
|
|
17
|
-
contentLength: zod_1.z.number().int().optional(),
|
|
18
|
-
}))
|
|
19
|
-
.default([]),
|
|
14
|
+
/** Идентификаторы предзагруженных файлов; метаданные резолвит rugpt-agents */
|
|
15
|
+
fileIds: zod_1.z.array(zod_1.z.string().uuid()).default([]),
|
|
20
16
|
});
|
|
21
17
|
GetDialogContextLengthCommand.ResponseSchema = zod_1.z.object({
|
|
22
18
|
isSuccess: zod_1.z.literal(true),
|
|
23
19
|
data: zod_1.z.object({
|
|
24
20
|
historyChars: zod_1.z.number().int().min(0),
|
|
25
21
|
totalInputChars: zod_1.z.number().int().min(0),
|
|
22
|
+
/** Кол-во изображений среди fileIds — для пер-картиночной наценки */
|
|
23
|
+
imageCount: zod_1.z.number().int().min(0),
|
|
26
24
|
modelPricing: zod_1.z.object({
|
|
27
25
|
inputPrice: zod_1.z.number(),
|
|
28
26
|
outputPrice: zod_1.z.number(),
|
|
@@ -11,6 +11,7 @@ var SendCabinetMessageCommand;
|
|
|
11
11
|
SendCabinetMessageCommand.RequestBodySchema = zod_1.z
|
|
12
12
|
.object({
|
|
13
13
|
text: zod_1.z.string().optional(),
|
|
14
|
+
/** Идентификаторы предзагруженных файлов; метаданные резолвит rugpt-agents */
|
|
14
15
|
fileIds: zod_1.z.array(zod_1.z.string().uuid()).optional(),
|
|
15
16
|
useWebSearch: zod_1.z.boolean().optional(),
|
|
16
17
|
})
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./upload-agent-chat-file.command"), exports);
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UploadAgentChatFileCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const message_attachment_schema_1 = require("../../../models/agents/message-attachment.schema");
|
|
6
|
+
var UploadAgentChatFileCommand;
|
|
7
|
+
(function (UploadAgentChatFileCommand) {
|
|
8
|
+
UploadAgentChatFileCommand.RequestParamsSchema = zod_1.z.object({
|
|
9
|
+
agentId: zod_1.z.string().uuid(),
|
|
10
|
+
});
|
|
11
|
+
UploadAgentChatFileCommand.RequestBodySchema = zod_1.z.object({
|
|
12
|
+
dialogId: zod_1.z.string().uuid().optional(),
|
|
13
|
+
});
|
|
14
|
+
UploadAgentChatFileCommand.ResponseDataSchema = zod_1.z.object({
|
|
15
|
+
fileId: zod_1.z.string().uuid(),
|
|
16
|
+
url: zod_1.z.string(),
|
|
17
|
+
mimeType: zod_1.z.string(),
|
|
18
|
+
type: message_attachment_schema_1.MessageAttachmentTypeEnum,
|
|
19
|
+
originalName: zod_1.z.string().optional(),
|
|
20
|
+
contentLength: zod_1.z.number().int().nonnegative().optional(),
|
|
21
|
+
});
|
|
22
|
+
UploadAgentChatFileCommand.ResponseSchema = zod_1.z.object({
|
|
23
|
+
data: UploadAgentChatFileCommand.ResponseDataSchema,
|
|
24
|
+
});
|
|
25
|
+
})(UploadAgentChatFileCommand || (exports.UploadAgentChatFileCommand = UploadAgentChatFileCommand = {}));
|
|
@@ -21,5 +21,6 @@ __exportStar(require("./agent-lead-form"), exports);
|
|
|
21
21
|
__exportStar(require("./agent-lead"), exports);
|
|
22
22
|
__exportStar(require("./agent-tool"), exports);
|
|
23
23
|
__exportStar(require("./agent-document"), exports);
|
|
24
|
+
__exportStar(require("./agent-files"), exports);
|
|
24
25
|
__exportStar(require("./agent-template"), exports);
|
|
25
26
|
__exportStar(require("./agents"), exports);
|
|
@@ -118,7 +118,7 @@ var AnthropicMessagesCommand;
|
|
|
118
118
|
AnthropicMessagesCommand.BodySchema = zod_1.z
|
|
119
119
|
.object({
|
|
120
120
|
model: zod_1.z.string(),
|
|
121
|
-
max_tokens: zod_1.z.number().int().positive(),
|
|
121
|
+
max_tokens: zod_1.z.number().int().positive().optional(),
|
|
122
122
|
messages: zod_1.z.array(exports.AnthropicMessageSchema).min(1),
|
|
123
123
|
system: zod_1.z.union([zod_1.z.string(), zod_1.z.array(exports.AnthropicSystemContentBlockSchema)]).optional(),
|
|
124
124
|
stream: zod_1.z.boolean().optional(),
|
|
@@ -22,4 +22,5 @@ __exportStar(require("./agent-tool-status.enum"), exports);
|
|
|
22
22
|
__exportStar(require("./agent-document-status.enum"), exports);
|
|
23
23
|
__exportStar(require("./dialog-status.enum"), exports);
|
|
24
24
|
__exportStar(require("./message-sender-type.enum"), exports);
|
|
25
|
+
__exportStar(require("./message-file-type.enum"), exports);
|
|
25
26
|
__exportStar(require("./url-ingestion-strategy.enum"), exports);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MESSAGE_FILE_TYPE = void 0;
|
|
4
|
+
var MESSAGE_FILE_TYPE;
|
|
5
|
+
(function (MESSAGE_FILE_TYPE) {
|
|
6
|
+
MESSAGE_FILE_TYPE["IMAGE"] = "image";
|
|
7
|
+
MESSAGE_FILE_TYPE["DOCUMENT"] = "document";
|
|
8
|
+
MESSAGE_FILE_TYPE["TEXT"] = "text";
|
|
9
|
+
MESSAGE_FILE_TYPE["AUDIO"] = "audio";
|
|
10
|
+
MESSAGE_FILE_TYPE["VIDEO"] = "video";
|
|
11
|
+
MESSAGE_FILE_TYPE["OTHER"] = "other";
|
|
12
|
+
})(MESSAGE_FILE_TYPE || (exports.MESSAGE_FILE_TYPE = MESSAGE_FILE_TYPE = {}));
|
|
@@ -12,4 +12,5 @@ var INPUT_OUTPUT_TYPE;
|
|
|
12
12
|
INPUT_OUTPUT_TYPE["var"] = "var";
|
|
13
13
|
INPUT_OUTPUT_TYPE["firstFrame"] = "firstFrame";
|
|
14
14
|
INPUT_OUTPUT_TYPE["lastFrame"] = "lastFrame";
|
|
15
|
+
INPUT_OUTPUT_TYPE["referenceImage"] = "referenceImage";
|
|
15
16
|
})(INPUT_OUTPUT_TYPE || (exports.INPUT_OUTPUT_TYPE = INPUT_OUTPUT_TYPE = {}));
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AgentDialogMessageFileSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const message_file_type_enum_1 = require("../../constants/agents/enums/message-file-type.enum");
|
|
6
|
+
exports.AgentDialogMessageFileSchema = zod_1.z.object({
|
|
7
|
+
id: zod_1.z.string().uuid(),
|
|
8
|
+
url: zod_1.z.string(),
|
|
9
|
+
mimeType: zod_1.z.string(),
|
|
10
|
+
type: zod_1.z.nativeEnum(message_file_type_enum_1.MESSAGE_FILE_TYPE),
|
|
11
|
+
name: zod_1.z.string(),
|
|
12
|
+
originalName: zod_1.z.string().nullable(),
|
|
13
|
+
size: zod_1.z.number().int().nonnegative(),
|
|
14
|
+
});
|
|
@@ -3,11 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.AgentDialogMessageSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const message_sender_type_enum_1 = require("../../constants/agents/enums/message-sender-type.enum");
|
|
6
|
+
const agent_dialog_message_file_schema_1 = require("./agent-dialog-message-file.schema");
|
|
6
7
|
exports.AgentDialogMessageSchema = zod_1.z.object({
|
|
7
8
|
id: zod_1.z.string().uuid(),
|
|
8
9
|
text: zod_1.z.string().optional(),
|
|
9
10
|
images: zod_1.z.array(zod_1.z.string()),
|
|
10
|
-
|
|
11
|
+
files: zod_1.z.array(agent_dialog_message_file_schema_1.AgentDialogMessageFileSchema),
|
|
11
12
|
tokensUsed: zod_1.z.number().optional(),
|
|
12
13
|
senderType: zod_1.z.nativeEnum(message_sender_type_enum_1.MESSAGE_SENDER_TYPE),
|
|
13
14
|
createdAt: zod_1.z.date(),
|
|
@@ -22,6 +22,7 @@ __exportStar(require("./agent-lead-form.schema"), exports);
|
|
|
22
22
|
__exportStar(require("./agent-lead.schema"), exports);
|
|
23
23
|
__exportStar(require("./agent-lead-find-result.schema"), exports);
|
|
24
24
|
__exportStar(require("./agent-dialog-lead.schema"), exports);
|
|
25
|
+
__exportStar(require("./agent-dialog-message-file.schema"), exports);
|
|
25
26
|
__exportStar(require("./agent-dialog-message.schema"), exports);
|
|
26
27
|
__exportStar(require("./dialog-find-result.schema"), exports);
|
|
27
28
|
__exportStar(require("./dialog-with-messages.schema"), exports);
|
|
@@ -39,6 +39,7 @@ exports.VideoGenParamsSchema = strictObject({
|
|
|
39
39
|
duration: zod_1.z.string(),
|
|
40
40
|
aspectRatio: zod_1.z.string().optional(),
|
|
41
41
|
resolution: zod_1.z.string().optional(),
|
|
42
|
+
referenceImages: zod_1.z.string().uuid().array().optional(),
|
|
42
43
|
});
|
|
43
44
|
exports.AudioGenParamsSchema = zod_1.z.discriminatedUnion('mode', [
|
|
44
45
|
strictObject({
|
|
@@ -7,6 +7,8 @@ const tool_job_schema_1 = require("../../tool-job.schema");
|
|
|
7
7
|
exports.VideoJobParamsSchema = zod_1.z.object({
|
|
8
8
|
imageUrls: zod_1.z.string().array().optional(),
|
|
9
9
|
imageIds: zod_1.z.array(zod_1.z.string()).optional(),
|
|
10
|
+
referenceImages: zod_1.z.array(zod_1.z.string()).optional(),
|
|
11
|
+
referenceImageIds: zod_1.z.array(zod_1.z.string()).optional(),
|
|
10
12
|
firstFrameUrl: zod_1.z.string().optional(),
|
|
11
13
|
lastFrameUrl: zod_1.z.string().optional(),
|
|
12
14
|
firstFrameId: zod_1.z.string().optional(),
|
|
@@ -11,6 +11,12 @@ exports.VideoModelParamsSchema = zod_1.z.object({
|
|
|
11
11
|
supported: zod_1.z.boolean(),
|
|
12
12
|
maxImages: zod_1.z.number(),
|
|
13
13
|
}),
|
|
14
|
+
referenceImageAttachment: zod_1.z
|
|
15
|
+
.object({
|
|
16
|
+
supported: zod_1.z.boolean(),
|
|
17
|
+
maxImages: zod_1.z.number(),
|
|
18
|
+
})
|
|
19
|
+
.optional(),
|
|
14
20
|
duration: zod_1.z.object({
|
|
15
21
|
options: zod_1.z.array(zod_1.z.number()),
|
|
16
22
|
}),
|
|
@@ -44,6 +50,7 @@ exports.VideoModelParamsSchema = zod_1.z.object({
|
|
|
44
50
|
});
|
|
45
51
|
exports.VideoGenerationRequestParamsSchema = zod_1.z.object({
|
|
46
52
|
imageUrls: zod_1.z.string().array().optional(),
|
|
53
|
+
referenceImages: zod_1.z.string().uuid().array().optional(),
|
|
47
54
|
firstFrameImageId: zod_1.z.string().uuid().optional(),
|
|
48
55
|
lastFrameImageId: zod_1.z.string().uuid().optional(),
|
|
49
56
|
duration: zod_1.z.number(),
|
|
@@ -7,7 +7,9 @@ export namespace GetCabinetPricePreviewCommand {
|
|
|
7
7
|
export type RequestParams = z.infer<typeof RequestParamsSchema>;
|
|
8
8
|
|
|
9
9
|
export const RequestBodySchema = z.object({
|
|
10
|
+
/** Длина текста сообщения (без контента файлов — его резолвит rugpt-agents по fileIds) */
|
|
10
11
|
inputLength: z.number().int().min(0),
|
|
12
|
+
/** Идентификаторы предзагруженных файлов */
|
|
11
13
|
fileIds: z.array(z.string().uuid()).optional(),
|
|
12
14
|
useWebSearch: z.boolean().optional(),
|
|
13
15
|
/** Если не передан — расчёт для нового диалога (история пустая) */
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { MessageAttachmentTypeEnum } from '../../../models/agents/message-attachment.schema';
|
|
3
2
|
|
|
4
3
|
export namespace GetDialogContextLengthCommand {
|
|
5
4
|
export const RequestSchema = z.object({
|
|
@@ -7,15 +6,10 @@ export namespace GetDialogContextLengthCommand {
|
|
|
7
6
|
agentId: z.string().uuid(),
|
|
8
7
|
/** Если не передан — история пустая (расчёт для нового диалога) */
|
|
9
8
|
dialogId: z.string().uuid().optional(),
|
|
9
|
+
/** Длина текста нового сообщения пользователя (без контента файлов) */
|
|
10
10
|
inputLength: z.number().int().min(0),
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
z.object({
|
|
14
|
-
type: MessageAttachmentTypeEnum,
|
|
15
|
-
contentLength: z.number().int().optional(),
|
|
16
|
-
}),
|
|
17
|
-
)
|
|
18
|
-
.default([]),
|
|
11
|
+
/** Идентификаторы предзагруженных файлов; метаданные резолвит rugpt-agents */
|
|
12
|
+
fileIds: z.array(z.string().uuid()).default([]),
|
|
19
13
|
});
|
|
20
14
|
export type Request = z.infer<typeof RequestSchema>;
|
|
21
15
|
|
|
@@ -24,6 +18,8 @@ export namespace GetDialogContextLengthCommand {
|
|
|
24
18
|
data: z.object({
|
|
25
19
|
historyChars: z.number().int().min(0),
|
|
26
20
|
totalInputChars: z.number().int().min(0),
|
|
21
|
+
/** Кол-во изображений среди fileIds — для пер-картиночной наценки */
|
|
22
|
+
imageCount: z.number().int().min(0),
|
|
27
23
|
modelPricing: z.object({
|
|
28
24
|
inputPrice: z.number(),
|
|
29
25
|
outputPrice: z.number(),
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { MessageAttachmentInputSchema } from '../../../models/agents/message-attachment.schema';
|
|
3
2
|
|
|
4
3
|
export namespace SendCabinetMessageCommand {
|
|
5
4
|
export const RequestParamsSchema = z.object({
|
|
@@ -11,6 +10,7 @@ export namespace SendCabinetMessageCommand {
|
|
|
11
10
|
export const RequestBodySchema = z
|
|
12
11
|
.object({
|
|
13
12
|
text: z.string().optional(),
|
|
13
|
+
/** Идентификаторы предзагруженных файлов; метаданные резолвит rugpt-agents */
|
|
14
14
|
fileIds: z.array(z.string().uuid()).optional(),
|
|
15
15
|
useWebSearch: z.boolean().optional(),
|
|
16
16
|
})
|
|
@@ -20,14 +20,13 @@ export namespace SendCabinetMessageCommand {
|
|
|
20
20
|
});
|
|
21
21
|
export type RequestBody = z.infer<typeof RequestBodySchema>;
|
|
22
22
|
|
|
23
|
-
// RMQ payload sent to rugpt-agents (new format with resolved attachments)
|
|
24
23
|
export type RmqRequest = {
|
|
25
24
|
teamAccountId: string;
|
|
26
25
|
userId: string;
|
|
27
26
|
teamMemberRole?: string;
|
|
28
27
|
dialogId: string;
|
|
29
28
|
text?: string;
|
|
30
|
-
|
|
29
|
+
fileIds: string[];
|
|
31
30
|
useWebSearch?: boolean;
|
|
32
31
|
};
|
|
33
32
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './upload-agent-chat-file.command';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { MessageAttachmentTypeEnum } from '../../../models/agents/message-attachment.schema';
|
|
3
|
+
|
|
4
|
+
export namespace UploadAgentChatFileCommand {
|
|
5
|
+
export const RequestParamsSchema = z.object({
|
|
6
|
+
agentId: z.string().uuid(),
|
|
7
|
+
});
|
|
8
|
+
export type RequestParams = z.infer<typeof RequestParamsSchema>;
|
|
9
|
+
|
|
10
|
+
export const RequestBodySchema = z.object({
|
|
11
|
+
dialogId: z.string().uuid().optional(),
|
|
12
|
+
});
|
|
13
|
+
export type RequestBody = z.infer<typeof RequestBodySchema>;
|
|
14
|
+
|
|
15
|
+
export const ResponseDataSchema = z.object({
|
|
16
|
+
fileId: z.string().uuid(),
|
|
17
|
+
url: z.string(),
|
|
18
|
+
mimeType: z.string(),
|
|
19
|
+
type: MessageAttachmentTypeEnum,
|
|
20
|
+
originalName: z.string().optional(),
|
|
21
|
+
contentLength: z.number().int().nonnegative().optional(),
|
|
22
|
+
});
|
|
23
|
+
export type ResponseData = z.infer<typeof ResponseDataSchema>;
|
|
24
|
+
|
|
25
|
+
export const ResponseSchema = z.object({
|
|
26
|
+
data: ResponseDataSchema,
|
|
27
|
+
});
|
|
28
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
29
|
+
}
|
package/commands/agents/index.ts
CHANGED
|
@@ -134,7 +134,7 @@ export namespace AnthropicMessagesCommand {
|
|
|
134
134
|
export const BodySchema = z
|
|
135
135
|
.object({
|
|
136
136
|
model: z.string(),
|
|
137
|
-
max_tokens: z.number().int().positive(),
|
|
137
|
+
max_tokens: z.number().int().positive().optional(),
|
|
138
138
|
messages: z.array(AnthropicMessageSchema).min(1),
|
|
139
139
|
system: z.union([z.string(), z.array(AnthropicSystemContentBlockSchema)]).optional(),
|
|
140
140
|
stream: z.boolean().optional(),
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { MESSAGE_FILE_TYPE } from '../../constants/agents/enums/message-file-type.enum';
|
|
3
|
+
|
|
4
|
+
export const AgentDialogMessageFileSchema = z.object({
|
|
5
|
+
id: z.string().uuid(),
|
|
6
|
+
url: z.string(),
|
|
7
|
+
mimeType: z.string(),
|
|
8
|
+
type: z.nativeEnum(MESSAGE_FILE_TYPE),
|
|
9
|
+
name: z.string(),
|
|
10
|
+
originalName: z.string().nullable(),
|
|
11
|
+
size: z.number().int().nonnegative(),
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
export type AgentDialogMessageFile = z.infer<typeof AgentDialogMessageFileSchema>;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { MESSAGE_SENDER_TYPE } from '../../constants/agents/enums/message-sender-type.enum';
|
|
3
|
+
import { AgentDialogMessageFileSchema } from './agent-dialog-message-file.schema';
|
|
3
4
|
|
|
4
5
|
export const AgentDialogMessageSchema = z.object({
|
|
5
6
|
id: z.string().uuid(),
|
|
6
7
|
text: z.string().optional(),
|
|
7
8
|
images: z.array(z.string()),
|
|
8
|
-
|
|
9
|
+
files: z.array(AgentDialogMessageFileSchema),
|
|
9
10
|
tokensUsed: z.number().optional(),
|
|
10
11
|
senderType: z.nativeEnum(MESSAGE_SENDER_TYPE),
|
|
11
12
|
createdAt: z.date(),
|
package/models/agents/index.ts
CHANGED
|
@@ -6,6 +6,7 @@ export * from './agent-lead-form.schema';
|
|
|
6
6
|
export * from './agent-lead.schema';
|
|
7
7
|
export * from './agent-lead-find-result.schema';
|
|
8
8
|
export * from './agent-dialog-lead.schema';
|
|
9
|
+
export * from './agent-dialog-message-file.schema';
|
|
9
10
|
export * from './agent-dialog-message.schema';
|
|
10
11
|
export * from './dialog-find-result.schema';
|
|
11
12
|
export * from './dialog-with-messages.schema';
|
|
@@ -47,6 +47,7 @@ export const VideoGenParamsSchema = strictObject({
|
|
|
47
47
|
duration: z.string(),
|
|
48
48
|
aspectRatio: z.string().optional(),
|
|
49
49
|
resolution: z.string().optional(),
|
|
50
|
+
referenceImages: z.string().uuid().array().optional(),
|
|
50
51
|
});
|
|
51
52
|
export type VideoGenParams = z.infer<typeof VideoGenParamsSchema>;
|
|
52
53
|
|
|
@@ -5,6 +5,8 @@ import { ToolJobSchema } from '../../tool-job.schema';
|
|
|
5
5
|
export const VideoJobParamsSchema = z.object({
|
|
6
6
|
imageUrls: z.string().array().optional(),
|
|
7
7
|
imageIds: z.array(z.string()).optional(),
|
|
8
|
+
referenceImages: z.array(z.string()).optional(),
|
|
9
|
+
referenceImageIds: z.array(z.string()).optional(),
|
|
8
10
|
firstFrameUrl: z.string().optional(),
|
|
9
11
|
lastFrameUrl: z.string().optional(),
|
|
10
12
|
firstFrameId: z.string().optional(),
|
|
@@ -9,6 +9,12 @@ export const VideoModelParamsSchema = z.object({
|
|
|
9
9
|
supported: z.boolean(),
|
|
10
10
|
maxImages: z.number(),
|
|
11
11
|
}),
|
|
12
|
+
referenceImageAttachment: z
|
|
13
|
+
.object({
|
|
14
|
+
supported: z.boolean(),
|
|
15
|
+
maxImages: z.number(),
|
|
16
|
+
})
|
|
17
|
+
.optional(),
|
|
12
18
|
duration: z.object({
|
|
13
19
|
options: z.array(z.number()),
|
|
14
20
|
}),
|
|
@@ -43,6 +49,7 @@ export const VideoModelParamsSchema = z.object({
|
|
|
43
49
|
|
|
44
50
|
export const VideoGenerationRequestParamsSchema = z.object({
|
|
45
51
|
imageUrls: z.string().array().optional(),
|
|
52
|
+
referenceImages: z.string().uuid().array().optional(),
|
|
46
53
|
firstFrameImageId: z.string().uuid().optional(),
|
|
47
54
|
lastFrameImageId: z.string().uuid().optional(),
|
|
48
55
|
duration: z.number(),
|