@purpleschool/gptbot 0.5.82 → 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,5 +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["IMAGE_STYLE"] = "image-style";
7
8
  AI_MODEL_CONFIG_PARAM["WEB_SEARCH"] = "web-search";
8
9
  })(AI_MODEL_CONFIG_PARAM || (exports.AI_MODEL_CONFIG_PARAM = AI_MODEL_CONFIG_PARAM = {}));
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AiModelConfigSchema = 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({
@@ -20,11 +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
+ // IMAGE STYLE
24
+ exports.AiModelImageStyleOptionSchema = exports.AiModelConfigParameterSchema.extend({
25
+ sample: zod_1.z.string(),
26
+ });
27
+ exports.AiModelImageStyleParameter = zod_1.z.object({
28
+ title: zod_1.z.string(),
29
+ options: zod_1.z.array(exports.AiModelImageStyleOptionSchema),
30
+ });
23
31
  // CONFIG
24
32
  exports.AiModelConfigSchema = zod_1.z.object({
25
33
  parameters: zod_1.z
26
34
  .object({
27
35
  [constants_1.AI_MODEL_CONFIG_PARAM.IMAGE_SIZE]: exports.AiModelImageSizeParameter.optional(),
36
+ [constants_1.AI_MODEL_CONFIG_PARAM.IMAGE_STYLE]: exports.AiModelImageStyleParameter.optional(),
28
37
  })
29
38
  .strict(),
30
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,4 +1,5 @@
1
1
  export enum AI_MODEL_CONFIG_PARAM {
2
2
  IMAGE_SIZE = 'image-size',
3
+ IMAGE_STYLE = 'image-style',
3
4
  WEB_SEARCH = 'web-search',
4
5
  }
@@ -22,12 +22,24 @@ export const AiModelImageSizeParameter = z.object({
22
22
  options: z.array(AiModelImageSizeOptionSchema),
23
23
  });
24
24
 
25
+ // IMAGE STYLE
26
+
27
+ export const AiModelImageStyleOptionSchema = AiModelConfigParameterSchema.extend({
28
+ sample: z.string(),
29
+ });
30
+
31
+ export const AiModelImageStyleParameter = z.object({
32
+ title: z.string(),
33
+ options: z.array(AiModelImageStyleOptionSchema),
34
+ });
35
+
25
36
  // CONFIG
26
37
 
27
38
  export const AiModelConfigSchema = z.object({
28
39
  parameters: z
29
40
  .object({
30
41
  [AI_MODEL_CONFIG_PARAM.IMAGE_SIZE]: AiModelImageSizeParameter.optional(),
42
+ [AI_MODEL_CONFIG_PARAM.IMAGE_STYLE]: AiModelImageStyleParameter.optional(),
31
43
  })
32
44
  .strict(),
33
45
  });
@@ -35,4 +47,6 @@ export const AiModelConfigSchema = z.object({
35
47
  export type AiModelConfigParameter = z.infer<typeof AiModelConfigParameterSchema>;
36
48
  export type AiModelImageSizeOption = z.infer<typeof AiModelImageSizeOptionSchema>;
37
49
  export type AiModelImageSizeParameter = z.infer<typeof AiModelImageSizeParameter>;
50
+ export type AiModelImageStyleOption = z.infer<typeof AiModelImageStyleOptionSchema>;
51
+ export type AiModelImageStyleParameter = z.infer<typeof AiModelImageStyleParameter>;
38
52
  export type AiModelConfig = z.infer<typeof AiModelConfigSchema>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@purpleschool/gptbot",
3
- "version": "0.5.82",
3
+ "version": "0.5.83",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",