@purpleschool/gptbot 0.13.34 → 0.13.36

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.
@@ -8,10 +8,15 @@ var SendAgentDialogAdminReplyCommand;
8
8
  dialogId: zod_1.z.string().uuid(),
9
9
  });
10
10
  SendAgentDialogAdminReplyCommand.RequestQuerySchema = zod_1.z.object({});
11
- SendAgentDialogAdminReplyCommand.RequestBodySchema = zod_1.z.object({
11
+ SendAgentDialogAdminReplyCommand.RequestBodySchema = zod_1.z
12
+ .object({
12
13
  text: zod_1.z.string().optional(),
13
14
  images: zod_1.z.array(zod_1.z.string()).default([]),
14
- attachments: zod_1.z.array(zod_1.z.string()).optional(),
15
+ fileIds: zod_1.z.array(zod_1.z.string().uuid()).default([]),
16
+ })
17
+ .refine((data) => data.text || data.images.length > 0 || data.fileIds.length > 0, {
18
+ message: 'Message must contain text, images, or files',
19
+ path: ['text'],
15
20
  });
16
21
  SendAgentDialogAdminReplyCommand.ResponseSchema = zod_1.z.object({
17
22
  data: zod_1.z.object({
@@ -3,6 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TTSCommand = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const models_1 = require("../../../models");
6
+ const TTSReferenceSchema = zod_1.z.object({
7
+ audioUrl: zod_1.z.string().url(),
8
+ text: zod_1.z.string(),
9
+ });
6
10
  var TTSCommand;
7
11
  (function (TTSCommand) {
8
12
  TTSCommand.RequestSchema = zod_1.z.object({
@@ -19,6 +23,7 @@ var TTSCommand;
19
23
  })
20
24
  .optional()
21
25
  .default({}),
26
+ references: zod_1.z.array(TTSReferenceSchema).optional().default([]),
22
27
  });
23
28
  TTSCommand.ResponseSchema = zod_1.z.object({
24
29
  data: models_1.ToolJobSchema,
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AI_MODEL_TAG = void 0;
4
+ var AI_MODEL_TAG;
5
+ (function (AI_MODEL_TAG) {
6
+ AI_MODEL_TAG["RECOMMENDED"] = "recommended";
7
+ })(AI_MODEL_TAG || (exports.AI_MODEL_TAG = AI_MODEL_TAG = {}));
@@ -18,3 +18,4 @@ __exportStar(require("./ai-model-config-selector-type.enum"), exports);
18
18
  __exportStar(require("./ai-model-feature.enum"), exports);
19
19
  __exportStar(require("./ai-model-status.enum"), exports);
20
20
  __exportStar(require("./ai-model-strategy.enum"), exports);
21
+ __exportStar(require("./ai-model-tag.enum"), exports);
@@ -13,6 +13,8 @@ exports.AiModelSchema = zod_1.z.object({
13
13
  tokenMultiplicator: zod_1.z.number(),
14
14
  freeTokenMultiplicator: zod_1.z.number(),
15
15
  order: zod_1.z.number(),
16
+ tags: zod_1.z.array(zod_1.z.nativeEnum(constants_1.AI_MODEL_TAG)),
17
+ hint: zod_1.z.string().nullable(),
16
18
  canUse: zod_1.z.optional(zod_1.z.boolean()),
17
19
  status: zod_1.z.nativeEnum(constants_1.AI_MODEL_STATUS),
18
20
  features: zod_1.z.array(zod_1.z.nativeEnum(constants_1.AI_MODEL_FEATURE)),
@@ -33,6 +35,8 @@ exports.AiModelSchema = zod_1.z.object({
33
35
  updatedAt: zod_1.z.date(),
34
36
  });
35
37
  exports.CreateAiModelSchema = exports.AiModelSchema.extend({
38
+ tags: zod_1.z.array(zod_1.z.nativeEnum(constants_1.AI_MODEL_TAG)).default([]),
39
+ hint: zod_1.z.string().nullable().default(null),
36
40
  model: zod_1.z.string(),
37
41
  maxInputTokens: zod_1.z.number(),
38
42
  });
@@ -9,11 +9,16 @@ export namespace SendAgentDialogAdminReplyCommand {
9
9
  export const RequestQuerySchema = z.object({});
10
10
  export type RequestQuery = z.infer<typeof RequestQuerySchema>;
11
11
 
12
- export const RequestBodySchema = z.object({
13
- text: z.string().optional(),
14
- images: z.array(z.string()).default([]),
15
- attachments: z.array(z.string()).optional(),
16
- });
12
+ export const RequestBodySchema = z
13
+ .object({
14
+ text: z.string().optional(),
15
+ images: z.array(z.string()).default([]),
16
+ fileIds: z.array(z.string().uuid()).default([]),
17
+ })
18
+ .refine((data) => data.text || data.images.length > 0 || data.fileIds.length > 0, {
19
+ message: 'Message must contain text, images, or files',
20
+ path: ['text'],
21
+ });
17
22
  export type RequestBody = z.infer<typeof RequestBodySchema>;
18
23
 
19
24
  export const ResponseSchema = z.object({
@@ -1,6 +1,11 @@
1
1
  import { z } from 'zod';
2
2
  import { ToolJobSchema } from '../../../models';
3
3
 
4
+ const TTSReferenceSchema = z.object({
5
+ audioUrl: z.string().url(),
6
+ text: z.string(),
7
+ });
8
+
4
9
  export namespace TTSCommand {
5
10
  export const RequestSchema = z.object({
6
11
  modelId: z.string().uuid(),
@@ -16,6 +21,7 @@ export namespace TTSCommand {
16
21
  })
17
22
  .optional()
18
23
  .default({}),
24
+ references: z.array(TTSReferenceSchema).optional().default([]),
19
25
  });
20
26
 
21
27
  export type Request = z.infer<typeof RequestSchema>;
@@ -0,0 +1,3 @@
1
+ export enum AI_MODEL_TAG {
2
+ RECOMMENDED = 'recommended',
3
+ }
@@ -2,3 +2,4 @@ export * from './ai-model-config-selector-type.enum';
2
2
  export * from './ai-model-feature.enum';
3
3
  export * from './ai-model-status.enum';
4
4
  export * from './ai-model-strategy.enum';
5
+ export * from './ai-model-tag.enum';
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { AI_MODEL_FEATURE, AI_MODEL_STATUS } from '../constants';
2
+ import { AI_MODEL_FEATURE, AI_MODEL_STATUS, AI_MODEL_TAG } from '../constants';
3
3
  import { AiModelConfigSchema } from './ai-model-config.schema';
4
4
 
5
5
  export const AiModelSchema = z.object({
@@ -11,6 +11,8 @@ export const AiModelSchema = z.object({
11
11
  tokenMultiplicator: z.number(),
12
12
  freeTokenMultiplicator: z.number(),
13
13
  order: z.number(),
14
+ tags: z.array(z.nativeEnum(AI_MODEL_TAG)),
15
+ hint: z.string().nullable(),
14
16
  canUse: z.optional(z.boolean()),
15
17
  status: z.nativeEnum(AI_MODEL_STATUS),
16
18
  features: z.array(z.nativeEnum(AI_MODEL_FEATURE)),
@@ -34,6 +36,8 @@ export const AiModelSchema = z.object({
34
36
  export type AiModel = z.infer<typeof AiModelSchema>;
35
37
 
36
38
  export const CreateAiModelSchema = AiModelSchema.extend({
39
+ tags: z.array(z.nativeEnum(AI_MODEL_TAG)).default([]),
40
+ hint: z.string().nullable().default(null),
37
41
  model: z.string(),
38
42
  maxInputTokens: z.number(),
39
43
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@purpleschool/gptbot",
3
- "version": "0.13.34",
3
+ "version": "0.13.36",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",