@purpleschool/gptbot 0.5.77 → 0.5.79

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.
@@ -10,8 +10,6 @@ export const CHAT_PRIVATE_ROUTES = {
10
10
  FIND_BY_UUID: (uuid: string) => `${uuid}`,
11
11
  SEND_TEXT_MESSAGE: (uuid: string) => `${uuid}/messages/text`,
12
12
  SEND_IMAGE_MESSAGE: (uuid: string) => `${uuid}/messages/image`,
13
- SEND_TEXT_TO_SPEECH_MESSAGE: (uuid: string) => `${uuid}/messages/text-to-speech`,
14
- SEND_SPEECH_TO_TEXT_MESSAGE: (uuid: string) => `${uuid}/messages/speech-to-text`,
15
13
  ARCHIVE: 'archive',
16
14
  DELETE: (uuid: string) => `${uuid}`,
17
15
  UPDATE: (uuid: string) => `${uuid}`,
@@ -9,7 +9,5 @@ export const CHAT_PUBLIC_ROUTES = {
9
9
  FIND_BY_UUID: (uuid: string) => `${uuid}`,
10
10
  SEND_TEXT_MESSAGE: (uuid: string) => `${uuid}/messages/text`,
11
11
  SEND_IMAGE_MESSAGE: (uuid: string) => `${uuid}/messages/image`,
12
- SEND_TEXT_TO_SPEECH_MESSAGE: (uuid: string) => `${uuid}/messages/text-to-speech`,
13
- SEND_SPEECH_TO_TEXT_MESSAGE: (uuid: string) => `${uuid}/messages/speech-to-text`,
14
12
  INPUT_LIMITS: 'input-limits',
15
13
  } as const;
@@ -12,8 +12,6 @@ exports.CHAT_PRIVATE_ROUTES = {
12
12
  FIND_BY_UUID: (uuid) => `${uuid}`,
13
13
  SEND_TEXT_MESSAGE: (uuid) => `${uuid}/messages/text`,
14
14
  SEND_IMAGE_MESSAGE: (uuid) => `${uuid}/messages/image`,
15
- SEND_TEXT_TO_SPEECH_MESSAGE: (uuid) => `${uuid}/messages/text-to-speech`,
16
- SEND_SPEECH_TO_TEXT_MESSAGE: (uuid) => `${uuid}/messages/speech-to-text`,
17
15
  ARCHIVE: 'archive',
18
16
  DELETE: (uuid) => `${uuid}`,
19
17
  UPDATE: (uuid) => `${uuid}`,
@@ -11,7 +11,5 @@ exports.CHAT_PUBLIC_ROUTES = {
11
11
  FIND_BY_UUID: (uuid) => `${uuid}`,
12
12
  SEND_TEXT_MESSAGE: (uuid) => `${uuid}/messages/text`,
13
13
  SEND_IMAGE_MESSAGE: (uuid) => `${uuid}/messages/image`,
14
- SEND_TEXT_TO_SPEECH_MESSAGE: (uuid) => `${uuid}/messages/text-to-speech`,
15
- SEND_SPEECH_TO_TEXT_MESSAGE: (uuid) => `${uuid}/messages/speech-to-text`,
16
14
  INPUT_LIMITS: 'input-limits',
17
15
  };
@@ -2,7 +2,11 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ArchiveAllCommand = void 0;
4
4
  const zod_1 = require("zod");
5
+ const constants_1 = require("../../constants");
5
6
  var ArchiveAllCommand;
6
7
  (function (ArchiveAllCommand) {
8
+ ArchiveAllCommand.RequestSchema = zod_1.z.object({
9
+ type: zod_1.z.nativeEnum(constants_1.AI_MODEL_CONTENT_TYPE),
10
+ });
7
11
  ArchiveAllCommand.ResponseSchema = zod_1.z.void();
8
12
  })(ArchiveAllCommand || (exports.ArchiveAllCommand = ArchiveAllCommand = {}));
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CreateTextMessageCommand = void 0;
4
+ const constants_1 = require("../../constants");
4
5
  const models_1 = require("../../models");
5
6
  const zod_1 = require("zod");
6
7
  var CreateTextMessageCommand;
@@ -8,6 +9,7 @@ var CreateTextMessageCommand;
8
9
  CreateTextMessageCommand.RequestSchema = zod_1.z.object({
9
10
  text: zod_1.z.string(),
10
11
  files: zod_1.z.array(zod_1.z.string().uuid()).optional().default([]),
12
+ features: zod_1.z.array(zod_1.z.nativeEnum(constants_1.AI_MODEL_FEATURE)).optional().default([]),
11
13
  });
12
14
  CreateTextMessageCommand.RequestParamSchema = models_1.ChatSchema.pick({
13
15
  uuid: true,
@@ -15,8 +15,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./create-image-message.command"), exports);
18
- __exportStar(require("./create-speech-to-text-message.command"), exports);
19
18
  __exportStar(require("./create-text-message.command"), exports);
20
- __exportStar(require("./create-text-to-speech-message.command"), exports);
21
19
  __exportStar(require("./find-message-by-uuid.command"), exports);
22
20
  __exportStar(require("./rate-message.command"), exports);
@@ -5,4 +5,5 @@ var AI_MODEL_CONFIG_PARAM;
5
5
  (function (AI_MODEL_CONFIG_PARAM) {
6
6
  AI_MODEL_CONFIG_PARAM["IMAGE_SIZE"] = "image-size";
7
7
  AI_MODEL_CONFIG_PARAM["VOICE_TYPE"] = "voice-type";
8
+ AI_MODEL_CONFIG_PARAM["WEB_SEARCH"] = "web-search";
8
9
  })(AI_MODEL_CONFIG_PARAM || (exports.AI_MODEL_CONFIG_PARAM = AI_MODEL_CONFIG_PARAM = {}));
@@ -4,6 +4,4 @@ exports.AI_MODEL_CONTENT_TYPE = void 0;
4
4
  exports.AI_MODEL_CONTENT_TYPE = {
5
5
  TEXT: 'TEXT',
6
6
  IMAGE: 'IMAGE',
7
- TEXT_TO_SPEECH: 'TEXT_TO_SPEECH',
8
- SPEECH_TO_TEXT: 'SPEECH_TO_TEXT',
9
7
  };
@@ -5,4 +5,5 @@ var AI_MODEL_FEATURE;
5
5
  (function (AI_MODEL_FEATURE) {
6
6
  AI_MODEL_FEATURE["IMAGE_ATTACHMENT"] = "image_attachment";
7
7
  AI_MODEL_FEATURE["AUDIO_ATTACHMENT"] = "audio_attachment";
8
+ AI_MODEL_FEATURE["WEB_SEARCH"] = "web_search";
8
9
  })(AI_MODEL_FEATURE || (exports.AI_MODEL_FEATURE = AI_MODEL_FEATURE = {}));
@@ -1124,4 +1124,9 @@ exports.ERRORS = {
1124
1124
  message: 'Не удалось найти указанный тип голоса',
1125
1125
  httpCode: 400,
1126
1126
  },
1127
+ AI_MODEL_DOES_NOT_SUPPORT_WEB_SEARCH: {
1128
+ code: 'A250',
1129
+ message: 'ИИ модель не поддерживает поиск в интернете',
1130
+ httpCode: 400,
1131
+ },
1127
1132
  };
@@ -1,6 +1,11 @@
1
1
  import { z } from 'zod';
2
+ import { AI_MODEL_CONTENT_TYPE } from '../../constants';
2
3
 
3
4
  export namespace ArchiveAllCommand {
5
+ export const RequestSchema = z.object({
6
+ type: z.nativeEnum(AI_MODEL_CONTENT_TYPE),
7
+ });
8
+
4
9
  export const ResponseSchema = z.void();
5
10
  export type Response = z.infer<typeof ResponseSchema>;
6
11
  }
@@ -1,3 +1,4 @@
1
+ import { AI_MODEL_FEATURE } from '../../constants';
1
2
  import { ChatSchema, MessageSchema } from '../../models';
2
3
  import { z } from 'zod';
3
4
 
@@ -5,6 +6,7 @@ export namespace CreateTextMessageCommand {
5
6
  export const RequestSchema = z.object({
6
7
  text: z.string(),
7
8
  files: z.array(z.string().uuid()).optional().default([]),
9
+ features: z.array(z.nativeEnum(AI_MODEL_FEATURE)).optional().default([]),
8
10
  });
9
11
 
10
12
  export const RequestParamSchema = ChatSchema.pick({
@@ -1,6 +1,4 @@
1
1
  export * from './create-image-message.command';
2
- export * from './create-speech-to-text-message.command';
3
2
  export * from './create-text-message.command';
4
- export * from './create-text-to-speech-message.command';
5
3
  export * from './find-message-by-uuid.command';
6
4
  export * from './rate-message.command';
@@ -1,4 +1,5 @@
1
1
  export enum AI_MODEL_CONFIG_PARAM {
2
2
  IMAGE_SIZE = 'image-size',
3
3
  VOICE_TYPE = 'voice-type',
4
+ WEB_SEARCH = 'web-search',
4
5
  }
@@ -1,8 +1,6 @@
1
1
  export const AI_MODEL_CONTENT_TYPE = {
2
2
  TEXT: 'TEXT',
3
3
  IMAGE: 'IMAGE',
4
- TEXT_TO_SPEECH: 'TEXT_TO_SPEECH',
5
- SPEECH_TO_TEXT: 'SPEECH_TO_TEXT',
6
4
  } as const;
7
5
 
8
6
  export type TAIModelContentTypeEnum =
@@ -1,4 +1,5 @@
1
1
  export enum AI_MODEL_FEATURE {
2
2
  IMAGE_ATTACHMENT = 'image_attachment',
3
3
  AUDIO_ATTACHMENT = 'audio_attachment',
4
+ WEB_SEARCH = 'web_search',
4
5
  }
@@ -1130,4 +1130,9 @@ export const ERRORS = {
1130
1130
  message: 'Не удалось найти указанный тип голоса',
1131
1131
  httpCode: 400,
1132
1132
  },
1133
+ AI_MODEL_DOES_NOT_SUPPORT_WEB_SEARCH: {
1134
+ code: 'A250',
1135
+ message: 'ИИ модель не поддерживает поиск в интернете',
1136
+ httpCode: 400,
1137
+ },
1133
1138
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@purpleschool/gptbot",
3
- "version": "0.5.77",
3
+ "version": "0.5.79",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -1,17 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CreateSpeechToTextMessageCommand = void 0;
4
- const models_1 = require("../../models");
5
- const zod_1 = require("zod");
6
- var CreateSpeechToTextMessageCommand;
7
- (function (CreateSpeechToTextMessageCommand) {
8
- CreateSpeechToTextMessageCommand.RequestSchema = zod_1.z.object({
9
- fileId: zod_1.z.string().uuid(),
10
- });
11
- CreateSpeechToTextMessageCommand.RequestParamSchema = models_1.ChatSchema.pick({
12
- uuid: true,
13
- });
14
- CreateSpeechToTextMessageCommand.ResponseSchema = zod_1.z.object({
15
- data: models_1.MessageSchema,
16
- });
17
- })(CreateSpeechToTextMessageCommand || (exports.CreateSpeechToTextMessageCommand = CreateSpeechToTextMessageCommand = {}));
@@ -1,22 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CreateTextToSpeechMessageCommand = void 0;
4
- const constants_1 = require("../../constants");
5
- const models_1 = require("../../models");
6
- const zod_1 = require("zod");
7
- var CreateTextToSpeechMessageCommand;
8
- (function (CreateTextToSpeechMessageCommand) {
9
- CreateTextToSpeechMessageCommand.RequestSchema = zod_1.z.object({
10
- text: zod_1.z.string(),
11
- params: zod_1.z.array(zod_1.z.object({
12
- type: zod_1.z.nativeEnum(constants_1.AI_MODEL_CONFIG_PARAM),
13
- option: zod_1.z.string().uuid(),
14
- })),
15
- });
16
- CreateTextToSpeechMessageCommand.RequestParamSchema = models_1.ChatSchema.pick({
17
- uuid: true,
18
- });
19
- CreateTextToSpeechMessageCommand.ResponseSchema = zod_1.z.object({
20
- data: models_1.MessageSchema,
21
- });
22
- })(CreateTextToSpeechMessageCommand || (exports.CreateTextToSpeechMessageCommand = CreateTextToSpeechMessageCommand = {}));
@@ -1,19 +0,0 @@
1
- import { ChatSchema, MessageSchema } from '../../models';
2
- import { z } from 'zod';
3
-
4
- export namespace CreateSpeechToTextMessageCommand {
5
- export const RequestSchema = z.object({
6
- fileId: z.string().uuid(),
7
- });
8
- export type Request = z.infer<typeof RequestSchema>;
9
-
10
- export const RequestParamSchema = ChatSchema.pick({
11
- uuid: true,
12
- });
13
- export type RequestParam = z.infer<typeof RequestParamSchema>;
14
-
15
- export const ResponseSchema = z.object({
16
- data: MessageSchema,
17
- });
18
- export type Response = z.infer<typeof ResponseSchema>;
19
- }
@@ -1,26 +0,0 @@
1
- import { AI_MODEL_CONFIG_PARAM } from '../../constants';
2
- import { ChatSchema, MessageSchema } from '../../models';
3
- import { z } from 'zod';
4
-
5
- export namespace CreateTextToSpeechMessageCommand {
6
- export const RequestSchema = z.object({
7
- text: z.string(),
8
- params: z.array(
9
- z.object({
10
- type: z.nativeEnum(AI_MODEL_CONFIG_PARAM),
11
- option: z.string().uuid(),
12
- }),
13
- ),
14
- });
15
- export type Request = z.infer<typeof RequestSchema>;
16
-
17
- export const RequestParamSchema = ChatSchema.pick({
18
- uuid: true,
19
- });
20
- export type RequestParam = z.infer<typeof RequestParamSchema>;
21
-
22
- export const ResponseSchema = z.object({
23
- data: MessageSchema,
24
- });
25
- export type Response = z.infer<typeof ResponseSchema>;
26
- }