@purpleschool/gptbot 0.5.78 → 0.5.80
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/api/controllers/http/ai-vendor.ts +9 -0
- package/api/controllers/http/chat-private.ts +0 -2
- package/api/controllers/http/chat-public.ts +0 -2
- package/api/controllers/http/index.ts +1 -0
- package/build/api/controllers/http/ai-vendor.js +11 -0
- package/build/api/controllers/http/chat-private.js +0 -2
- package/build/api/controllers/http/chat-public.js +0 -2
- package/build/api/controllers/http/index.js +1 -0
- package/build/commands/ai-vendor/create-ai-vendor.command.js +16 -0
- package/build/commands/ai-vendor/delete-ai-vendor.command.js +11 -0
- package/build/commands/ai-vendor/find-ai-vendor-by-uuid.query.js +14 -0
- package/build/commands/ai-vendor/find-ai-vendors-by-criteria.query.js +16 -0
- package/build/commands/ai-vendor/find-all-ai-vendors.command.js +11 -0
- package/build/commands/ai-vendor/index.js +22 -0
- package/build/commands/ai-vendor/update-ai-vendor.command.js +14 -0
- package/build/commands/index.js +1 -0
- package/build/commands/message/create-text-message.command.js +2 -0
- package/build/commands/message/index.js +0 -2
- package/build/constants/ai-model/enums/ai-model-config-selector-type.enum.js +1 -0
- package/build/constants/ai-model/enums/ai-model-content-type.enum.js +0 -2
- package/build/constants/ai-model/enums/ai-model-feature.enum.js +1 -0
- package/build/constants/ai-vendor/enums/ai-vendor.enum.js +8 -0
- package/build/constants/ai-vendor/enums/index.js +17 -0
- package/build/constants/ai-vendor/index.js +17 -0
- package/build/constants/errors/errors.js +25 -0
- package/build/models/ai-model.schema.js +9 -2
- package/build/models/ai-vendor.schema.js +23 -0
- package/build/models/index.js +1 -0
- package/build/models/product.schema.js +10 -0
- package/build/models/subscription-feature.schema.js +8 -2
- package/build/models/subscription.schema.js +10 -0
- package/commands/ai-vendor/create-ai-vendor.command.ts +17 -0
- package/commands/ai-vendor/delete-ai-vendor.command.ts +12 -0
- package/commands/ai-vendor/find-ai-vendor-by-uuid.query.ts +15 -0
- package/commands/ai-vendor/find-ai-vendors-by-criteria.query.ts +17 -0
- package/commands/ai-vendor/find-all-ai-vendors.command.ts +9 -0
- package/commands/ai-vendor/index.ts +6 -0
- package/commands/ai-vendor/update-ai-vendor.command.ts +15 -0
- package/commands/index.ts +1 -0
- package/commands/message/create-text-message.command.ts +2 -0
- package/commands/message/index.ts +0 -2
- package/constants/ai-model/enums/ai-model-config-selector-type.enum.ts +1 -0
- package/constants/ai-model/enums/ai-model-content-type.enum.ts +0 -2
- package/constants/ai-model/enums/ai-model-feature.enum.ts +1 -0
- package/constants/ai-vendor/enums/ai-vendor.enum.ts +4 -0
- package/constants/ai-vendor/enums/index.ts +1 -0
- package/constants/ai-vendor/index.ts +1 -0
- package/constants/errors/errors.ts +25 -0
- package/models/ai-model.schema.ts +9 -2
- package/models/ai-vendor.schema.ts +21 -0
- package/models/index.ts +1 -0
- package/models/product.schema.ts +10 -0
- package/models/subscription-feature.schema.ts +8 -2
- package/models/subscription.schema.ts +10 -0
- package/package.json +1 -1
- package/build/commands/message/create-speech-to-text-message.command.js +0 -17
- package/build/commands/message/create-text-to-speech-message.command.js +0 -22
- package/commands/message/create-speech-to-text-message.command.ts +0 -19
- package/commands/message/create-text-to-speech-message.command.ts +0 -26
|
@@ -10,8 +10,6 @@ export const CHAT_PRIVATE_ROUTES = {
|
|
|
10
10
|
FIND_BY_UUID: (uuid: string) => `${uuid}`,
|
|
11
11
|
SEND_TEXT_MESSAGE: (uuid: string) => `${uuid}/messages/text`,
|
|
12
12
|
SEND_IMAGE_MESSAGE: (uuid: string) => `${uuid}/messages/image`,
|
|
13
|
-
SEND_TEXT_TO_SPEECH_MESSAGE: (uuid: string) => `${uuid}/messages/text-to-speech`,
|
|
14
|
-
SEND_SPEECH_TO_TEXT_MESSAGE: (uuid: string) => `${uuid}/messages/speech-to-text`,
|
|
15
13
|
ARCHIVE: 'archive',
|
|
16
14
|
DELETE: (uuid: string) => `${uuid}`,
|
|
17
15
|
UPDATE: (uuid: string) => `${uuid}`,
|
|
@@ -9,7 +9,5 @@ export const CHAT_PUBLIC_ROUTES = {
|
|
|
9
9
|
FIND_BY_UUID: (uuid: string) => `${uuid}`,
|
|
10
10
|
SEND_TEXT_MESSAGE: (uuid: string) => `${uuid}/messages/text`,
|
|
11
11
|
SEND_IMAGE_MESSAGE: (uuid: string) => `${uuid}/messages/image`,
|
|
12
|
-
SEND_TEXT_TO_SPEECH_MESSAGE: (uuid: string) => `${uuid}/messages/text-to-speech`,
|
|
13
|
-
SEND_SPEECH_TO_TEXT_MESSAGE: (uuid: string) => `${uuid}/messages/speech-to-text`,
|
|
14
12
|
INPUT_LIMITS: 'input-limits',
|
|
15
13
|
} as const;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AI_VENDOR_ROUTES = exports.AI_VENDOR_CONTROLLER = void 0;
|
|
4
|
+
exports.AI_VENDOR_CONTROLLER = 'ai-vendor';
|
|
5
|
+
exports.AI_VENDOR_ROUTES = {
|
|
6
|
+
CREATE: '',
|
|
7
|
+
UPDATE: (uuid) => `${uuid}`,
|
|
8
|
+
FIND_ALL: 'all',
|
|
9
|
+
DELETE: (uuid) => `${uuid}`,
|
|
10
|
+
FIND_BY_UUID: (uuid) => `${uuid}`,
|
|
11
|
+
};
|
|
@@ -12,8 +12,6 @@ exports.CHAT_PRIVATE_ROUTES = {
|
|
|
12
12
|
FIND_BY_UUID: (uuid) => `${uuid}`,
|
|
13
13
|
SEND_TEXT_MESSAGE: (uuid) => `${uuid}/messages/text`,
|
|
14
14
|
SEND_IMAGE_MESSAGE: (uuid) => `${uuid}/messages/image`,
|
|
15
|
-
SEND_TEXT_TO_SPEECH_MESSAGE: (uuid) => `${uuid}/messages/text-to-speech`,
|
|
16
|
-
SEND_SPEECH_TO_TEXT_MESSAGE: (uuid) => `${uuid}/messages/speech-to-text`,
|
|
17
15
|
ARCHIVE: 'archive',
|
|
18
16
|
DELETE: (uuid) => `${uuid}`,
|
|
19
17
|
UPDATE: (uuid) => `${uuid}`,
|
|
@@ -11,7 +11,5 @@ exports.CHAT_PUBLIC_ROUTES = {
|
|
|
11
11
|
FIND_BY_UUID: (uuid) => `${uuid}`,
|
|
12
12
|
SEND_TEXT_MESSAGE: (uuid) => `${uuid}/messages/text`,
|
|
13
13
|
SEND_IMAGE_MESSAGE: (uuid) => `${uuid}/messages/image`,
|
|
14
|
-
SEND_TEXT_TO_SPEECH_MESSAGE: (uuid) => `${uuid}/messages/text-to-speech`,
|
|
15
|
-
SEND_SPEECH_TO_TEXT_MESSAGE: (uuid) => `${uuid}/messages/speech-to-text`,
|
|
16
14
|
INPUT_LIMITS: 'input-limits',
|
|
17
15
|
};
|
|
@@ -16,6 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./account-merge"), exports);
|
|
18
18
|
__exportStar(require("./ai-model"), exports);
|
|
19
|
+
__exportStar(require("./ai-vendor"), exports);
|
|
19
20
|
__exportStar(require("./auth"), exports);
|
|
20
21
|
__exportStar(require("./blog"), exports);
|
|
21
22
|
__exportStar(require("./category"), exports);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CreateAiVendorCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../../models");
|
|
6
|
+
var CreateAiVendorCommand;
|
|
7
|
+
(function (CreateAiVendorCommand) {
|
|
8
|
+
CreateAiVendorCommand.RequestSchema = models_1.AiVendorSchema.omit({
|
|
9
|
+
uuid: true,
|
|
10
|
+
createdAt: true,
|
|
11
|
+
updatedAt: true,
|
|
12
|
+
});
|
|
13
|
+
CreateAiVendorCommand.ResponseSchema = zod_1.z.object({
|
|
14
|
+
data: models_1.AiVendorSchema,
|
|
15
|
+
});
|
|
16
|
+
})(CreateAiVendorCommand || (exports.CreateAiVendorCommand = CreateAiVendorCommand = {}));
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DeleteAiVendorCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
var DeleteAiVendorCommand;
|
|
6
|
+
(function (DeleteAiVendorCommand) {
|
|
7
|
+
DeleteAiVendorCommand.RequestSchema = zod_1.z.object({
|
|
8
|
+
uuid: zod_1.z.string().uuid(),
|
|
9
|
+
});
|
|
10
|
+
DeleteAiVendorCommand.ResponseSchema = zod_1.z.void();
|
|
11
|
+
})(DeleteAiVendorCommand || (exports.DeleteAiVendorCommand = DeleteAiVendorCommand = {}));
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FindAiVendorByUuidCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const ai_vendor_schema_1 = require("../../models/ai-vendor.schema");
|
|
6
|
+
var FindAiVendorByUuidCommand;
|
|
7
|
+
(function (FindAiVendorByUuidCommand) {
|
|
8
|
+
FindAiVendorByUuidCommand.RequestSchema = zod_1.z.object({
|
|
9
|
+
uuid: zod_1.z.string().uuid(),
|
|
10
|
+
});
|
|
11
|
+
FindAiVendorByUuidCommand.ResponseSchema = zod_1.z.object({
|
|
12
|
+
data: ai_vendor_schema_1.AiVendorSchema,
|
|
13
|
+
});
|
|
14
|
+
})(FindAiVendorByUuidCommand || (exports.FindAiVendorByUuidCommand = FindAiVendorByUuidCommand = {}));
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FindAiVendorsByCriteriaCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const ai_vendor_schema_1 = require("../../models/ai-vendor.schema");
|
|
6
|
+
var FindAiVendorsByCriteriaCommand;
|
|
7
|
+
(function (FindAiVendorsByCriteriaCommand) {
|
|
8
|
+
FindAiVendorsByCriteriaCommand.RequestSchema = ai_vendor_schema_1.AiVendorSchema.omit({
|
|
9
|
+
uuid: true,
|
|
10
|
+
createdAt: true,
|
|
11
|
+
updatedAt: true,
|
|
12
|
+
});
|
|
13
|
+
FindAiVendorsByCriteriaCommand.ResponseSchema = zod_1.z.object({
|
|
14
|
+
data: zod_1.z.array(ai_vendor_schema_1.AiVendorSchema),
|
|
15
|
+
});
|
|
16
|
+
})(FindAiVendorsByCriteriaCommand || (exports.FindAiVendorsByCriteriaCommand = FindAiVendorsByCriteriaCommand = {}));
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FindAllAiVendorsCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const ai_vendor_schema_1 = require("../../models/ai-vendor.schema");
|
|
6
|
+
var FindAllAiVendorsCommand;
|
|
7
|
+
(function (FindAllAiVendorsCommand) {
|
|
8
|
+
FindAllAiVendorsCommand.ResponseSchema = zod_1.z.object({
|
|
9
|
+
data: zod_1.z.array(ai_vendor_schema_1.AiVendorSchema),
|
|
10
|
+
});
|
|
11
|
+
})(FindAllAiVendorsCommand || (exports.FindAllAiVendorsCommand = FindAllAiVendorsCommand = {}));
|
|
@@ -0,0 +1,22 @@
|
|
|
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("./create-ai-vendor.command"), exports);
|
|
18
|
+
__exportStar(require("./update-ai-vendor.command"), exports);
|
|
19
|
+
__exportStar(require("./delete-ai-vendor.command"), exports);
|
|
20
|
+
__exportStar(require("./find-ai-vendor-by-uuid.query"), exports);
|
|
21
|
+
__exportStar(require("./find-all-ai-vendors.command"), exports);
|
|
22
|
+
__exportStar(require("./find-ai-vendors-by-criteria.query"), exports);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UpdateAiVendorCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const ai_vendor_schema_1 = require("../../models/ai-vendor.schema");
|
|
6
|
+
var UpdateAiVendorCommand;
|
|
7
|
+
(function (UpdateAiVendorCommand) {
|
|
8
|
+
UpdateAiVendorCommand.RequestSchema = ai_vendor_schema_1.AiVendorSchema.omit({
|
|
9
|
+
uuid: true,
|
|
10
|
+
}).partial();
|
|
11
|
+
UpdateAiVendorCommand.ResponseSchema = zod_1.z.object({
|
|
12
|
+
data: ai_vendor_schema_1.AiVendorSchema,
|
|
13
|
+
});
|
|
14
|
+
})(UpdateAiVendorCommand || (exports.UpdateAiVendorCommand = UpdateAiVendorCommand = {}));
|
package/build/commands/index.js
CHANGED
|
@@ -16,6 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./account-merge"), exports);
|
|
18
18
|
__exportStar(require("./ai-model"), exports);
|
|
19
|
+
__exportStar(require("./ai-vendor"), exports);
|
|
19
20
|
__exportStar(require("./auth"), exports);
|
|
20
21
|
__exportStar(require("./blog"), exports);
|
|
21
22
|
__exportStar(require("./category"), exports);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CreateTextMessageCommand = void 0;
|
|
4
|
+
const constants_1 = require("../../constants");
|
|
4
5
|
const models_1 = require("../../models");
|
|
5
6
|
const zod_1 = require("zod");
|
|
6
7
|
var CreateTextMessageCommand;
|
|
@@ -8,6 +9,7 @@ var CreateTextMessageCommand;
|
|
|
8
9
|
CreateTextMessageCommand.RequestSchema = zod_1.z.object({
|
|
9
10
|
text: zod_1.z.string(),
|
|
10
11
|
files: zod_1.z.array(zod_1.z.string().uuid()).optional().default([]),
|
|
12
|
+
features: zod_1.z.array(zod_1.z.nativeEnum(constants_1.AI_MODEL_FEATURE)).optional().default([]),
|
|
11
13
|
});
|
|
12
14
|
CreateTextMessageCommand.RequestParamSchema = models_1.ChatSchema.pick({
|
|
13
15
|
uuid: true,
|
|
@@ -15,8 +15,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./create-image-message.command"), exports);
|
|
18
|
-
__exportStar(require("./create-speech-to-text-message.command"), exports);
|
|
19
18
|
__exportStar(require("./create-text-message.command"), exports);
|
|
20
|
-
__exportStar(require("./create-text-to-speech-message.command"), exports);
|
|
21
19
|
__exportStar(require("./find-message-by-uuid.command"), exports);
|
|
22
20
|
__exportStar(require("./rate-message.command"), exports);
|
|
@@ -5,4 +5,5 @@ var AI_MODEL_CONFIG_PARAM;
|
|
|
5
5
|
(function (AI_MODEL_CONFIG_PARAM) {
|
|
6
6
|
AI_MODEL_CONFIG_PARAM["IMAGE_SIZE"] = "image-size";
|
|
7
7
|
AI_MODEL_CONFIG_PARAM["VOICE_TYPE"] = "voice-type";
|
|
8
|
+
AI_MODEL_CONFIG_PARAM["WEB_SEARCH"] = "web-search";
|
|
8
9
|
})(AI_MODEL_CONFIG_PARAM || (exports.AI_MODEL_CONFIG_PARAM = AI_MODEL_CONFIG_PARAM = {}));
|
|
@@ -5,4 +5,5 @@ var AI_MODEL_FEATURE;
|
|
|
5
5
|
(function (AI_MODEL_FEATURE) {
|
|
6
6
|
AI_MODEL_FEATURE["IMAGE_ATTACHMENT"] = "image_attachment";
|
|
7
7
|
AI_MODEL_FEATURE["AUDIO_ATTACHMENT"] = "audio_attachment";
|
|
8
|
+
AI_MODEL_FEATURE["WEB_SEARCH"] = "web_search";
|
|
8
9
|
})(AI_MODEL_FEATURE || (exports.AI_MODEL_FEATURE = AI_MODEL_FEATURE = {}));
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AI_VENDOR_STATUS = void 0;
|
|
4
|
+
var AI_VENDOR_STATUS;
|
|
5
|
+
(function (AI_VENDOR_STATUS) {
|
|
6
|
+
AI_VENDOR_STATUS["ACTIVE"] = "active";
|
|
7
|
+
AI_VENDOR_STATUS["INACTIVE"] = "inactive";
|
|
8
|
+
})(AI_VENDOR_STATUS || (exports.AI_VENDOR_STATUS = AI_VENDOR_STATUS = {}));
|
|
@@ -0,0 +1,17 @@
|
|
|
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("./ai-vendor.enum"), exports);
|
|
@@ -0,0 +1,17 @@
|
|
|
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("./enums"), exports);
|
|
@@ -1124,4 +1124,29 @@ exports.ERRORS = {
|
|
|
1124
1124
|
message: 'Не удалось найти указанный тип голоса',
|
|
1125
1125
|
httpCode: 400,
|
|
1126
1126
|
},
|
|
1127
|
+
AI_VENDOR_CREATE_ERROR: {
|
|
1128
|
+
code: 'A243',
|
|
1129
|
+
message: 'Произошла ошибка при создании AI Vendor',
|
|
1130
|
+
httpCode: 500,
|
|
1131
|
+
},
|
|
1132
|
+
AI_VENDOR_UPDATE_ERROR: {
|
|
1133
|
+
code: 'A244',
|
|
1134
|
+
message: 'Произошла ошибка при обновлении AI Vendor',
|
|
1135
|
+
httpCode: 500,
|
|
1136
|
+
},
|
|
1137
|
+
AI_VENDOR_DELETE_ERROR: {
|
|
1138
|
+
code: 'A245',
|
|
1139
|
+
message: 'Произошла ошибка при удалении AI Vendor',
|
|
1140
|
+
httpCode: 500,
|
|
1141
|
+
},
|
|
1142
|
+
AI_VENDOR_FIND_ERROR: {
|
|
1143
|
+
code: 'A246',
|
|
1144
|
+
message: 'AI Vendor не найден',
|
|
1145
|
+
httpCode: 404,
|
|
1146
|
+
},
|
|
1147
|
+
AI_MODEL_DOES_NOT_SUPPORT_WEB_SEARCH: {
|
|
1148
|
+
code: 'A250',
|
|
1149
|
+
message: 'ИИ модель не поддерживает поиск в интернете',
|
|
1150
|
+
httpCode: 400,
|
|
1151
|
+
},
|
|
1127
1152
|
};
|
|
@@ -16,9 +16,16 @@ exports.AiModelSchema = zod_1.z.object({
|
|
|
16
16
|
contentType: zod_1.z.enum(Object.values(constants_1.AI_MODEL_CONTENT_TYPE)),
|
|
17
17
|
features: zod_1.z.array(zod_1.z.nativeEnum(constants_1.AI_MODEL_FEATURE)),
|
|
18
18
|
iconVariants: zod_1.z.object({
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
light: zod_1.z.object({
|
|
20
|
+
svg: zod_1.z.string(),
|
|
21
|
+
png: zod_1.z.string(),
|
|
22
|
+
}),
|
|
23
|
+
dark: zod_1.z.object({
|
|
24
|
+
svg: zod_1.z.string(),
|
|
25
|
+
png: zod_1.z.string(),
|
|
26
|
+
}),
|
|
21
27
|
}),
|
|
28
|
+
vendorId: zod_1.z.string().uuid().nullable(),
|
|
22
29
|
maxInputLength: zod_1.z.number(),
|
|
23
30
|
config: ai_model_config_schema_1.AiModelConfigSchema,
|
|
24
31
|
createdAt: zod_1.z.date(),
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AiVendorSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const ai_vendor_1 = require("../constants/ai-vendor");
|
|
6
|
+
exports.AiVendorSchema = zod_1.z.object({
|
|
7
|
+
uuid: zod_1.z.string().uuid(),
|
|
8
|
+
title: zod_1.z.string(),
|
|
9
|
+
icons: zod_1.z.object({
|
|
10
|
+
light: zod_1.z.object({
|
|
11
|
+
svg: zod_1.z.string(),
|
|
12
|
+
png: zod_1.z.string(),
|
|
13
|
+
}),
|
|
14
|
+
dark: zod_1.z.object({
|
|
15
|
+
svg: zod_1.z.string(),
|
|
16
|
+
png: zod_1.z.string(),
|
|
17
|
+
}),
|
|
18
|
+
}),
|
|
19
|
+
order: zod_1.z.number(),
|
|
20
|
+
status: zod_1.z.nativeEnum(ai_vendor_1.AI_VENDOR_STATUS),
|
|
21
|
+
createdAt: zod_1.z.date(),
|
|
22
|
+
updatedAt: zod_1.z.date(),
|
|
23
|
+
});
|
package/build/models/index.js
CHANGED
|
@@ -17,6 +17,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./ai-model-config.schema"), exports);
|
|
18
18
|
__exportStar(require("./ai-model-formatted.schema"), exports);
|
|
19
19
|
__exportStar(require("./ai-model.schema"), exports);
|
|
20
|
+
__exportStar(require("./ai-vendor.schema"), exports);
|
|
20
21
|
__exportStar(require("./category.schema"), exports);
|
|
21
22
|
__exportStar(require("./chat.schema"), exports);
|
|
22
23
|
__exportStar(require("./cloud-payments-receipt.schema"), exports);
|
|
@@ -13,6 +13,16 @@ exports.ProductSchema = zod_1.z.object({
|
|
|
13
13
|
requests: zod_1.z.number(),
|
|
14
14
|
price: zod_1.z.number(),
|
|
15
15
|
icon: zod_1.z.string(),
|
|
16
|
+
icons: zod_1.z.object({
|
|
17
|
+
light: zod_1.z.object({
|
|
18
|
+
png: zod_1.z.string(),
|
|
19
|
+
svg: zod_1.z.string(),
|
|
20
|
+
}),
|
|
21
|
+
dark: zod_1.z.object({
|
|
22
|
+
png: zod_1.z.string(),
|
|
23
|
+
svg: zod_1.z.string(),
|
|
24
|
+
}),
|
|
25
|
+
}),
|
|
16
26
|
features: zod_1.z.array(subscription_feature_schema_1.SubscriptionFeatureSchema),
|
|
17
27
|
maxInputLength: zod_1.z.number(),
|
|
18
28
|
maxInputTokens: zod_1.z.number(),
|
|
@@ -6,8 +6,14 @@ const zod_1 = require("zod");
|
|
|
6
6
|
exports.SubscriptionFeatureBaseSchema = zod_1.z.object({
|
|
7
7
|
title: zod_1.z.string(),
|
|
8
8
|
iconVariants: zod_1.z.object({
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
light: zod_1.z.object({
|
|
10
|
+
svg: zod_1.z.string(),
|
|
11
|
+
png: zod_1.z.string(),
|
|
12
|
+
}),
|
|
13
|
+
dark: zod_1.z.object({
|
|
14
|
+
svg: zod_1.z.string(),
|
|
15
|
+
png: zod_1.z.string(),
|
|
16
|
+
}),
|
|
11
17
|
}),
|
|
12
18
|
type: zod_1.z.nativeEnum(constants_1.SUBSCRIPTION_FEATURE_TYPE),
|
|
13
19
|
});
|
|
@@ -16,6 +16,16 @@ exports.SubscriptionSchema = zod_1.z.object({
|
|
|
16
16
|
period: zod_1.z.number(),
|
|
17
17
|
tokens: zod_1.z.number(),
|
|
18
18
|
icon: zod_1.z.string(),
|
|
19
|
+
icons: zod_1.z.object({
|
|
20
|
+
light: zod_1.z.object({
|
|
21
|
+
png: zod_1.z.string(),
|
|
22
|
+
svg: zod_1.z.string(),
|
|
23
|
+
}),
|
|
24
|
+
dark: zod_1.z.object({
|
|
25
|
+
png: zod_1.z.string(),
|
|
26
|
+
svg: zod_1.z.string(),
|
|
27
|
+
}),
|
|
28
|
+
}),
|
|
19
29
|
action: zod_1.z.nativeEnum(constants_1.SUBSCRIPTION_ACTION).optional().nullable(),
|
|
20
30
|
features: zod_1.z.array(subscription_feature_schema_1.SubscriptionFeatureSchema),
|
|
21
31
|
maxInputLength: zod_1.z.number(),
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { AiVendorSchema } from '../../models';
|
|
3
|
+
|
|
4
|
+
export namespace CreateAiVendorCommand {
|
|
5
|
+
export const RequestSchema = AiVendorSchema.omit({
|
|
6
|
+
uuid: true,
|
|
7
|
+
createdAt: true,
|
|
8
|
+
updatedAt: true,
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
12
|
+
|
|
13
|
+
export const ResponseSchema = z.object({
|
|
14
|
+
data: AiVendorSchema,
|
|
15
|
+
});
|
|
16
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
export namespace DeleteAiVendorCommand {
|
|
4
|
+
export const RequestSchema = z.object({
|
|
5
|
+
uuid: z.string().uuid(),
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
9
|
+
|
|
10
|
+
export const ResponseSchema = z.void();
|
|
11
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { AiVendorSchema } from '../../models/ai-vendor.schema';
|
|
3
|
+
|
|
4
|
+
export namespace FindAiVendorByUuidCommand {
|
|
5
|
+
export const RequestSchema = z.object({
|
|
6
|
+
uuid: z.string().uuid(),
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
10
|
+
|
|
11
|
+
export const ResponseSchema = z.object({
|
|
12
|
+
data: AiVendorSchema,
|
|
13
|
+
});
|
|
14
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { AiVendorSchema } from '../../models/ai-vendor.schema';
|
|
3
|
+
|
|
4
|
+
export namespace FindAiVendorsByCriteriaCommand {
|
|
5
|
+
export const RequestSchema = AiVendorSchema.omit({
|
|
6
|
+
uuid: true,
|
|
7
|
+
createdAt: true,
|
|
8
|
+
updatedAt: true,
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
12
|
+
|
|
13
|
+
export const ResponseSchema = z.object({
|
|
14
|
+
data: z.array(AiVendorSchema),
|
|
15
|
+
});
|
|
16
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { AiVendorSchema } from '../../models/ai-vendor.schema';
|
|
3
|
+
|
|
4
|
+
export namespace FindAllAiVendorsCommand {
|
|
5
|
+
export const ResponseSchema = z.object({
|
|
6
|
+
data: z.array(AiVendorSchema),
|
|
7
|
+
});
|
|
8
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * from './create-ai-vendor.command';
|
|
2
|
+
export * from './update-ai-vendor.command';
|
|
3
|
+
export * from './delete-ai-vendor.command';
|
|
4
|
+
export * from './find-ai-vendor-by-uuid.query';
|
|
5
|
+
export * from './find-all-ai-vendors.command';
|
|
6
|
+
export * from './find-ai-vendors-by-criteria.query';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { AiVendorSchema } from '../../models/ai-vendor.schema';
|
|
3
|
+
|
|
4
|
+
export namespace UpdateAiVendorCommand {
|
|
5
|
+
export const RequestSchema = AiVendorSchema.omit({
|
|
6
|
+
uuid: true,
|
|
7
|
+
}).partial();
|
|
8
|
+
|
|
9
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
10
|
+
|
|
11
|
+
export const ResponseSchema = z.object({
|
|
12
|
+
data: AiVendorSchema,
|
|
13
|
+
});
|
|
14
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
15
|
+
}
|
package/commands/index.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AI_MODEL_FEATURE } from '../../constants';
|
|
1
2
|
import { ChatSchema, MessageSchema } from '../../models';
|
|
2
3
|
import { z } from 'zod';
|
|
3
4
|
|
|
@@ -5,6 +6,7 @@ export namespace CreateTextMessageCommand {
|
|
|
5
6
|
export const RequestSchema = z.object({
|
|
6
7
|
text: z.string(),
|
|
7
8
|
files: z.array(z.string().uuid()).optional().default([]),
|
|
9
|
+
features: z.array(z.nativeEnum(AI_MODEL_FEATURE)).optional().default([]),
|
|
8
10
|
});
|
|
9
11
|
|
|
10
12
|
export const RequestParamSchema = ChatSchema.pick({
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
export * from './create-image-message.command';
|
|
2
|
-
export * from './create-speech-to-text-message.command';
|
|
3
2
|
export * from './create-text-message.command';
|
|
4
|
-
export * from './create-text-to-speech-message.command';
|
|
5
3
|
export * from './find-message-by-uuid.command';
|
|
6
4
|
export * from './rate-message.command';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ai-vendor.enum';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './enums';
|
|
@@ -1130,4 +1130,29 @@ export const ERRORS = {
|
|
|
1130
1130
|
message: 'Не удалось найти указанный тип голоса',
|
|
1131
1131
|
httpCode: 400,
|
|
1132
1132
|
},
|
|
1133
|
+
AI_VENDOR_CREATE_ERROR: {
|
|
1134
|
+
code: 'A243',
|
|
1135
|
+
message: 'Произошла ошибка при создании AI Vendor',
|
|
1136
|
+
httpCode: 500,
|
|
1137
|
+
},
|
|
1138
|
+
AI_VENDOR_UPDATE_ERROR: {
|
|
1139
|
+
code: 'A244',
|
|
1140
|
+
message: 'Произошла ошибка при обновлении AI Vendor',
|
|
1141
|
+
httpCode: 500,
|
|
1142
|
+
},
|
|
1143
|
+
AI_VENDOR_DELETE_ERROR: {
|
|
1144
|
+
code: 'A245',
|
|
1145
|
+
message: 'Произошла ошибка при удалении AI Vendor',
|
|
1146
|
+
httpCode: 500,
|
|
1147
|
+
},
|
|
1148
|
+
AI_VENDOR_FIND_ERROR: {
|
|
1149
|
+
code: 'A246',
|
|
1150
|
+
message: 'AI Vendor не найден',
|
|
1151
|
+
httpCode: 404,
|
|
1152
|
+
},
|
|
1153
|
+
AI_MODEL_DOES_NOT_SUPPORT_WEB_SEARCH: {
|
|
1154
|
+
code: 'A250',
|
|
1155
|
+
message: 'ИИ модель не поддерживает поиск в интернете',
|
|
1156
|
+
httpCode: 400,
|
|
1157
|
+
},
|
|
1133
1158
|
};
|
|
@@ -19,9 +19,16 @@ export const AiModelSchema = z.object({
|
|
|
19
19
|
contentType: z.enum(Object.values(AI_MODEL_CONTENT_TYPE) as [TAIModelContentTypeEnum]),
|
|
20
20
|
features: z.array(z.nativeEnum(AI_MODEL_FEATURE)),
|
|
21
21
|
iconVariants: z.object({
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
light: z.object({
|
|
23
|
+
svg: z.string(),
|
|
24
|
+
png: z.string(),
|
|
25
|
+
}),
|
|
26
|
+
dark: z.object({
|
|
27
|
+
svg: z.string(),
|
|
28
|
+
png: z.string(),
|
|
29
|
+
}),
|
|
24
30
|
}),
|
|
31
|
+
vendorId: z.string().uuid().nullable(),
|
|
25
32
|
maxInputLength: z.number(),
|
|
26
33
|
config: AiModelConfigSchema,
|
|
27
34
|
createdAt: z.date(),
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { AI_VENDOR_STATUS } from '../constants/ai-vendor';
|
|
3
|
+
|
|
4
|
+
export const AiVendorSchema = z.object({
|
|
5
|
+
uuid: z.string().uuid(),
|
|
6
|
+
title: z.string(),
|
|
7
|
+
icons: z.object({
|
|
8
|
+
light: z.object({
|
|
9
|
+
svg: z.string(),
|
|
10
|
+
png: z.string(),
|
|
11
|
+
}),
|
|
12
|
+
dark: z.object({
|
|
13
|
+
svg: z.string(),
|
|
14
|
+
png: z.string(),
|
|
15
|
+
}),
|
|
16
|
+
}),
|
|
17
|
+
order: z.number(),
|
|
18
|
+
status: z.nativeEnum(AI_VENDOR_STATUS),
|
|
19
|
+
createdAt: z.date(),
|
|
20
|
+
updatedAt: z.date(),
|
|
21
|
+
});
|
package/models/index.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from './ai-model-config.schema';
|
|
2
2
|
export * from './ai-model-formatted.schema';
|
|
3
3
|
export * from './ai-model.schema';
|
|
4
|
+
export * from './ai-vendor.schema';
|
|
4
5
|
export * from './category.schema';
|
|
5
6
|
export * from './chat.schema';
|
|
6
7
|
export * from './cloud-payments-receipt.schema';
|
package/models/product.schema.ts
CHANGED
|
@@ -12,6 +12,16 @@ export const ProductSchema = z.object({
|
|
|
12
12
|
requests: z.number(),
|
|
13
13
|
price: z.number(),
|
|
14
14
|
icon: z.string(),
|
|
15
|
+
icons: z.object({
|
|
16
|
+
light: z.object({
|
|
17
|
+
png: z.string(),
|
|
18
|
+
svg: z.string(),
|
|
19
|
+
}),
|
|
20
|
+
dark: z.object({
|
|
21
|
+
png: z.string(),
|
|
22
|
+
svg: z.string(),
|
|
23
|
+
}),
|
|
24
|
+
}),
|
|
15
25
|
features: z.array(SubscriptionFeatureSchema),
|
|
16
26
|
maxInputLength: z.number(),
|
|
17
27
|
maxInputTokens: z.number(),
|
|
@@ -4,8 +4,14 @@ import { z } from 'zod';
|
|
|
4
4
|
export const SubscriptionFeatureBaseSchema = z.object({
|
|
5
5
|
title: z.string(),
|
|
6
6
|
iconVariants: z.object({
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
light: z.object({
|
|
8
|
+
svg: z.string(),
|
|
9
|
+
png: z.string(),
|
|
10
|
+
}),
|
|
11
|
+
dark: z.object({
|
|
12
|
+
svg: z.string(),
|
|
13
|
+
png: z.string(),
|
|
14
|
+
}),
|
|
9
15
|
}),
|
|
10
16
|
type: z.nativeEnum(SUBSCRIPTION_FEATURE_TYPE),
|
|
11
17
|
});
|
|
@@ -14,6 +14,16 @@ export const SubscriptionSchema = z.object({
|
|
|
14
14
|
period: z.number(),
|
|
15
15
|
tokens: z.number(),
|
|
16
16
|
icon: z.string(),
|
|
17
|
+
icons: z.object({
|
|
18
|
+
light: z.object({
|
|
19
|
+
png: z.string(),
|
|
20
|
+
svg: z.string(),
|
|
21
|
+
}),
|
|
22
|
+
dark: z.object({
|
|
23
|
+
png: z.string(),
|
|
24
|
+
svg: z.string(),
|
|
25
|
+
}),
|
|
26
|
+
}),
|
|
17
27
|
action: z.nativeEnum(SUBSCRIPTION_ACTION).optional().nullable(),
|
|
18
28
|
features: z.array(SubscriptionFeatureSchema),
|
|
19
29
|
maxInputLength: z.number(),
|
package/package.json
CHANGED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CreateSpeechToTextMessageCommand = void 0;
|
|
4
|
-
const models_1 = require("../../models");
|
|
5
|
-
const zod_1 = require("zod");
|
|
6
|
-
var CreateSpeechToTextMessageCommand;
|
|
7
|
-
(function (CreateSpeechToTextMessageCommand) {
|
|
8
|
-
CreateSpeechToTextMessageCommand.RequestSchema = zod_1.z.object({
|
|
9
|
-
fileId: zod_1.z.string().uuid(),
|
|
10
|
-
});
|
|
11
|
-
CreateSpeechToTextMessageCommand.RequestParamSchema = models_1.ChatSchema.pick({
|
|
12
|
-
uuid: true,
|
|
13
|
-
});
|
|
14
|
-
CreateSpeechToTextMessageCommand.ResponseSchema = zod_1.z.object({
|
|
15
|
-
data: models_1.MessageSchema,
|
|
16
|
-
});
|
|
17
|
-
})(CreateSpeechToTextMessageCommand || (exports.CreateSpeechToTextMessageCommand = CreateSpeechToTextMessageCommand = {}));
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CreateTextToSpeechMessageCommand = void 0;
|
|
4
|
-
const constants_1 = require("../../constants");
|
|
5
|
-
const models_1 = require("../../models");
|
|
6
|
-
const zod_1 = require("zod");
|
|
7
|
-
var CreateTextToSpeechMessageCommand;
|
|
8
|
-
(function (CreateTextToSpeechMessageCommand) {
|
|
9
|
-
CreateTextToSpeechMessageCommand.RequestSchema = zod_1.z.object({
|
|
10
|
-
text: zod_1.z.string(),
|
|
11
|
-
params: zod_1.z.array(zod_1.z.object({
|
|
12
|
-
type: zod_1.z.nativeEnum(constants_1.AI_MODEL_CONFIG_PARAM),
|
|
13
|
-
option: zod_1.z.string().uuid(),
|
|
14
|
-
})),
|
|
15
|
-
});
|
|
16
|
-
CreateTextToSpeechMessageCommand.RequestParamSchema = models_1.ChatSchema.pick({
|
|
17
|
-
uuid: true,
|
|
18
|
-
});
|
|
19
|
-
CreateTextToSpeechMessageCommand.ResponseSchema = zod_1.z.object({
|
|
20
|
-
data: models_1.MessageSchema,
|
|
21
|
-
});
|
|
22
|
-
})(CreateTextToSpeechMessageCommand || (exports.CreateTextToSpeechMessageCommand = CreateTextToSpeechMessageCommand = {}));
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { ChatSchema, MessageSchema } from '../../models';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
|
|
4
|
-
export namespace CreateSpeechToTextMessageCommand {
|
|
5
|
-
export const RequestSchema = z.object({
|
|
6
|
-
fileId: z.string().uuid(),
|
|
7
|
-
});
|
|
8
|
-
export type Request = z.infer<typeof RequestSchema>;
|
|
9
|
-
|
|
10
|
-
export const RequestParamSchema = ChatSchema.pick({
|
|
11
|
-
uuid: true,
|
|
12
|
-
});
|
|
13
|
-
export type RequestParam = z.infer<typeof RequestParamSchema>;
|
|
14
|
-
|
|
15
|
-
export const ResponseSchema = z.object({
|
|
16
|
-
data: MessageSchema,
|
|
17
|
-
});
|
|
18
|
-
export type Response = z.infer<typeof ResponseSchema>;
|
|
19
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { AI_MODEL_CONFIG_PARAM } from '../../constants';
|
|
2
|
-
import { ChatSchema, MessageSchema } from '../../models';
|
|
3
|
-
import { z } from 'zod';
|
|
4
|
-
|
|
5
|
-
export namespace CreateTextToSpeechMessageCommand {
|
|
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
|
-
});
|
|
15
|
-
export type Request = z.infer<typeof RequestSchema>;
|
|
16
|
-
|
|
17
|
-
export const RequestParamSchema = ChatSchema.pick({
|
|
18
|
-
uuid: true,
|
|
19
|
-
});
|
|
20
|
-
export type RequestParam = z.infer<typeof RequestParamSchema>;
|
|
21
|
-
|
|
22
|
-
export const ResponseSchema = z.object({
|
|
23
|
-
data: MessageSchema,
|
|
24
|
-
});
|
|
25
|
-
export type Response = z.infer<typeof ResponseSchema>;
|
|
26
|
-
}
|