@purpleschool/gptbot 0.13.30 → 0.13.31

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.
@@ -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 = {}));
@@ -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
- attachments: zod_1.z.array(zod_1.z.string()),
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);
@@ -6,4 +6,5 @@ export * from './agent-tool-status.enum';
6
6
  export * from './agent-document-status.enum';
7
7
  export * from './dialog-status.enum';
8
8
  export * from './message-sender-type.enum';
9
+ export * from './message-file-type.enum';
9
10
  export * from './url-ingestion-strategy.enum';
@@ -0,0 +1,8 @@
1
+ export enum MESSAGE_FILE_TYPE {
2
+ IMAGE = 'image',
3
+ DOCUMENT = 'document',
4
+ TEXT = 'text',
5
+ AUDIO = 'audio',
6
+ VIDEO = 'video',
7
+ OTHER = 'other',
8
+ }
@@ -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
- attachments: z.array(z.string()),
9
+ files: z.array(AgentDialogMessageFileSchema),
9
10
  tokensUsed: z.number().optional(),
10
11
  senderType: z.nativeEnum(MESSAGE_SENDER_TYPE),
11
12
  createdAt: z.date(),
@@ -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';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@purpleschool/gptbot",
3
- "version": "0.13.30",
3
+ "version": "0.13.31",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",