@purpleschool/gptbot 0.5.81 → 0.5.83

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.
@@ -6,12 +6,14 @@ const zod_1 = require("zod");
6
6
  const constants_1 = require("../../constants");
7
7
  var CreateImageMessageCommand;
8
8
  (function (CreateImageMessageCommand) {
9
- CreateImageMessageCommand.RequestSchema = zod_1.z.intersection(models_1.MessageSchema.pick({ text: true }), zod_1.z.object({
9
+ CreateImageMessageCommand.RequestSchema = zod_1.z.object({
10
+ text: zod_1.z.string(),
10
11
  params: zod_1.z.array(zod_1.z.object({
11
12
  type: zod_1.z.nativeEnum(constants_1.AI_MODEL_CONFIG_PARAM),
12
13
  option: zod_1.z.string().uuid(),
13
14
  })),
14
- }));
15
+ refinePrompt: zod_1.z.boolean().default(false),
16
+ });
15
17
  CreateImageMessageCommand.RequestParamSchema = models_1.ChatSchema.pick({
16
18
  uuid: true,
17
19
  });
@@ -4,6 +4,6 @@ exports.AI_MODEL_CONFIG_PARAM = void 0;
4
4
  var AI_MODEL_CONFIG_PARAM;
5
5
  (function (AI_MODEL_CONFIG_PARAM) {
6
6
  AI_MODEL_CONFIG_PARAM["IMAGE_SIZE"] = "image-size";
7
- AI_MODEL_CONFIG_PARAM["VOICE_TYPE"] = "voice-type";
7
+ AI_MODEL_CONFIG_PARAM["IMAGE_STYLE"] = "image-style";
8
8
  AI_MODEL_CONFIG_PARAM["WEB_SEARCH"] = "web-search";
9
9
  })(AI_MODEL_CONFIG_PARAM || (exports.AI_MODEL_CONFIG_PARAM = AI_MODEL_CONFIG_PARAM = {}));
@@ -1,16 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AiModelConfigSchema = exports.AiModelVoiceTypeParameter = exports.AiModelVoiceTypeOptionSchema = exports.AiModelImageSizeParameter = exports.AiModelImageSizeOptionSchema = exports.AiModelConfigParameterSchema = void 0;
3
+ exports.AiModelConfigSchema = exports.AiModelImageStyleParameter = exports.AiModelImageStyleOptionSchema = exports.AiModelImageSizeParameter = exports.AiModelImageSizeOptionSchema = exports.AiModelConfigParameterSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const constants_1 = require("../constants");
6
6
  exports.AiModelConfigParameterSchema = zod_1.z.object({
7
7
  id: zod_1.z.string(),
8
8
  title: zod_1.z.string(),
9
9
  order: zod_1.z.number(),
10
- icon: zod_1.z.string().optional(),
11
10
  });
12
11
  // IMAGE SIZE
13
12
  exports.AiModelImageSizeOptionSchema = exports.AiModelConfigParameterSchema.extend({
13
+ icon: zod_1.z.string(),
14
14
  dimensions: zod_1.z.object({
15
15
  w: zod_1.z.number(),
16
16
  h: zod_1.z.number(),
@@ -20,29 +20,20 @@ exports.AiModelImageSizeParameter = zod_1.z.object({
20
20
  title: zod_1.z.string(),
21
21
  options: zod_1.z.array(exports.AiModelImageSizeOptionSchema),
22
22
  });
23
- // VOICE TYPE
24
- exports.AiModelVoiceTypeOptionSchema = exports.AiModelConfigParameterSchema.extend({
25
- title: zod_1.z.string(),
26
- previewUrl: zod_1.z.string(),
27
- languages: zod_1.z.array(zod_1.z.object({
28
- title: zod_1.z.string(),
29
- icon: zod_1.z.string(),
30
- })),
31
- description: zod_1.z.string(),
32
- tags: zod_1.z.array(zod_1.z.string()),
33
- order: zod_1.z.number(),
34
- voice_id: zod_1.z.string(),
23
+ // IMAGE STYLE
24
+ exports.AiModelImageStyleOptionSchema = exports.AiModelConfigParameterSchema.extend({
25
+ sample: zod_1.z.string(),
35
26
  });
36
- exports.AiModelVoiceTypeParameter = zod_1.z.object({
27
+ exports.AiModelImageStyleParameter = zod_1.z.object({
37
28
  title: zod_1.z.string(),
38
- options: zod_1.z.array(exports.AiModelVoiceTypeOptionSchema),
29
+ options: zod_1.z.array(exports.AiModelImageStyleOptionSchema),
39
30
  });
40
31
  // CONFIG
41
32
  exports.AiModelConfigSchema = zod_1.z.object({
42
33
  parameters: zod_1.z
43
34
  .object({
44
35
  [constants_1.AI_MODEL_CONFIG_PARAM.IMAGE_SIZE]: exports.AiModelImageSizeParameter.optional(),
45
- [constants_1.AI_MODEL_CONFIG_PARAM.VOICE_TYPE]: exports.AiModelVoiceTypeParameter.optional(),
36
+ [constants_1.AI_MODEL_CONFIG_PARAM.IMAGE_STYLE]: exports.AiModelImageStyleParameter.optional(),
46
37
  })
47
38
  .strict(),
48
39
  });
@@ -3,17 +3,16 @@ import { z } from 'zod';
3
3
  import { AI_MODEL_CONFIG_PARAM } from '../../constants';
4
4
 
5
5
  export namespace CreateImageMessageCommand {
6
- export const RequestSchema = z.intersection(
7
- MessageSchema.pick({ text: true }),
8
- z.object({
9
- params: z.array(
10
- z.object({
11
- type: z.nativeEnum(AI_MODEL_CONFIG_PARAM),
12
- option: z.string().uuid(),
13
- }),
14
- ),
15
- }),
16
- );
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
+ refinePrompt: z.boolean().default(false),
15
+ });
17
16
 
18
17
  export const RequestParamSchema = ChatSchema.pick({
19
18
  uuid: true,
@@ -1,5 +1,5 @@
1
1
  export enum AI_MODEL_CONFIG_PARAM {
2
2
  IMAGE_SIZE = 'image-size',
3
- VOICE_TYPE = 'voice-type',
3
+ IMAGE_STYLE = 'image-style',
4
4
  WEB_SEARCH = 'web-search',
5
5
  }
@@ -5,12 +5,12 @@ export const AiModelConfigParameterSchema = z.object({
5
5
  id: z.string(),
6
6
  title: z.string(),
7
7
  order: z.number(),
8
- icon: z.string().optional(),
9
8
  });
10
9
 
11
10
  // IMAGE SIZE
12
11
 
13
12
  export const AiModelImageSizeOptionSchema = AiModelConfigParameterSchema.extend({
13
+ icon: z.string(),
14
14
  dimensions: z.object({
15
15
  w: z.number(),
16
16
  h: z.number(),
@@ -22,26 +22,15 @@ export const AiModelImageSizeParameter = z.object({
22
22
  options: z.array(AiModelImageSizeOptionSchema),
23
23
  });
24
24
 
25
- // VOICE TYPE
25
+ // IMAGE STYLE
26
26
 
27
- export const AiModelVoiceTypeOptionSchema = AiModelConfigParameterSchema.extend({
28
- title: z.string(),
29
- previewUrl: z.string(),
30
- languages: z.array(
31
- z.object({
32
- title: z.string(),
33
- icon: z.string(),
34
- }),
35
- ),
36
- description: z.string(),
37
- tags: z.array(z.string()),
38
- order: z.number(),
39
- voice_id: z.string(),
27
+ export const AiModelImageStyleOptionSchema = AiModelConfigParameterSchema.extend({
28
+ sample: z.string(),
40
29
  });
41
30
 
42
- export const AiModelVoiceTypeParameter = z.object({
31
+ export const AiModelImageStyleParameter = z.object({
43
32
  title: z.string(),
44
- options: z.array(AiModelVoiceTypeOptionSchema),
33
+ options: z.array(AiModelImageStyleOptionSchema),
45
34
  });
46
35
 
47
36
  // CONFIG
@@ -50,7 +39,7 @@ export const AiModelConfigSchema = z.object({
50
39
  parameters: z
51
40
  .object({
52
41
  [AI_MODEL_CONFIG_PARAM.IMAGE_SIZE]: AiModelImageSizeParameter.optional(),
53
- [AI_MODEL_CONFIG_PARAM.VOICE_TYPE]: AiModelVoiceTypeParameter.optional(),
42
+ [AI_MODEL_CONFIG_PARAM.IMAGE_STYLE]: AiModelImageStyleParameter.optional(),
54
43
  })
55
44
  .strict(),
56
45
  });
@@ -58,6 +47,6 @@ export const AiModelConfigSchema = z.object({
58
47
  export type AiModelConfigParameter = z.infer<typeof AiModelConfigParameterSchema>;
59
48
  export type AiModelImageSizeOption = z.infer<typeof AiModelImageSizeOptionSchema>;
60
49
  export type AiModelImageSizeParameter = z.infer<typeof AiModelImageSizeParameter>;
50
+ export type AiModelImageStyleOption = z.infer<typeof AiModelImageStyleOptionSchema>;
51
+ export type AiModelImageStyleParameter = z.infer<typeof AiModelImageStyleParameter>;
61
52
  export type AiModelConfig = z.infer<typeof AiModelConfigSchema>;
62
- export type AiModelVoiceTypeOption = z.infer<typeof AiModelVoiceTypeOptionSchema>;
63
- export type AiModelVoiceTypeParameter = z.infer<typeof AiModelVoiceTypeParameter>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@purpleschool/gptbot",
3
- "version": "0.5.81",
3
+ "version": "0.5.83",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",