@purpleschool/gptbot 0.5.82 → 0.5.84

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.AiModelWebSearchParameter = 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,25 @@ 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
+ });
31
+ // WEB SEARCH
32
+ exports.AiModelWebSearchParameter = zod_1.z.object({
33
+ webSearchPrice: zod_1.z.number(),
34
+ });
23
35
  // CONFIG
24
36
  exports.AiModelConfigSchema = zod_1.z.object({
25
37
  parameters: zod_1.z
26
38
  .object({
27
39
  [constants_1.AI_MODEL_CONFIG_PARAM.IMAGE_SIZE]: exports.AiModelImageSizeParameter.optional(),
40
+ [constants_1.AI_MODEL_CONFIG_PARAM.IMAGE_STYLE]: exports.AiModelImageStyleParameter.optional(),
41
+ [constants_1.AI_MODEL_CONFIG_PARAM.WEB_SEARCH]: exports.AiModelWebSearchParameter.optional(),
28
42
  })
29
43
  .strict(),
30
44
  });
@@ -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,31 @@ 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
+
36
+ // WEB SEARCH
37
+
38
+ export const AiModelWebSearchParameter = z.object({
39
+ webSearchPrice: z.number(),
40
+ });
41
+
25
42
  // CONFIG
26
43
 
27
44
  export const AiModelConfigSchema = z.object({
28
45
  parameters: z
29
46
  .object({
30
47
  [AI_MODEL_CONFIG_PARAM.IMAGE_SIZE]: AiModelImageSizeParameter.optional(),
48
+ [AI_MODEL_CONFIG_PARAM.IMAGE_STYLE]: AiModelImageStyleParameter.optional(),
49
+ [AI_MODEL_CONFIG_PARAM.WEB_SEARCH]: AiModelWebSearchParameter.optional(),
31
50
  })
32
51
  .strict(),
33
52
  });
@@ -35,4 +54,7 @@ export const AiModelConfigSchema = z.object({
35
54
  export type AiModelConfigParameter = z.infer<typeof AiModelConfigParameterSchema>;
36
55
  export type AiModelImageSizeOption = z.infer<typeof AiModelImageSizeOptionSchema>;
37
56
  export type AiModelImageSizeParameter = z.infer<typeof AiModelImageSizeParameter>;
57
+ export type AiModelImageStyleOption = z.infer<typeof AiModelImageStyleOptionSchema>;
58
+ export type AiModelImageStyleParameter = z.infer<typeof AiModelImageStyleParameter>;
59
+ export type AiModelWebSeachParameter = z.infer<typeof AiModelWebSearchParameter>;
38
60
  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.84",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",