@purpleschool/gptbot 0.15.64 → 0.15.65
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/api/controllers/http/spell-corrector.d.ts +1 -0
- package/build/api/controllers/http/spell-corrector.js +1 -0
- package/build/api/routes.d.ts +2 -0
- package/build/api/routes.js +2 -0
- package/build/commands/tools/spell-corrector/find-spell-corrector-job-by-uuid.command.d.ts +24 -0
- package/build/commands/tools/spell-corrector/find-spell-corrector-jobs.command.d.ts +24 -0
- package/build/commands/tools/spell-corrector/get-spell-corrector-price.command.d.ts +24 -0
- package/build/commands/tools/spell-corrector/get-spell-corrector-price.command.js +25 -0
- package/build/commands/tools/spell-corrector/get-spell-corrector-tool-config.command.d.ts +3 -0
- package/build/commands/tools/spell-corrector/index.d.ts +1 -0
- package/build/commands/tools/spell-corrector/index.js +1 -0
- package/build/commands/tools/spell-corrector/retry-spell-corrector-job.command.d.ts +24 -0
- package/build/commands/tools/spell-corrector/set-reaction-to-spell-corrector-job.command.d.ts +24 -0
- package/build/commands/tools/spell-corrector/spell-corrector.command.d.ts +37 -1
- package/build/commands/tools/spell-corrector/spell-corrector.command.js +16 -3
- package/build/commands/tools/spell-corrector/update-spell-corrector-job-favorite.command.d.ts +24 -0
- package/build/commands/tools/spell-corrector/update-spell-corrector-job-title.command.d.ts +24 -0
- package/build/constants/index.d.ts +1 -0
- package/build/constants/index.js +1 -0
- package/build/constants/tool-spell-corrector/enums/index.d.ts +1 -0
- package/build/constants/tool-spell-corrector/enums/index.js +17 -0
- package/build/constants/tool-spell-corrector/enums/spell-corrector-input-kind.enum.d.ts +4 -0
- package/build/constants/tool-spell-corrector/enums/spell-corrector-input-kind.enum.js +8 -0
- package/build/constants/tool-spell-corrector/index.d.ts +1 -0
- package/build/constants/tool-spell-corrector/index.js +17 -0
- package/build/models/tools/spell-corrector/spell-corrector-config.schema.d.ts +3 -0
- package/build/models/tools/spell-corrector/spell-corrector-config.schema.js +1 -0
- package/build/models/tools/spell-corrector/spell-corrector-job.schema.d.ts +39 -1
- package/build/models/tools/spell-corrector/spell-corrector-job.schema.js +23 -1
- package/build/models/tools/spell-corrector/spell-corrector-model.schema.d.ts +2 -0
- package/build/models/tools/spell-corrector/spell-corrector-model.schema.js +2 -0
- package/package.json +1 -1
|
@@ -2,6 +2,7 @@ export declare const SPELL_CORRECTOR_CONTROLLER_PRIVATE: 'private/tools/spell-co
|
|
|
2
2
|
export declare const SPELL_CORRECTOR_CONTROLLER_PUBLIC: 'public/tools/spell-corrector';
|
|
3
3
|
export declare const SPELL_CORRECTOR_ROUTES: {
|
|
4
4
|
readonly CONFIG: 'config';
|
|
5
|
+
readonly PRICE: 'price';
|
|
5
6
|
readonly EXECUTE: 'execute';
|
|
6
7
|
readonly GET_JOBS: 'jobs';
|
|
7
8
|
readonly GET_JOB: (uuid: string) => string;
|
|
@@ -5,6 +5,7 @@ exports.SPELL_CORRECTOR_CONTROLLER_PRIVATE = 'private/tools/spell-corrector';
|
|
|
5
5
|
exports.SPELL_CORRECTOR_CONTROLLER_PUBLIC = 'public/tools/spell-corrector';
|
|
6
6
|
exports.SPELL_CORRECTOR_ROUTES = {
|
|
7
7
|
CONFIG: 'config',
|
|
8
|
+
PRICE: 'price',
|
|
8
9
|
EXECUTE: 'execute',
|
|
9
10
|
GET_JOBS: 'jobs',
|
|
10
11
|
GET_JOB: (uuid) => `jobs/${uuid}`,
|
package/build/api/routes.d.ts
CHANGED
|
@@ -696,6 +696,7 @@ export declare const REST_API: {
|
|
|
696
696
|
};
|
|
697
697
|
readonly SPELL_CORRECTOR_PUBLIC: {
|
|
698
698
|
readonly CONFIG: "/api/public/tools/spell-corrector/config";
|
|
699
|
+
readonly PRICE: "/api/public/tools/spell-corrector/price";
|
|
699
700
|
readonly EXECUTE: "/api/public/tools/spell-corrector/execute";
|
|
700
701
|
readonly GET_JOBS: "/api/public/tools/spell-corrector/jobs";
|
|
701
702
|
readonly GET_JOB: (uuid: string) => string;
|
|
@@ -708,6 +709,7 @@ export declare const REST_API: {
|
|
|
708
709
|
};
|
|
709
710
|
readonly SPELL_CORRECTOR_PRIVATE: {
|
|
710
711
|
readonly CONFIG: "/api/private/tools/spell-corrector/config";
|
|
712
|
+
readonly PRICE: "/api/private/tools/spell-corrector/price";
|
|
711
713
|
readonly EXECUTE: "/api/private/tools/spell-corrector/execute";
|
|
712
714
|
readonly GET_JOBS: "/api/private/tools/spell-corrector/jobs";
|
|
713
715
|
readonly GET_JOB: (uuid: string) => string;
|
package/build/api/routes.js
CHANGED
|
@@ -734,6 +734,7 @@ exports.REST_API = {
|
|
|
734
734
|
},
|
|
735
735
|
SPELL_CORRECTOR_PUBLIC: {
|
|
736
736
|
CONFIG: `${exports.ROOT}/${CONTROLLERS.SPELL_CORRECTOR_CONTROLLER_PUBLIC}/${CONTROLLERS.SPELL_CORRECTOR_ROUTES.CONFIG}`,
|
|
737
|
+
PRICE: `${exports.ROOT}/${CONTROLLERS.SPELL_CORRECTOR_CONTROLLER_PUBLIC}/${CONTROLLERS.SPELL_CORRECTOR_ROUTES.PRICE}`,
|
|
737
738
|
EXECUTE: `${exports.ROOT}/${CONTROLLERS.SPELL_CORRECTOR_CONTROLLER_PUBLIC}/${CONTROLLERS.SPELL_CORRECTOR_ROUTES.EXECUTE}`,
|
|
738
739
|
GET_JOBS: `${exports.ROOT}/${CONTROLLERS.SPELL_CORRECTOR_CONTROLLER_PUBLIC}/${CONTROLLERS.SPELL_CORRECTOR_ROUTES.GET_JOBS}`,
|
|
739
740
|
GET_JOB: (uuid) => `${exports.ROOT}/${CONTROLLERS.SPELL_CORRECTOR_CONTROLLER_PUBLIC}/${CONTROLLERS.SPELL_CORRECTOR_ROUTES.GET_JOB(uuid)}`,
|
|
@@ -746,6 +747,7 @@ exports.REST_API = {
|
|
|
746
747
|
},
|
|
747
748
|
SPELL_CORRECTOR_PRIVATE: {
|
|
748
749
|
CONFIG: `${exports.ROOT}/${CONTROLLERS.SPELL_CORRECTOR_CONTROLLER_PRIVATE}/${CONTROLLERS.SPELL_CORRECTOR_ROUTES.CONFIG}`,
|
|
750
|
+
PRICE: `${exports.ROOT}/${CONTROLLERS.SPELL_CORRECTOR_CONTROLLER_PRIVATE}/${CONTROLLERS.SPELL_CORRECTOR_ROUTES.PRICE}`,
|
|
749
751
|
EXECUTE: `${exports.ROOT}/${CONTROLLERS.SPELL_CORRECTOR_CONTROLLER_PRIVATE}/${CONTROLLERS.SPELL_CORRECTOR_ROUTES.EXECUTE}`,
|
|
750
752
|
GET_JOBS: `${exports.ROOT}/${CONTROLLERS.SPELL_CORRECTOR_CONTROLLER_PRIVATE}/${CONTROLLERS.SPELL_CORRECTOR_ROUTES.GET_JOBS}`,
|
|
751
753
|
GET_JOB: (uuid) => `${exports.ROOT}/${CONTROLLERS.SPELL_CORRECTOR_CONTROLLER_PRIVATE}/${CONTROLLERS.SPELL_CORRECTOR_ROUTES.GET_JOB(uuid)}`,
|
|
@@ -13,6 +13,30 @@ export declare namespace FindSpellCorrectorJobByUUIDCommand {
|
|
|
13
13
|
createdAt: z.ZodDate;
|
|
14
14
|
updatedAt: z.ZodDate;
|
|
15
15
|
modelId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
16
|
+
inputKind: z.ZodDefault<z.ZodEnum<typeof import("../../..").SPELL_CORRECTOR_INPUT_KIND>>;
|
|
17
|
+
sourceDocument: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
18
|
+
uuid: z.ZodString;
|
|
19
|
+
url: z.ZodString;
|
|
20
|
+
name: z.ZodString;
|
|
21
|
+
mimeType: z.ZodString;
|
|
22
|
+
type: z.ZodString;
|
|
23
|
+
size: z.ZodNumber;
|
|
24
|
+
extension: z.ZodString;
|
|
25
|
+
}, z.core.$strip>>>;
|
|
26
|
+
statistics: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
27
|
+
total: z.ZodNumber;
|
|
28
|
+
spelling: z.ZodNumber;
|
|
29
|
+
punctuation: z.ZodNumber;
|
|
30
|
+
}, z.core.$strip>>>;
|
|
31
|
+
outputDocument: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
32
|
+
uuid: z.ZodString;
|
|
33
|
+
url: z.ZodString;
|
|
34
|
+
name: z.ZodString;
|
|
35
|
+
mimeType: z.ZodString;
|
|
36
|
+
type: z.ZodString;
|
|
37
|
+
size: z.ZodNumber;
|
|
38
|
+
extension: z.ZodString;
|
|
39
|
+
}, z.core.$strip>>>;
|
|
16
40
|
userInput: z.ZodString;
|
|
17
41
|
aiOutput: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
18
42
|
title: z.ZodString;
|
|
@@ -19,6 +19,30 @@ export declare namespace FindSpellCorrectorJobsCommand {
|
|
|
19
19
|
createdAt: z.ZodDate;
|
|
20
20
|
updatedAt: z.ZodDate;
|
|
21
21
|
modelId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
22
|
+
inputKind: z.ZodDefault<z.ZodEnum<typeof import("../../..").SPELL_CORRECTOR_INPUT_KIND>>;
|
|
23
|
+
sourceDocument: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
24
|
+
uuid: z.ZodString;
|
|
25
|
+
url: z.ZodString;
|
|
26
|
+
name: z.ZodString;
|
|
27
|
+
mimeType: z.ZodString;
|
|
28
|
+
type: z.ZodString;
|
|
29
|
+
size: z.ZodNumber;
|
|
30
|
+
extension: z.ZodString;
|
|
31
|
+
}, z.core.$strip>>>;
|
|
32
|
+
statistics: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
33
|
+
total: z.ZodNumber;
|
|
34
|
+
spelling: z.ZodNumber;
|
|
35
|
+
punctuation: z.ZodNumber;
|
|
36
|
+
}, z.core.$strip>>>;
|
|
37
|
+
outputDocument: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
38
|
+
uuid: z.ZodString;
|
|
39
|
+
url: z.ZodString;
|
|
40
|
+
name: z.ZodString;
|
|
41
|
+
mimeType: z.ZodString;
|
|
42
|
+
type: z.ZodString;
|
|
43
|
+
size: z.ZodNumber;
|
|
44
|
+
extension: z.ZodString;
|
|
45
|
+
}, z.core.$strip>>>;
|
|
22
46
|
userInput: z.ZodString;
|
|
23
47
|
aiOutput: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
24
48
|
title: z.ZodString;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare namespace GetSpellCorrectorPriceCommand {
|
|
3
|
+
const PrivateRequestSchema: z.ZodObject<{
|
|
4
|
+
modelId: z.ZodString;
|
|
5
|
+
prompt: z.ZodOptional<z.ZodString>;
|
|
6
|
+
fileId: z.ZodOptional<z.ZodString>;
|
|
7
|
+
}, z.core.$strip>;
|
|
8
|
+
const PublicRequestSchema: z.ZodObject<{
|
|
9
|
+
modelId: z.ZodString;
|
|
10
|
+
prompt: z.ZodString;
|
|
11
|
+
}, z.core.$strict>;
|
|
12
|
+
const RequestSchema: z.ZodObject<{
|
|
13
|
+
modelId: z.ZodString;
|
|
14
|
+
prompt: z.ZodOptional<z.ZodString>;
|
|
15
|
+
fileId: z.ZodOptional<z.ZodString>;
|
|
16
|
+
}, z.core.$strip>;
|
|
17
|
+
type Request = z.infer<typeof RequestSchema>;
|
|
18
|
+
const ResponseSchema: z.ZodObject<{
|
|
19
|
+
price: z.ZodNumber;
|
|
20
|
+
charsUntilNextPriceIncrease: z.ZodNullable<z.ZodNumber>;
|
|
21
|
+
charsUntilNextPriceDecrease: z.ZodNullable<z.ZodNumber>;
|
|
22
|
+
}, z.core.$strip>;
|
|
23
|
+
type Response = z.infer<typeof ResponseSchema>;
|
|
24
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetSpellCorrectorPriceCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const chat_1 = require("../../chat");
|
|
6
|
+
var GetSpellCorrectorPriceCommand;
|
|
7
|
+
(function (GetSpellCorrectorPriceCommand) {
|
|
8
|
+
GetSpellCorrectorPriceCommand.PrivateRequestSchema = zod_1.z
|
|
9
|
+
.object({
|
|
10
|
+
modelId: zod_1.z.string().uuid(),
|
|
11
|
+
prompt: zod_1.z.string().min(1).max(100000).optional(),
|
|
12
|
+
fileId: zod_1.z.string().uuid().optional(),
|
|
13
|
+
})
|
|
14
|
+
.refine((request) => (request.prompt !== undefined) !== (request.fileId !== undefined), {
|
|
15
|
+
message: 'Требуется ровно один из prompt или fileId',
|
|
16
|
+
});
|
|
17
|
+
GetSpellCorrectorPriceCommand.PublicRequestSchema = zod_1.z
|
|
18
|
+
.object({
|
|
19
|
+
modelId: zod_1.z.string().uuid(),
|
|
20
|
+
prompt: zod_1.z.string().min(1).max(100000),
|
|
21
|
+
})
|
|
22
|
+
.strict();
|
|
23
|
+
GetSpellCorrectorPriceCommand.RequestSchema = GetSpellCorrectorPriceCommand.PrivateRequestSchema;
|
|
24
|
+
GetSpellCorrectorPriceCommand.ResponseSchema = chat_1.CalculateChatPriceCommand.ResponseSchema;
|
|
25
|
+
})(GetSpellCorrectorPriceCommand || (exports.GetSpellCorrectorPriceCommand = GetSpellCorrectorPriceCommand = {}));
|
|
@@ -3,12 +3,15 @@ export declare namespace GetSpellCorrectorToolConfigCommand {
|
|
|
3
3
|
const ResponseSchema: z.ZodObject<{
|
|
4
4
|
data: z.ZodObject<{
|
|
5
5
|
maxSymbols: z.ZodNumber;
|
|
6
|
+
freeMaxSymbols: z.ZodNumber;
|
|
6
7
|
models: z.ZodArray<z.ZodObject<{
|
|
7
8
|
uuid: z.ZodString;
|
|
8
9
|
title: z.ZodString;
|
|
9
10
|
description: z.ZodString;
|
|
10
11
|
icon: z.ZodString;
|
|
11
12
|
price: z.ZodNumber;
|
|
13
|
+
freeMaxPromptLength: z.ZodNullable<z.ZodNumber>;
|
|
14
|
+
maxPromptLength: z.ZodNullable<z.ZodNumber>;
|
|
12
15
|
order: z.ZodNumber;
|
|
13
16
|
status: z.ZodEnum<typeof import("../../..").TOOL_MODEL_STATUS>;
|
|
14
17
|
canUse: z.ZodBoolean;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * from './spell-corrector.command';
|
|
2
|
+
export * from './get-spell-corrector-price.command';
|
|
2
3
|
export * from './delete-spell-corrector-job-by-uuid.command';
|
|
3
4
|
export * from './delete-all-spell-corrector-jobs.command';
|
|
4
5
|
export * from './set-reaction-to-spell-corrector-job.command';
|
|
@@ -15,6 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./spell-corrector.command"), exports);
|
|
18
|
+
__exportStar(require("./get-spell-corrector-price.command"), exports);
|
|
18
19
|
__exportStar(require("./delete-spell-corrector-job-by-uuid.command"), exports);
|
|
19
20
|
__exportStar(require("./delete-all-spell-corrector-jobs.command"), exports);
|
|
20
21
|
__exportStar(require("./set-reaction-to-spell-corrector-job.command"), exports);
|
|
@@ -13,6 +13,30 @@ export declare namespace RetrySpellCorrectorJobCommand {
|
|
|
13
13
|
createdAt: z.ZodDate;
|
|
14
14
|
updatedAt: z.ZodDate;
|
|
15
15
|
modelId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
16
|
+
inputKind: z.ZodDefault<z.ZodEnum<typeof import("../../..").SPELL_CORRECTOR_INPUT_KIND>>;
|
|
17
|
+
sourceDocument: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
18
|
+
uuid: z.ZodString;
|
|
19
|
+
url: z.ZodString;
|
|
20
|
+
name: z.ZodString;
|
|
21
|
+
mimeType: z.ZodString;
|
|
22
|
+
type: z.ZodString;
|
|
23
|
+
size: z.ZodNumber;
|
|
24
|
+
extension: z.ZodString;
|
|
25
|
+
}, z.core.$strip>>>;
|
|
26
|
+
statistics: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
27
|
+
total: z.ZodNumber;
|
|
28
|
+
spelling: z.ZodNumber;
|
|
29
|
+
punctuation: z.ZodNumber;
|
|
30
|
+
}, z.core.$strip>>>;
|
|
31
|
+
outputDocument: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
32
|
+
uuid: z.ZodString;
|
|
33
|
+
url: z.ZodString;
|
|
34
|
+
name: z.ZodString;
|
|
35
|
+
mimeType: z.ZodString;
|
|
36
|
+
type: z.ZodString;
|
|
37
|
+
size: z.ZodNumber;
|
|
38
|
+
extension: z.ZodString;
|
|
39
|
+
}, z.core.$strip>>>;
|
|
16
40
|
userInput: z.ZodString;
|
|
17
41
|
aiOutput: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
18
42
|
title: z.ZodString;
|
package/build/commands/tools/spell-corrector/set-reaction-to-spell-corrector-job.command.d.ts
CHANGED
|
@@ -19,6 +19,30 @@ export declare namespace SetReactionToSpellCorrectorJobCommand {
|
|
|
19
19
|
createdAt: z.ZodDate;
|
|
20
20
|
updatedAt: z.ZodDate;
|
|
21
21
|
modelId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
22
|
+
inputKind: z.ZodDefault<z.ZodEnum<typeof import("../../..").SPELL_CORRECTOR_INPUT_KIND>>;
|
|
23
|
+
sourceDocument: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
24
|
+
uuid: z.ZodString;
|
|
25
|
+
url: z.ZodString;
|
|
26
|
+
name: z.ZodString;
|
|
27
|
+
mimeType: z.ZodString;
|
|
28
|
+
type: z.ZodString;
|
|
29
|
+
size: z.ZodNumber;
|
|
30
|
+
extension: z.ZodString;
|
|
31
|
+
}, z.core.$strip>>>;
|
|
32
|
+
statistics: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
33
|
+
total: z.ZodNumber;
|
|
34
|
+
spelling: z.ZodNumber;
|
|
35
|
+
punctuation: z.ZodNumber;
|
|
36
|
+
}, z.core.$strip>>>;
|
|
37
|
+
outputDocument: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
38
|
+
uuid: z.ZodString;
|
|
39
|
+
url: z.ZodString;
|
|
40
|
+
name: z.ZodString;
|
|
41
|
+
mimeType: z.ZodString;
|
|
42
|
+
type: z.ZodString;
|
|
43
|
+
size: z.ZodNumber;
|
|
44
|
+
extension: z.ZodString;
|
|
45
|
+
}, z.core.$strip>>>;
|
|
22
46
|
userInput: z.ZodString;
|
|
23
47
|
aiOutput: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
24
48
|
title: z.ZodString;
|
|
@@ -2,8 +2,15 @@ import { z } from 'zod';
|
|
|
2
2
|
export declare namespace SpellCorrectorCommand {
|
|
3
3
|
const RequestSchema: z.ZodObject<{
|
|
4
4
|
modelId: z.ZodString;
|
|
5
|
-
|
|
5
|
+
requestId: z.ZodOptional<z.ZodString>;
|
|
6
|
+
prompt: z.ZodOptional<z.ZodString>;
|
|
7
|
+
fileId: z.ZodOptional<z.ZodString>;
|
|
6
8
|
}, z.core.$strip>;
|
|
9
|
+
const PublicRequestSchema: z.ZodObject<{
|
|
10
|
+
modelId: z.ZodString;
|
|
11
|
+
requestId: z.ZodOptional<z.ZodString>;
|
|
12
|
+
prompt: z.ZodString;
|
|
13
|
+
}, z.core.$strict>;
|
|
7
14
|
type Request = z.infer<typeof RequestSchema>;
|
|
8
15
|
const ResponseSchema: z.ZodObject<{
|
|
9
16
|
data: z.ZodObject<{
|
|
@@ -13,6 +20,35 @@ export declare namespace SpellCorrectorCommand {
|
|
|
13
20
|
isFavorite: z.ZodBoolean;
|
|
14
21
|
createdAt: z.ZodDate;
|
|
15
22
|
updatedAt: z.ZodDate;
|
|
23
|
+
modelId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
24
|
+
inputKind: z.ZodDefault<z.ZodEnum<typeof import("../../..").SPELL_CORRECTOR_INPUT_KIND>>;
|
|
25
|
+
sourceDocument: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
26
|
+
uuid: z.ZodString;
|
|
27
|
+
url: z.ZodString;
|
|
28
|
+
name: z.ZodString;
|
|
29
|
+
mimeType: z.ZodString;
|
|
30
|
+
type: z.ZodString;
|
|
31
|
+
size: z.ZodNumber;
|
|
32
|
+
extension: z.ZodString;
|
|
33
|
+
}, z.core.$strip>>>;
|
|
34
|
+
statistics: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
35
|
+
total: z.ZodNumber;
|
|
36
|
+
spelling: z.ZodNumber;
|
|
37
|
+
punctuation: z.ZodNumber;
|
|
38
|
+
}, z.core.$strip>>>;
|
|
39
|
+
outputDocument: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
40
|
+
uuid: z.ZodString;
|
|
41
|
+
url: z.ZodString;
|
|
42
|
+
name: z.ZodString;
|
|
43
|
+
mimeType: z.ZodString;
|
|
44
|
+
type: z.ZodString;
|
|
45
|
+
size: z.ZodNumber;
|
|
46
|
+
extension: z.ZodString;
|
|
47
|
+
}, z.core.$strip>>>;
|
|
48
|
+
userInput: z.ZodString;
|
|
49
|
+
aiOutput: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
50
|
+
title: z.ZodString;
|
|
51
|
+
reaction: z.ZodNullable<z.ZodEnum<typeof import("../../..").USER_REACTION>>;
|
|
16
52
|
}, z.core.$strip>;
|
|
17
53
|
}, z.core.$strip>;
|
|
18
54
|
type Response = z.infer<typeof ResponseSchema>;
|
|
@@ -5,11 +5,24 @@ const zod_1 = require("zod");
|
|
|
5
5
|
const models_1 = require("../../../models");
|
|
6
6
|
var SpellCorrectorCommand;
|
|
7
7
|
(function (SpellCorrectorCommand) {
|
|
8
|
-
SpellCorrectorCommand.RequestSchema = zod_1.z
|
|
8
|
+
SpellCorrectorCommand.RequestSchema = zod_1.z
|
|
9
|
+
.object({
|
|
9
10
|
modelId: zod_1.z.string().uuid(),
|
|
10
|
-
|
|
11
|
+
requestId: zod_1.z.string().uuid().optional(),
|
|
12
|
+
prompt: zod_1.z.string().min(1).max(100000).optional(),
|
|
13
|
+
fileId: zod_1.z.string().uuid().optional(),
|
|
14
|
+
})
|
|
15
|
+
.refine((request) => (request.prompt !== undefined) !== (request.fileId !== undefined), {
|
|
16
|
+
message: 'Требуется ровно один из prompt или fileId',
|
|
11
17
|
});
|
|
18
|
+
SpellCorrectorCommand.PublicRequestSchema = zod_1.z
|
|
19
|
+
.object({
|
|
20
|
+
modelId: zod_1.z.string().uuid(),
|
|
21
|
+
requestId: zod_1.z.string().uuid().optional(),
|
|
22
|
+
prompt: zod_1.z.string().min(1).max(100000),
|
|
23
|
+
})
|
|
24
|
+
.strict();
|
|
12
25
|
SpellCorrectorCommand.ResponseSchema = zod_1.z.object({
|
|
13
|
-
data: models_1.
|
|
26
|
+
data: models_1.SpellCorrectorToolJobSchema,
|
|
14
27
|
});
|
|
15
28
|
})(SpellCorrectorCommand || (exports.SpellCorrectorCommand = SpellCorrectorCommand = {}));
|
package/build/commands/tools/spell-corrector/update-spell-corrector-job-favorite.command.d.ts
CHANGED
|
@@ -17,6 +17,30 @@ export declare namespace UpdateSpellCorrectorJobFavoriteCommand {
|
|
|
17
17
|
createdAt: z.ZodDate;
|
|
18
18
|
updatedAt: z.ZodDate;
|
|
19
19
|
modelId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
20
|
+
inputKind: z.ZodDefault<z.ZodEnum<typeof import("../../..").SPELL_CORRECTOR_INPUT_KIND>>;
|
|
21
|
+
sourceDocument: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
22
|
+
uuid: z.ZodString;
|
|
23
|
+
url: z.ZodString;
|
|
24
|
+
name: z.ZodString;
|
|
25
|
+
mimeType: z.ZodString;
|
|
26
|
+
type: z.ZodString;
|
|
27
|
+
size: z.ZodNumber;
|
|
28
|
+
extension: z.ZodString;
|
|
29
|
+
}, z.core.$strip>>>;
|
|
30
|
+
statistics: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
31
|
+
total: z.ZodNumber;
|
|
32
|
+
spelling: z.ZodNumber;
|
|
33
|
+
punctuation: z.ZodNumber;
|
|
34
|
+
}, z.core.$strip>>>;
|
|
35
|
+
outputDocument: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
36
|
+
uuid: z.ZodString;
|
|
37
|
+
url: z.ZodString;
|
|
38
|
+
name: z.ZodString;
|
|
39
|
+
mimeType: z.ZodString;
|
|
40
|
+
type: z.ZodString;
|
|
41
|
+
size: z.ZodNumber;
|
|
42
|
+
extension: z.ZodString;
|
|
43
|
+
}, z.core.$strip>>>;
|
|
20
44
|
userInput: z.ZodString;
|
|
21
45
|
aiOutput: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
22
46
|
title: z.ZodString;
|
|
@@ -17,6 +17,30 @@ export declare namespace UpdateSpellCorrectorJobTitleCommand {
|
|
|
17
17
|
createdAt: z.ZodDate;
|
|
18
18
|
updatedAt: z.ZodDate;
|
|
19
19
|
modelId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
20
|
+
inputKind: z.ZodDefault<z.ZodEnum<typeof import("../../..").SPELL_CORRECTOR_INPUT_KIND>>;
|
|
21
|
+
sourceDocument: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
22
|
+
uuid: z.ZodString;
|
|
23
|
+
url: z.ZodString;
|
|
24
|
+
name: z.ZodString;
|
|
25
|
+
mimeType: z.ZodString;
|
|
26
|
+
type: z.ZodString;
|
|
27
|
+
size: z.ZodNumber;
|
|
28
|
+
extension: z.ZodString;
|
|
29
|
+
}, z.core.$strip>>>;
|
|
30
|
+
statistics: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
31
|
+
total: z.ZodNumber;
|
|
32
|
+
spelling: z.ZodNumber;
|
|
33
|
+
punctuation: z.ZodNumber;
|
|
34
|
+
}, z.core.$strip>>>;
|
|
35
|
+
outputDocument: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
36
|
+
uuid: z.ZodString;
|
|
37
|
+
url: z.ZodString;
|
|
38
|
+
name: z.ZodString;
|
|
39
|
+
mimeType: z.ZodString;
|
|
40
|
+
type: z.ZodString;
|
|
41
|
+
size: z.ZodNumber;
|
|
42
|
+
extension: z.ZodString;
|
|
43
|
+
}, z.core.$strip>>>;
|
|
20
44
|
userInput: z.ZodString;
|
|
21
45
|
aiOutput: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
22
46
|
title: z.ZodString;
|
|
@@ -30,6 +30,7 @@ export * from './task';
|
|
|
30
30
|
export * from './telegram';
|
|
31
31
|
export * from './tool';
|
|
32
32
|
export * from './tool-paraphrase';
|
|
33
|
+
export * from './tool-spell-corrector';
|
|
33
34
|
export * from './transaction';
|
|
34
35
|
export * from './unregistered-user';
|
|
35
36
|
export * from './user';
|
package/build/constants/index.js
CHANGED
|
@@ -46,6 +46,7 @@ __exportStar(require("./task"), exports);
|
|
|
46
46
|
__exportStar(require("./telegram"), exports);
|
|
47
47
|
__exportStar(require("./tool"), exports);
|
|
48
48
|
__exportStar(require("./tool-paraphrase"), exports);
|
|
49
|
+
__exportStar(require("./tool-spell-corrector"), exports);
|
|
49
50
|
__exportStar(require("./transaction"), exports);
|
|
50
51
|
__exportStar(require("./unregistered-user"), exports);
|
|
51
52
|
__exportStar(require("./user"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './spell-corrector-input-kind.enum';
|
|
@@ -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("./spell-corrector-input-kind.enum"), exports);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SPELL_CORRECTOR_INPUT_KIND = void 0;
|
|
4
|
+
var SPELL_CORRECTOR_INPUT_KIND;
|
|
5
|
+
(function (SPELL_CORRECTOR_INPUT_KIND) {
|
|
6
|
+
SPELL_CORRECTOR_INPUT_KIND["TEXT"] = "text";
|
|
7
|
+
SPELL_CORRECTOR_INPUT_KIND["DOCUMENT"] = "document";
|
|
8
|
+
})(SPELL_CORRECTOR_INPUT_KIND || (exports.SPELL_CORRECTOR_INPUT_KIND = SPELL_CORRECTOR_INPUT_KIND = {}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './enums';
|
|
@@ -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);
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const SpellCorrectorToolConfigSchema: z.ZodObject<{
|
|
3
3
|
maxSymbols: z.ZodNumber;
|
|
4
|
+
freeMaxSymbols: z.ZodNumber;
|
|
4
5
|
models: z.ZodArray<z.ZodObject<{
|
|
5
6
|
uuid: z.ZodString;
|
|
6
7
|
title: z.ZodString;
|
|
7
8
|
description: z.ZodString;
|
|
8
9
|
icon: z.ZodString;
|
|
9
10
|
price: z.ZodNumber;
|
|
11
|
+
freeMaxPromptLength: z.ZodNullable<z.ZodNumber>;
|
|
12
|
+
maxPromptLength: z.ZodNullable<z.ZodNumber>;
|
|
10
13
|
order: z.ZodNumber;
|
|
11
14
|
status: z.ZodEnum<typeof import("../../..").TOOL_MODEL_STATUS>;
|
|
12
15
|
canUse: z.ZodBoolean;
|
|
@@ -5,5 +5,6 @@ const zod_1 = require("zod");
|
|
|
5
5
|
const spell_corrector_model_schema_1 = require("./spell-corrector-model.schema");
|
|
6
6
|
exports.SpellCorrectorToolConfigSchema = zod_1.z.object({
|
|
7
7
|
maxSymbols: zod_1.z.number(),
|
|
8
|
+
freeMaxSymbols: zod_1.z.number(),
|
|
8
9
|
models: zod_1.z.array(spell_corrector_model_schema_1.SpellCorrectorModelSchema),
|
|
9
10
|
});
|
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { USER_REACTION } from '../../../constants';
|
|
2
|
+
import { SPELL_CORRECTOR_INPUT_KIND, USER_REACTION } from '../../../constants';
|
|
3
|
+
export declare const SpellCorrectorCorrectionStatisticsSchema: z.ZodObject<{
|
|
4
|
+
total: z.ZodNumber;
|
|
5
|
+
spelling: z.ZodNumber;
|
|
6
|
+
punctuation: z.ZodNumber;
|
|
7
|
+
}, z.core.$strip>;
|
|
8
|
+
export declare const SpellCorrectorDocumentMetadataSchema: z.ZodObject<{
|
|
9
|
+
uuid: z.ZodString;
|
|
10
|
+
url: z.ZodString;
|
|
11
|
+
name: z.ZodString;
|
|
12
|
+
mimeType: z.ZodString;
|
|
13
|
+
type: z.ZodString;
|
|
14
|
+
size: z.ZodNumber;
|
|
15
|
+
extension: z.ZodString;
|
|
16
|
+
}, z.core.$strip>;
|
|
3
17
|
export declare const SpellCorrectorToolJobSchema: z.ZodObject<{
|
|
4
18
|
uuid: z.ZodString;
|
|
5
19
|
status: z.ZodEnum<typeof import("../../..").TOOL_JOB_STATUS>;
|
|
@@ -8,6 +22,30 @@ export declare const SpellCorrectorToolJobSchema: z.ZodObject<{
|
|
|
8
22
|
createdAt: z.ZodDate;
|
|
9
23
|
updatedAt: z.ZodDate;
|
|
10
24
|
modelId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
25
|
+
inputKind: z.ZodDefault<z.ZodEnum<typeof SPELL_CORRECTOR_INPUT_KIND>>;
|
|
26
|
+
sourceDocument: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
27
|
+
uuid: z.ZodString;
|
|
28
|
+
url: z.ZodString;
|
|
29
|
+
name: z.ZodString;
|
|
30
|
+
mimeType: z.ZodString;
|
|
31
|
+
type: z.ZodString;
|
|
32
|
+
size: z.ZodNumber;
|
|
33
|
+
extension: z.ZodString;
|
|
34
|
+
}, z.core.$strip>>>;
|
|
35
|
+
statistics: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
36
|
+
total: z.ZodNumber;
|
|
37
|
+
spelling: z.ZodNumber;
|
|
38
|
+
punctuation: z.ZodNumber;
|
|
39
|
+
}, z.core.$strip>>>;
|
|
40
|
+
outputDocument: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
41
|
+
uuid: z.ZodString;
|
|
42
|
+
url: z.ZodString;
|
|
43
|
+
name: z.ZodString;
|
|
44
|
+
mimeType: z.ZodString;
|
|
45
|
+
type: z.ZodString;
|
|
46
|
+
size: z.ZodNumber;
|
|
47
|
+
extension: z.ZodString;
|
|
48
|
+
}, z.core.$strip>>>;
|
|
11
49
|
userInput: z.ZodString;
|
|
12
50
|
aiOutput: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
13
51
|
title: z.ZodString;
|
|
@@ -1,11 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SpellCorrectorToolJobSchema = void 0;
|
|
3
|
+
exports.SpellCorrectorToolJobSchema = exports.SpellCorrectorDocumentMetadataSchema = exports.SpellCorrectorCorrectionStatisticsSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const tool_job_schema_1 = require("../../tool-job.schema");
|
|
6
6
|
const constants_1 = require("../../../constants");
|
|
7
|
+
exports.SpellCorrectorCorrectionStatisticsSchema = zod_1.z
|
|
8
|
+
.object({
|
|
9
|
+
total: zod_1.z.number().int().nonnegative(),
|
|
10
|
+
spelling: zod_1.z.number().int().nonnegative(),
|
|
11
|
+
punctuation: zod_1.z.number().int().nonnegative(),
|
|
12
|
+
})
|
|
13
|
+
.refine((statistics) => statistics.total === statistics.spelling + statistics.punctuation, {
|
|
14
|
+
message: 'total must equal spelling + punctuation',
|
|
15
|
+
});
|
|
16
|
+
exports.SpellCorrectorDocumentMetadataSchema = zod_1.z.object({
|
|
17
|
+
uuid: zod_1.z.string().uuid(),
|
|
18
|
+
url: zod_1.z.string(),
|
|
19
|
+
name: zod_1.z.string(),
|
|
20
|
+
mimeType: zod_1.z.string(),
|
|
21
|
+
type: zod_1.z.string(),
|
|
22
|
+
size: zod_1.z.number().nonnegative(),
|
|
23
|
+
extension: zod_1.z.string(),
|
|
24
|
+
});
|
|
7
25
|
exports.SpellCorrectorToolJobSchema = tool_job_schema_1.ToolJobSchema.extend({
|
|
8
26
|
modelId: zod_1.z.string().uuid().nullable().optional(),
|
|
27
|
+
inputKind: zod_1.z.nativeEnum(constants_1.SPELL_CORRECTOR_INPUT_KIND).default(constants_1.SPELL_CORRECTOR_INPUT_KIND.TEXT),
|
|
28
|
+
sourceDocument: exports.SpellCorrectorDocumentMetadataSchema.nullable().default(null),
|
|
29
|
+
statistics: exports.SpellCorrectorCorrectionStatisticsSchema.nullable().default(null),
|
|
30
|
+
outputDocument: exports.SpellCorrectorDocumentMetadataSchema.nullable().default(null),
|
|
9
31
|
userInput: zod_1.z.string(),
|
|
10
32
|
aiOutput: zod_1.z.string().nullable().optional(),
|
|
11
33
|
title: zod_1.z.string(),
|
|
@@ -6,6 +6,8 @@ export declare const SpellCorrectorModelSchema: z.ZodObject<{
|
|
|
6
6
|
description: z.ZodString;
|
|
7
7
|
icon: z.ZodString;
|
|
8
8
|
price: z.ZodNumber;
|
|
9
|
+
freeMaxPromptLength: z.ZodNullable<z.ZodNumber>;
|
|
10
|
+
maxPromptLength: z.ZodNullable<z.ZodNumber>;
|
|
9
11
|
order: z.ZodNumber;
|
|
10
12
|
status: z.ZodEnum<typeof TOOL_MODEL_STATUS>;
|
|
11
13
|
canUse: z.ZodBoolean;
|
|
@@ -11,6 +11,8 @@ exports.SpellCorrectorModelSchema = zod_1.z.object({
|
|
|
11
11
|
description: zod_1.z.string(),
|
|
12
12
|
icon: zod_1.z.string(),
|
|
13
13
|
price: zod_1.z.number(),
|
|
14
|
+
freeMaxPromptLength: zod_1.z.number().nullable(),
|
|
15
|
+
maxPromptLength: zod_1.z.number().nullable(),
|
|
14
16
|
order: zod_1.z.number(),
|
|
15
17
|
status: zod_1.z.nativeEnum(constants_1.TOOL_MODEL_STATUS),
|
|
16
18
|
canUse: zod_1.z.boolean(),
|