@purpleschool/gptbot 0.9.5 → 0.9.6
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.
- package/build/commands/chat/create-chat.command.js +0 -1
- package/build/commands/chat/get-last-active-chat-command.js +0 -1
- package/build/commands/message/create-text-message.command.js +1 -0
- package/build/constants/ai-model/enums/ai-model-content-type.enum.js +4 -4
- package/build/constants/model/enums/unified-model-content-type.enum.js +0 -1
- package/build/constants/subscription/enums/subscription-feature-type.enum.js +2 -1
- package/build/models/ai-model.schema.js +1 -1
- package/build/models/chat.schema.js +1 -1
- package/build/models/prompt.schema.js +0 -2
- package/build/models/subscription-feature.schema.js +11 -2
- package/commands/chat/create-chat.command.ts +0 -1
- package/commands/chat/get-last-active-chat-command.ts +0 -1
- package/commands/message/create-text-message.command.ts +1 -0
- package/constants/ai-model/enums/ai-model-content-type.enum.ts +3 -7
- package/constants/model/enums/unified-model-content-type.enum.ts +0 -1
- package/constants/subscription/enums/subscription-feature-type.enum.ts +2 -1
- package/models/ai-model.schema.ts +2 -7
- package/models/chat.schema.ts +1 -1
- package/models/prompt.schema.ts +0 -2
- package/models/subscription-feature.schema.ts +12 -1
- package/package.json +1 -1
|
@@ -7,7 +7,6 @@ var GetLastActiveChatCommand;
|
|
|
7
7
|
(function (GetLastActiveChatCommand) {
|
|
8
8
|
GetLastActiveChatCommand.RequestQuerySchema = models_1.ChatSchema.pick({
|
|
9
9
|
categoryId: true,
|
|
10
|
-
aIModelId: true,
|
|
11
10
|
});
|
|
12
11
|
GetLastActiveChatCommand.Response = zod_1.z.object({
|
|
13
12
|
data: models_1.ChatWithMessagesSchema,
|
|
@@ -10,6 +10,7 @@ var CreateTextMessageCommand;
|
|
|
10
10
|
text: zod_1.z.string(),
|
|
11
11
|
files: zod_1.z.array(zod_1.z.string().uuid()).optional().default([]),
|
|
12
12
|
features: zod_1.z.array(zod_1.z.nativeEnum(constants_1.AI_MODEL_FEATURE)).optional().default([]),
|
|
13
|
+
aiModelId: zod_1.z.string().uuid(),
|
|
13
14
|
});
|
|
14
15
|
CreateTextMessageCommand.RequestParamSchema = models_1.ChatSchema.pick({
|
|
15
16
|
uuid: true,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AI_MODEL_CONTENT_TYPE = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
};
|
|
4
|
+
var AI_MODEL_CONTENT_TYPE;
|
|
5
|
+
(function (AI_MODEL_CONTENT_TYPE) {
|
|
6
|
+
AI_MODEL_CONTENT_TYPE["TEXT"] = "TEXT";
|
|
7
|
+
})(AI_MODEL_CONTENT_TYPE || (exports.AI_MODEL_CONTENT_TYPE = AI_MODEL_CONTENT_TYPE = {}));
|
|
@@ -5,7 +5,6 @@ var UNIFIED_MODEL_CONTENT_TYPE;
|
|
|
5
5
|
(function (UNIFIED_MODEL_CONTENT_TYPE) {
|
|
6
6
|
// AI Model types
|
|
7
7
|
UNIFIED_MODEL_CONTENT_TYPE["TEXT"] = "TEXT";
|
|
8
|
-
UNIFIED_MODEL_CONTENT_TYPE["IMAGE"] = "IMAGE";
|
|
9
8
|
// Tool types
|
|
10
9
|
UNIFIED_MODEL_CONTENT_TYPE["IMAGE_EDITOR"] = "IMAGE_EDITOR";
|
|
11
10
|
UNIFIED_MODEL_CONTENT_TYPE["TEXT_TO_SPEECH"] = "TEXT_TO_SPEECH";
|
|
@@ -11,6 +11,7 @@ var SUBSCRIPTION_FEATURE_TYPE;
|
|
|
11
11
|
SUBSCRIPTION_FEATURE_TYPE["ADVANCED_TOOLS_ACCESS"] = "advanced_tools_access";
|
|
12
12
|
SUBSCRIPTION_FEATURE_TYPE["STT_MODEL_ACCESS"] = "stt_model_access";
|
|
13
13
|
SUBSCRIPTION_FEATURE_TYPE["TTS_MODEL_ACCESS"] = "tts_model_access";
|
|
14
|
+
SUBSCRIPTION_FEATURE_TYPE["IMAGE_GENERATION_ACCESS"] = "image_generation_access";
|
|
14
15
|
SUBSCRIPTION_FEATURE_TYPE["IMAGE_GENERATION_QUOTA"] = "image_generation_quota";
|
|
15
16
|
SUBSCRIPTION_FEATURE_TYPE["TTS_QUOTA"] = "tts_quota";
|
|
16
17
|
SUBSCRIPTION_FEATURE_TYPE["STT_QUOTA"] = "stt_quota";
|
|
@@ -33,7 +34,7 @@ var SUBSCRIPTION_FEATURE_KIND;
|
|
|
33
34
|
(function (SUBSCRIPTION_FEATURE_KIND) {
|
|
34
35
|
SUBSCRIPTION_FEATURE_KIND["TEXT"] = "text";
|
|
35
36
|
SUBSCRIPTION_FEATURE_KIND["AI_MODEL"] = "ai_model";
|
|
36
|
-
SUBSCRIPTION_FEATURE_KIND["
|
|
37
|
+
SUBSCRIPTION_FEATURE_KIND["IMAGE_GENERATION"] = "image_generation";
|
|
37
38
|
SUBSCRIPTION_FEATURE_KIND["TTS"] = "tts";
|
|
38
39
|
SUBSCRIPTION_FEATURE_KIND["STT"] = "stt";
|
|
39
40
|
SUBSCRIPTION_FEATURE_KIND["PRESENTATIONS"] = "presentations";
|
|
@@ -15,7 +15,7 @@ exports.AiModelSchema = zod_1.z.object({
|
|
|
15
15
|
order: zod_1.z.number(),
|
|
16
16
|
canUse: zod_1.z.optional(zod_1.z.boolean()),
|
|
17
17
|
status: zod_1.z.nativeEnum(constants_1.AI_MODEL_STATUS),
|
|
18
|
-
contentType: zod_1.z.
|
|
18
|
+
contentType: zod_1.z.nativeEnum(constants_1.AI_MODEL_CONTENT_TYPE),
|
|
19
19
|
features: zod_1.z.array(zod_1.z.nativeEnum(constants_1.AI_MODEL_FEATURE)),
|
|
20
20
|
iconVariants: zod_1.z.object({
|
|
21
21
|
light: zod_1.z.object({
|
|
@@ -8,7 +8,7 @@ exports.ChatSchema = zod_1.z.object({
|
|
|
8
8
|
userId: zod_1.z.nullable(zod_1.z.string().uuid()),
|
|
9
9
|
unregisteredUserId: zod_1.z.nullable(zod_1.z.string().uuid()),
|
|
10
10
|
categoryId: zod_1.z.string().uuid(),
|
|
11
|
-
aIModelId: zod_1.z.string().uuid(),
|
|
11
|
+
aIModelId: zod_1.z.string().uuid().nullable(),
|
|
12
12
|
title: zod_1.z.string(),
|
|
13
13
|
chatStatus: zod_1.z.enum(Object.values(constants_1.CHAT_STATUS_ENUM)),
|
|
14
14
|
folderId: zod_1.z.string().nullable(),
|
|
@@ -2,11 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PromptSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
-
const constants_1 = require("../constants");
|
|
6
5
|
exports.PromptSchema = zod_1.z.object({
|
|
7
6
|
uuid: zod_1.z.string().uuid(),
|
|
8
7
|
content: zod_1.z.string(),
|
|
9
|
-
type: zod_1.z.nativeEnum(constants_1.AI_MODEL_CONTENT_TYPE),
|
|
10
8
|
topicId: zod_1.z.string().uuid().nullable(),
|
|
11
9
|
title: zod_1.z.string().nullable(),
|
|
12
10
|
createdAt: zod_1.z.date(),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SubscriptionFeatureSchema = exports.InteriorDesignModelAccessFeatureSchema = exports.InteriorDesignQuotaFeatureSchema = exports.ImageEditorModelAccessFeatureSchema = exports.ImageEditorQuotaFeatureSchema = exports.WriterModelAccessFeatureSchema = exports.WriterQuotaFeatureSchema = exports.MusicModelAccessFeatureSchema = exports.MusicQuotaFeatureSchema = exports.PresentationQuotaFeatureSchema = exports.VideoModelAccessFeatureSchema = exports.VideoQuotaFeatureSchema = exports.STTQuotaFeatureSchema = exports.STTModelAccessFeatureSchema = exports.TTSQuotaFeatureSchema = exports.ImageGenerationQuotaFeatureSchema = exports.TtsModelAccessFeatureSchema = exports.AdvancedToolsAccessFeatureSchema = exports.WebSearchFeatureSchema = exports.ExtendedContextFeatureSchema = exports.MaxInputLengthFeatureSchema = exports.RequestsQuotaFeatureSchema = exports.AiModelAccessFeatureSchema = exports.CarryoverBalanceFeatureSchema = exports.TokensFeatureSchema = exports.SubscriptionFeatureBaseSchema = void 0;
|
|
3
|
+
exports.SubscriptionFeatureSchema = exports.InteriorDesignModelAccessFeatureSchema = exports.InteriorDesignQuotaFeatureSchema = exports.ImageEditorModelAccessFeatureSchema = exports.ImageEditorQuotaFeatureSchema = exports.WriterModelAccessFeatureSchema = exports.WriterQuotaFeatureSchema = exports.MusicModelAccessFeatureSchema = exports.MusicQuotaFeatureSchema = exports.PresentationQuotaFeatureSchema = exports.VideoModelAccessFeatureSchema = exports.VideoQuotaFeatureSchema = exports.STTQuotaFeatureSchema = exports.STTModelAccessFeatureSchema = exports.TTSQuotaFeatureSchema = exports.ImageGenerationQuotaFeatureSchema = exports.TtsModelAccessFeatureSchema = exports.AdvancedToolsAccessFeatureSchema = exports.WebSearchFeatureSchema = exports.ExtendedContextFeatureSchema = exports.MaxInputLengthFeatureSchema = exports.RequestsQuotaFeatureSchema = exports.ImageGenerationAccessFeatureSchema = exports.AiModelAccessFeatureSchema = exports.CarryoverBalanceFeatureSchema = exports.TokensFeatureSchema = exports.SubscriptionFeatureBaseSchema = void 0;
|
|
4
4
|
const constants_1 = require("../constants");
|
|
5
5
|
const zod_1 = require("zod");
|
|
6
6
|
exports.SubscriptionFeatureBaseSchema = zod_1.z.object({
|
|
@@ -40,6 +40,14 @@ exports.AiModelAccessFeatureSchema = exports.SubscriptionFeatureBaseSchema.exten
|
|
|
40
40
|
isAvailable: zod_1.z.boolean(),
|
|
41
41
|
maxInputLength: zod_1.z.number(),
|
|
42
42
|
});
|
|
43
|
+
exports.ImageGenerationAccessFeatureSchema = exports.SubscriptionFeatureBaseSchema.extend({
|
|
44
|
+
type: zod_1.z.literal(constants_1.SUBSCRIPTION_FEATURE_TYPE.IMAGE_GENERATION_ACCESS),
|
|
45
|
+
kind: zod_1.z.literal(constants_1.SUBSCRIPTION_FEATURE_KIND.IMAGE_GENERATION),
|
|
46
|
+
order: zod_1.z.number(),
|
|
47
|
+
modelId: zod_1.z.string(),
|
|
48
|
+
isAvailable: zod_1.z.boolean(),
|
|
49
|
+
maxInputLength: zod_1.z.number(),
|
|
50
|
+
});
|
|
43
51
|
exports.RequestsQuotaFeatureSchema = exports.SubscriptionFeatureBaseSchema.extend({
|
|
44
52
|
type: zod_1.z.literal(constants_1.SUBSCRIPTION_FEATURE_TYPE.TEXT_GENERATION_QUOTA),
|
|
45
53
|
kind: zod_1.z.literal(constants_1.SUBSCRIPTION_FEATURE_KIND.TEXT),
|
|
@@ -74,7 +82,7 @@ exports.TtsModelAccessFeatureSchema = exports.SubscriptionFeatureBaseSchema.exte
|
|
|
74
82
|
modelId: zod_1.z.string(),
|
|
75
83
|
});
|
|
76
84
|
exports.ImageGenerationQuotaFeatureSchema = exports.SubscriptionFeatureBaseSchema.extend({
|
|
77
|
-
kind: zod_1.z.literal(constants_1.SUBSCRIPTION_FEATURE_KIND.
|
|
85
|
+
kind: zod_1.z.literal(constants_1.SUBSCRIPTION_FEATURE_KIND.IMAGE_GENERATION),
|
|
78
86
|
type: zod_1.z.literal(constants_1.SUBSCRIPTION_FEATURE_TYPE.IMAGE_GENERATION_QUOTA),
|
|
79
87
|
value: zod_1.z.number(),
|
|
80
88
|
});
|
|
@@ -179,4 +187,5 @@ exports.SubscriptionFeatureSchema = zod_1.z.union([
|
|
|
179
187
|
exports.ImageEditorModelAccessFeatureSchema,
|
|
180
188
|
exports.InteriorDesignQuotaFeatureSchema,
|
|
181
189
|
exports.InteriorDesignModelAccessFeatureSchema,
|
|
190
|
+
exports.ImageGenerationAccessFeatureSchema,
|
|
182
191
|
]);
|
|
@@ -7,6 +7,7 @@ export namespace CreateTextMessageCommand {
|
|
|
7
7
|
text: z.string(),
|
|
8
8
|
files: z.array(z.string().uuid()).optional().default([]),
|
|
9
9
|
features: z.array(z.nativeEnum(AI_MODEL_FEATURE)).optional().default([]),
|
|
10
|
+
aiModelId: z.string().uuid(),
|
|
10
11
|
});
|
|
11
12
|
|
|
12
13
|
export const RequestParamSchema = ChatSchema.pick({
|
|
@@ -7,6 +7,7 @@ export enum SUBSCRIPTION_FEATURE_TYPE {
|
|
|
7
7
|
ADVANCED_TOOLS_ACCESS = 'advanced_tools_access',
|
|
8
8
|
STT_MODEL_ACCESS = 'stt_model_access',
|
|
9
9
|
TTS_MODEL_ACCESS = 'tts_model_access',
|
|
10
|
+
IMAGE_GENERATION_ACCESS = 'image_generation_access',
|
|
10
11
|
IMAGE_GENERATION_QUOTA = 'image_generation_quota',
|
|
11
12
|
TTS_QUOTA = 'tts_quota',
|
|
12
13
|
STT_QUOTA = 'stt_quota',
|
|
@@ -29,7 +30,7 @@ export enum SUBSCRIPTION_FEATURE_TYPE {
|
|
|
29
30
|
export enum SUBSCRIPTION_FEATURE_KIND {
|
|
30
31
|
TEXT = 'text',
|
|
31
32
|
AI_MODEL = 'ai_model',
|
|
32
|
-
|
|
33
|
+
IMAGE_GENERATION = 'image_generation',
|
|
33
34
|
TTS = 'tts',
|
|
34
35
|
STT = 'stt',
|
|
35
36
|
PRESENTATIONS = 'presentations',
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
3
|
-
AI_MODEL_CONTENT_TYPE,
|
|
4
|
-
AI_MODEL_FEATURE,
|
|
5
|
-
AI_MODEL_STATUS,
|
|
6
|
-
TAIModelContentTypeEnum,
|
|
7
|
-
} from '../constants';
|
|
2
|
+
import { AI_MODEL_CONTENT_TYPE, AI_MODEL_FEATURE, AI_MODEL_STATUS } from '../constants';
|
|
8
3
|
import { AiModelConfigSchema } from './ai-model-config.schema';
|
|
9
4
|
|
|
10
5
|
export const AiModelSchema = z.object({
|
|
@@ -18,7 +13,7 @@ export const AiModelSchema = z.object({
|
|
|
18
13
|
order: z.number(),
|
|
19
14
|
canUse: z.optional(z.boolean()),
|
|
20
15
|
status: z.nativeEnum(AI_MODEL_STATUS),
|
|
21
|
-
contentType: z.
|
|
16
|
+
contentType: z.nativeEnum(AI_MODEL_CONTENT_TYPE),
|
|
22
17
|
features: z.array(z.nativeEnum(AI_MODEL_FEATURE)),
|
|
23
18
|
iconVariants: z.object({
|
|
24
19
|
light: z.object({
|
package/models/chat.schema.ts
CHANGED
|
@@ -6,7 +6,7 @@ export const ChatSchema = z.object({
|
|
|
6
6
|
userId: z.nullable(z.string().uuid()),
|
|
7
7
|
unregisteredUserId: z.nullable(z.string().uuid()),
|
|
8
8
|
categoryId: z.string().uuid(),
|
|
9
|
-
aIModelId: z.string().uuid(),
|
|
9
|
+
aIModelId: z.string().uuid().nullable(),
|
|
10
10
|
title: z.string(),
|
|
11
11
|
chatStatus: z.enum(Object.values(CHAT_STATUS_ENUM) as [TChatStatusEnum]),
|
|
12
12
|
folderId: z.string().nullable(),
|
package/models/prompt.schema.ts
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { AI_MODEL_CONTENT_TYPE } from '../constants';
|
|
3
2
|
|
|
4
3
|
export const PromptSchema = z.object({
|
|
5
4
|
uuid: z.string().uuid(),
|
|
6
5
|
content: z.string(),
|
|
7
|
-
type: z.nativeEnum(AI_MODEL_CONTENT_TYPE),
|
|
8
6
|
topicId: z.string().uuid().nullable(),
|
|
9
7
|
title: z.string().nullable(),
|
|
10
8
|
|
|
@@ -51,6 +51,16 @@ export const AiModelAccessFeatureSchema = SubscriptionFeatureBaseSchema.extend({
|
|
|
51
51
|
});
|
|
52
52
|
export type AiModelAccessFeature = z.infer<typeof AiModelAccessFeatureSchema>;
|
|
53
53
|
|
|
54
|
+
export const ImageGenerationAccessFeatureSchema = SubscriptionFeatureBaseSchema.extend({
|
|
55
|
+
type: z.literal(SUBSCRIPTION_FEATURE_TYPE.IMAGE_GENERATION_ACCESS),
|
|
56
|
+
kind: z.literal(SUBSCRIPTION_FEATURE_KIND.IMAGE_GENERATION),
|
|
57
|
+
order: z.number(),
|
|
58
|
+
modelId: z.string(),
|
|
59
|
+
isAvailable: z.boolean(),
|
|
60
|
+
maxInputLength: z.number(),
|
|
61
|
+
});
|
|
62
|
+
export type ImageGenerationAccessFeature = z.infer<typeof ImageGenerationAccessFeatureSchema>;
|
|
63
|
+
|
|
54
64
|
export const RequestsQuotaFeatureSchema = SubscriptionFeatureBaseSchema.extend({
|
|
55
65
|
type: z.literal(SUBSCRIPTION_FEATURE_TYPE.TEXT_GENERATION_QUOTA),
|
|
56
66
|
kind: z.literal(SUBSCRIPTION_FEATURE_KIND.TEXT),
|
|
@@ -97,7 +107,7 @@ export const TtsModelAccessFeatureSchema = SubscriptionFeatureBaseSchema.extend(
|
|
|
97
107
|
export type TtsModelAccessFeature = z.infer<typeof TtsModelAccessFeatureSchema>;
|
|
98
108
|
|
|
99
109
|
export const ImageGenerationQuotaFeatureSchema = SubscriptionFeatureBaseSchema.extend({
|
|
100
|
-
kind: z.literal(SUBSCRIPTION_FEATURE_KIND.
|
|
110
|
+
kind: z.literal(SUBSCRIPTION_FEATURE_KIND.IMAGE_GENERATION),
|
|
101
111
|
type: z.literal(SUBSCRIPTION_FEATURE_TYPE.IMAGE_GENERATION_QUOTA),
|
|
102
112
|
value: z.number(),
|
|
103
113
|
});
|
|
@@ -234,6 +244,7 @@ export const SubscriptionFeatureSchema = z.union([
|
|
|
234
244
|
ImageEditorModelAccessFeatureSchema,
|
|
235
245
|
InteriorDesignQuotaFeatureSchema,
|
|
236
246
|
InteriorDesignModelAccessFeatureSchema,
|
|
247
|
+
ImageGenerationAccessFeatureSchema,
|
|
237
248
|
]);
|
|
238
249
|
|
|
239
250
|
export type SubscriptionFeature = z.infer<typeof SubscriptionFeatureSchema>;
|