@purpleschool/gptbot 0.13.29 → 0.13.30
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/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/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);
|
|
@@ -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