@purpleschool/gptbot 0.12.77 → 0.12.78

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.
@@ -0,0 +1,6 @@
1
+ export const CANVAS_TEXT_GENERATION_PRIVATE = 'private/ai-canvas/tools/text-generation' as const;
2
+
3
+ export const CANVAS_TEXT_GENERATION_ROUTES = {
4
+ PRICE: 'price',
5
+ GENERATE: 'generate',
6
+ } as const;
@@ -8,6 +8,7 @@ export * from './canvas';
8
8
  export * from './canvas-node-definition';
9
9
  export * from './canvas-node';
10
10
  export * from './canvas-edge';
11
+ export * from './canvas-text-generation';
11
12
  export * from './category';
12
13
  export * from './chat-private';
13
14
  export * from './chat-public';
package/api/routes.ts CHANGED
@@ -1296,4 +1296,8 @@ export const REST_API = {
1296
1296
  PRICE: `${ROOT}/${CONTROLLERS.PALETTE_CONTROLLER_PRIVATE}/${CONTROLLERS.PALETTE_ROUTES.PRICE}`,
1297
1297
  GENERATE: `${ROOT}/${CONTROLLERS.PALETTE_CONTROLLER_PRIVATE}/${CONTROLLERS.PALETTE_ROUTES.GENERATE}`,
1298
1298
  },
1299
+ CANVAS_TEXT_GENERATION_PRIVATE: {
1300
+ PRICE: `${ROOT}/${CONTROLLERS.CANVAS_TEXT_GENERATION_PRIVATE}/${CONTROLLERS.CANVAS_TEXT_GENERATION_ROUTES.PRICE}`,
1301
+ GENERATE: `${ROOT}/${CONTROLLERS.CANVAS_TEXT_GENERATION_PRIVATE}/${CONTROLLERS.CANVAS_TEXT_GENERATION_ROUTES.GENERATE}`,
1302
+ },
1299
1303
  } as const;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CANVAS_TEXT_GENERATION_ROUTES = exports.CANVAS_TEXT_GENERATION_PRIVATE = void 0;
4
+ exports.CANVAS_TEXT_GENERATION_PRIVATE = 'private/ai-canvas/tools/text-generation';
5
+ exports.CANVAS_TEXT_GENERATION_ROUTES = {
6
+ PRICE: 'price',
7
+ GENERATE: 'generate',
8
+ };
@@ -24,6 +24,7 @@ __exportStar(require("./canvas"), exports);
24
24
  __exportStar(require("./canvas-node-definition"), exports);
25
25
  __exportStar(require("./canvas-node"), exports);
26
26
  __exportStar(require("./canvas-edge"), exports);
27
+ __exportStar(require("./canvas-text-generation"), exports);
27
28
  __exportStar(require("./category"), exports);
28
29
  __exportStar(require("./chat-private"), exports);
29
30
  __exportStar(require("./chat-public"), exports);
@@ -971,4 +971,8 @@ exports.REST_API = {
971
971
  PRICE: `${exports.ROOT}/${CONTROLLERS.PALETTE_CONTROLLER_PRIVATE}/${CONTROLLERS.PALETTE_ROUTES.PRICE}`,
972
972
  GENERATE: `${exports.ROOT}/${CONTROLLERS.PALETTE_CONTROLLER_PRIVATE}/${CONTROLLERS.PALETTE_ROUTES.GENERATE}`,
973
973
  },
974
+ CANVAS_TEXT_GENERATION_PRIVATE: {
975
+ PRICE: `${exports.ROOT}/${CONTROLLERS.CANVAS_TEXT_GENERATION_PRIVATE}/${CONTROLLERS.CANVAS_TEXT_GENERATION_ROUTES.PRICE}`,
976
+ GENERATE: `${exports.ROOT}/${CONTROLLERS.CANVAS_TEXT_GENERATION_PRIVATE}/${CONTROLLERS.CANVAS_TEXT_GENERATION_ROUTES.GENERATE}`,
977
+ },
974
978
  };
@@ -15,3 +15,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./palette"), exports);
18
+ __exportStar(require("./text-gen"), exports);
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GenerateTextCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const models_1 = require("../../../../models");
6
+ var GenerateTextCommand;
7
+ (function (GenerateTextCommand) {
8
+ GenerateTextCommand.RequestSchema = zod_1.z.object({
9
+ nodeUuid: zod_1.z.string().uuid(),
10
+ canvasId: zod_1.z.string().uuid(),
11
+ modelId: zod_1.z.string().uuid(),
12
+ prompt: zod_1.z.string().trim(),
13
+ fileIds: zod_1.z.array(zod_1.z.string().uuid()).optional(),
14
+ });
15
+ GenerateTextCommand.ResponseSchema = zod_1.z.object({
16
+ data: models_1.TextGenOutputSchema,
17
+ });
18
+ })(GenerateTextCommand || (exports.GenerateTextCommand = GenerateTextCommand = {}));
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetTextGenerationPriceCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ var GetTextGenerationPriceCommand;
6
+ (function (GetTextGenerationPriceCommand) {
7
+ GetTextGenerationPriceCommand.RequestSchema = zod_1.z.object({
8
+ modelId: zod_1.z.string().uuid(),
9
+ promptLength: zod_1.z.coerce.number().int().positive(),
10
+ });
11
+ GetTextGenerationPriceCommand.ResponseSchema = zod_1.z.object({
12
+ data: zod_1.z.object({
13
+ price: zod_1.z.number(),
14
+ charsUntilNextPriceIncrease: zod_1.z.number().int().nonnegative().nullable().optional(),
15
+ charsUntilNextPriceDecrease: zod_1.z.number().int().nonnegative().nullable().optional(),
16
+ }),
17
+ });
18
+ })(GetTextGenerationPriceCommand || (exports.GetTextGenerationPriceCommand = GetTextGenerationPriceCommand = {}));
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./generate-text.command"), exports);
18
+ __exportStar(require("./get-text-generation-price.command"), exports);
@@ -31,7 +31,7 @@ exports.VideoGenParamsSchema = strictObject({
31
31
  prompt: zod_1.z.string(),
32
32
  modelId: zod_1.z.string(),
33
33
  modelName: zod_1.z.string(),
34
- duration: zod_1.z.string().optional(),
34
+ duration: zod_1.z.string(),
35
35
  aspectRatio: zod_1.z.string().optional(),
36
36
  resolution: zod_1.z.string().optional(),
37
37
  firstFrameImageId: zod_1.z.string().uuid().optional(),
@@ -1 +1,2 @@
1
1
  export * from './palette';
2
+ export * from './text-gen';
@@ -0,0 +1,18 @@
1
+ import { z } from 'zod';
2
+ import { TextGenOutputSchema } from '../../../../models';
3
+
4
+ export namespace GenerateTextCommand {
5
+ export const RequestSchema = z.object({
6
+ nodeUuid: z.string().uuid(),
7
+ canvasId: z.string().uuid(),
8
+ modelId: z.string().uuid(),
9
+ prompt: z.string().trim(),
10
+ fileIds: z.array(z.string().uuid()).optional(),
11
+ });
12
+ export type Request = z.infer<typeof RequestSchema>;
13
+
14
+ export const ResponseSchema = z.object({
15
+ data: TextGenOutputSchema,
16
+ });
17
+ export type Response = z.infer<typeof ResponseSchema>;
18
+ }
@@ -0,0 +1,18 @@
1
+ import { z } from 'zod';
2
+
3
+ export namespace GetTextGenerationPriceCommand {
4
+ export const RequestSchema = z.object({
5
+ modelId: z.string().uuid(),
6
+ promptLength: z.coerce.number().int().positive(),
7
+ });
8
+ export type Request = z.infer<typeof RequestSchema>;
9
+
10
+ export const ResponseSchema = z.object({
11
+ data: z.object({
12
+ price: z.number(),
13
+ charsUntilNextPriceIncrease: z.number().int().nonnegative().nullable().optional(),
14
+ charsUntilNextPriceDecrease: z.number().int().nonnegative().nullable().optional(),
15
+ }),
16
+ });
17
+ export type Response = z.infer<typeof ResponseSchema>;
18
+ }
@@ -0,0 +1,2 @@
1
+ export * from './generate-text.command';
2
+ export * from './get-text-generation-price.command';
@@ -37,7 +37,7 @@ export const VideoGenParamsSchema = strictObject({
37
37
  prompt: z.string(),
38
38
  modelId: z.string(),
39
39
  modelName: z.string(),
40
- duration: z.string().optional(),
40
+ duration: z.string(),
41
41
  aspectRatio: z.string().optional(),
42
42
  resolution: z.string().optional(),
43
43
  firstFrameImageId: z.string().uuid().optional(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@purpleschool/gptbot",
3
- "version": "0.12.77",
3
+ "version": "0.12.78",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",