@purpleschool/gptbot 0.13.6 → 0.13.8
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/agents/agent.ts +1 -0
- package/build/api/controllers/http/agents/agent.js +1 -0
- package/build/commands/agents/agent-template/create-agent-template.command.js +5 -1
- package/build/commands/agents/agent-template/update-agent-template.command.js +5 -1
- package/build/commands/agents/agents/create-agent.command.js +3 -2
- package/build/commands/agents/agents/get-agent-aggregate.command.js +22 -0
- package/build/commands/agents/agents/get-agent-public-info.command.js +2 -1
- package/build/commands/agents/agents/index.js +1 -0
- package/build/commands/agents/agents/update-agent.command.js +2 -1
- package/build/models/agents/agent-aggregate.schema.js +25 -0
- package/build/models/agents/agent-channel.schema.js +0 -2
- package/build/models/agents/agent-template.schema.js +5 -1
- package/build/models/agents/agent-tool.schema.js +0 -2
- package/build/models/agents/agent.schema.js +2 -1
- package/build/models/agents/index.js +1 -0
- package/commands/agents/agent-template/create-agent-template.command.ts +5 -1
- package/commands/agents/agent-template/update-agent-template.command.ts +5 -1
- package/commands/agents/agents/create-agent.command.ts +3 -2
- package/commands/agents/agents/get-agent-aggregate.command.ts +24 -0
- package/commands/agents/agents/get-agent-public-info.command.ts +2 -1
- package/commands/agents/agents/index.ts +1 -0
- package/commands/agents/agents/update-agent.command.ts +2 -1
- package/models/agents/agent-aggregate.schema.ts +28 -0
- package/models/agents/agent-channel.schema.ts +0 -2
- package/models/agents/agent-template.schema.ts +5 -1
- package/models/agents/agent-tool.schema.ts +0 -2
- package/models/agents/agent.schema.ts +2 -1
- package/models/agents/index.ts +1 -0
- package/models/icon-variants.schema.ts +4 -0
- package/package.json +1 -1
|
@@ -5,6 +5,7 @@ export const AGENT_ROUTES = {
|
|
|
5
5
|
LIST: '',
|
|
6
6
|
CREATE: '',
|
|
7
7
|
GET_BY_ID: (id: string) => `${id}`,
|
|
8
|
+
GET_AGGREGATE: (id: string) => `${id}/aggregate`,
|
|
8
9
|
UPDATE: (id: string) => `${id}`,
|
|
9
10
|
DELETE: (id: string) => `${id}`,
|
|
10
11
|
CABINET_START_DIALOG: (agentId: string) => `${agentId}/dialogs/cabinet/start`,
|
|
@@ -4,15 +4,19 @@ exports.CreateAgentTemplateCommand = void 0;
|
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const agent_interaction_mode_enum_1 = require("../../../constants/agents/enums/agent-interaction-mode.enum");
|
|
6
6
|
const agent_template_schema_1 = require("../../../models/agents/agent-template.schema");
|
|
7
|
+
const icon_variants_schema_1 = require("../../../models/icon-variants.schema");
|
|
7
8
|
var CreateAgentTemplateCommand;
|
|
8
9
|
(function (CreateAgentTemplateCommand) {
|
|
9
10
|
CreateAgentTemplateCommand.RequestBodySchema = zod_1.z.object({
|
|
10
11
|
categoryId: zod_1.z.string().uuid(),
|
|
11
12
|
name: zod_1.z.string(),
|
|
12
13
|
description: zod_1.z.string(),
|
|
13
|
-
|
|
14
|
+
icons: icon_variants_schema_1.IconVariantsSchema.optional(),
|
|
15
|
+
altIcons: icon_variants_schema_1.IconVariantsSchema.optional(),
|
|
14
16
|
systemPrompt: zod_1.z.string().nullable().optional(),
|
|
15
17
|
interactionMode: zod_1.z.nativeEnum(agent_interaction_mode_enum_1.AGENT_INTERACTION_MODE).optional(),
|
|
18
|
+
isHumanHelp: zod_1.z.boolean().optional(),
|
|
19
|
+
useDocuments: zod_1.z.boolean().optional(),
|
|
16
20
|
order: zod_1.z.number().optional(),
|
|
17
21
|
});
|
|
18
22
|
CreateAgentTemplateCommand.ResponseSchema = zod_1.z.object({
|
|
@@ -4,6 +4,7 @@ exports.UpdateAgentTemplateCommand = void 0;
|
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const agent_interaction_mode_enum_1 = require("../../../constants/agents/enums/agent-interaction-mode.enum");
|
|
6
6
|
const agent_template_schema_1 = require("../../../models/agents/agent-template.schema");
|
|
7
|
+
const icon_variants_schema_1 = require("../../../models/icon-variants.schema");
|
|
7
8
|
var UpdateAgentTemplateCommand;
|
|
8
9
|
(function (UpdateAgentTemplateCommand) {
|
|
9
10
|
UpdateAgentTemplateCommand.RequestParamsSchema = zod_1.z.object({
|
|
@@ -13,9 +14,12 @@ var UpdateAgentTemplateCommand;
|
|
|
13
14
|
categoryId: zod_1.z.string().uuid().optional(),
|
|
14
15
|
name: zod_1.z.string().optional(),
|
|
15
16
|
description: zod_1.z.string().optional(),
|
|
16
|
-
|
|
17
|
+
icons: icon_variants_schema_1.IconVariantsSchema.optional(),
|
|
18
|
+
altIcons: icon_variants_schema_1.IconVariantsSchema.optional(),
|
|
17
19
|
systemPrompt: zod_1.z.string().nullable().optional(),
|
|
18
20
|
interactionMode: zod_1.z.nativeEnum(agent_interaction_mode_enum_1.AGENT_INTERACTION_MODE).optional(),
|
|
21
|
+
isHumanHelp: zod_1.z.boolean().optional(),
|
|
22
|
+
useDocuments: zod_1.z.boolean().optional(),
|
|
19
23
|
order: zod_1.z.number().optional(),
|
|
20
24
|
isActive: zod_1.z.boolean().optional(),
|
|
21
25
|
});
|
|
@@ -4,12 +4,13 @@ exports.CreateAgentCommand = void 0;
|
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const agent_interaction_mode_enum_1 = require("../../../constants/agents/enums/agent-interaction-mode.enum");
|
|
6
6
|
const agent_schema_1 = require("../../../models/agents/agent.schema");
|
|
7
|
+
const icon_variants_schema_1 = require("../../../models/icon-variants.schema");
|
|
7
8
|
var CreateAgentCommand;
|
|
8
9
|
(function (CreateAgentCommand) {
|
|
9
10
|
CreateAgentCommand.RequestBodySchema = zod_1.z.object({
|
|
10
|
-
templateId: zod_1.z.string().uuid()
|
|
11
|
+
templateId: zod_1.z.string().uuid(),
|
|
11
12
|
name: zod_1.z.string(),
|
|
12
|
-
|
|
13
|
+
icons: icon_variants_schema_1.IconVariantsSchema.optional(),
|
|
13
14
|
avatar: zod_1.z.string().nullable().optional(),
|
|
14
15
|
greetingPhrase: zod_1.z.string().nullable().optional(),
|
|
15
16
|
instructions: zod_1.z.string().nullable().optional(),
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetAgentAggregateCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const agent_aggregate_schema_1 = require("../../../models/agents/agent-aggregate.schema");
|
|
6
|
+
const rugpt_lib_common_1 = require("@purpleschool/rugpt-lib-common");
|
|
7
|
+
var GetAgentAggregateCommand;
|
|
8
|
+
(function (GetAgentAggregateCommand) {
|
|
9
|
+
GetAgentAggregateCommand.RequestParamsSchema = zod_1.z.object({
|
|
10
|
+
id: zod_1.z.string().uuid(),
|
|
11
|
+
});
|
|
12
|
+
GetAgentAggregateCommand.RequestSchema = zod_1.z.object({
|
|
13
|
+
id: zod_1.z.string().uuid(),
|
|
14
|
+
userId: zod_1.z.string().uuid(),
|
|
15
|
+
teamAccountId: zod_1.z.string().uuid(),
|
|
16
|
+
teamMemberRole: zod_1.z.string(),
|
|
17
|
+
locale: zod_1.z.nativeEnum(rugpt_lib_common_1.LOCALE),
|
|
18
|
+
});
|
|
19
|
+
GetAgentAggregateCommand.ResponseSchema = zod_1.z.object({
|
|
20
|
+
data: agent_aggregate_schema_1.AgentAggregateSchema,
|
|
21
|
+
});
|
|
22
|
+
})(GetAgentAggregateCommand || (exports.GetAgentAggregateCommand = GetAgentAggregateCommand = {}));
|
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.GetAgentPublicInfoCommand = exports.AgentPublicInfoSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
+
const icon_variants_schema_1 = require("../../../models/icon-variants.schema");
|
|
5
6
|
exports.AgentPublicInfoSchema = zod_1.z.object({
|
|
6
7
|
greetingPhrase: zod_1.z.string().nullable(),
|
|
7
8
|
activity: zod_1.z.boolean(),
|
|
8
|
-
|
|
9
|
+
icons: icon_variants_schema_1.IconVariantsSchema,
|
|
9
10
|
avatar: zod_1.z.string().nullable(),
|
|
10
11
|
});
|
|
11
12
|
var GetAgentPublicInfoCommand;
|
|
@@ -19,4 +19,5 @@ __exportStar(require("./delete-agent.command"), exports);
|
|
|
19
19
|
__exportStar(require("./find-agents.command"), exports);
|
|
20
20
|
__exportStar(require("./get-agent-by-id.command"), exports);
|
|
21
21
|
__exportStar(require("./get-agent-public-info.command"), exports);
|
|
22
|
+
__exportStar(require("./get-agent-aggregate.command"), exports);
|
|
22
23
|
__exportStar(require("./update-agent.command"), exports);
|
|
@@ -5,6 +5,7 @@ const zod_1 = require("zod");
|
|
|
5
5
|
const agent_interaction_mode_enum_1 = require("../../../constants/agents/enums/agent-interaction-mode.enum");
|
|
6
6
|
const agent_status_enum_1 = require("../../../constants/agents/enums/agent-status.enum");
|
|
7
7
|
const agent_schema_1 = require("../../../models/agents/agent.schema");
|
|
8
|
+
const icon_variants_schema_1 = require("../../../models/icon-variants.schema");
|
|
8
9
|
var UpdateAgentCommand;
|
|
9
10
|
(function (UpdateAgentCommand) {
|
|
10
11
|
UpdateAgentCommand.RequestParamsSchema = zod_1.z.object({
|
|
@@ -14,7 +15,7 @@ var UpdateAgentCommand;
|
|
|
14
15
|
templateId: zod_1.z.string().uuid().nullable().optional(),
|
|
15
16
|
name: zod_1.z.string().optional(),
|
|
16
17
|
description: zod_1.z.string().optional(),
|
|
17
|
-
|
|
18
|
+
icons: icon_variants_schema_1.IconVariantsSchema.optional(),
|
|
18
19
|
avatar: zod_1.z.string().nullable().optional(),
|
|
19
20
|
greetingPhrase: zod_1.z.string().nullable().optional(),
|
|
20
21
|
instructions: zod_1.z.string().nullable().optional(),
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AgentAggregateSchema = exports.AgentTemplateWithRelationsSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const agent_schema_1 = require("./agent.schema");
|
|
6
|
+
const agent_template_schema_1 = require("./agent-template.schema");
|
|
7
|
+
const agent_template_category_schema_1 = require("./agent-template-category.schema");
|
|
8
|
+
const agent_template_instruction_schema_1 = require("./agent-template-instruction.schema");
|
|
9
|
+
const agent_lead_form_schema_1 = require("./agent-lead-form.schema");
|
|
10
|
+
const agent_document_schema_1 = require("./agent-document.schema");
|
|
11
|
+
const agent_channel_schema_1 = require("./agent-channel.schema");
|
|
12
|
+
const agent_tool_schema_1 = require("./agent-tool.schema");
|
|
13
|
+
const agent_ai_model_schema_1 = require("./agent-ai-model.schema");
|
|
14
|
+
exports.AgentTemplateWithRelationsSchema = agent_template_schema_1.AgentTemplateSchema.extend({
|
|
15
|
+
category: agent_template_category_schema_1.AgentTemplateCategorySchema,
|
|
16
|
+
instructions: zod_1.z.array(agent_template_instruction_schema_1.AgentTemplateInstructionSchema),
|
|
17
|
+
});
|
|
18
|
+
exports.AgentAggregateSchema = agent_schema_1.AgentSchema.extend({
|
|
19
|
+
aiModel: agent_ai_model_schema_1.AgentAiModelSchema.nullable(),
|
|
20
|
+
template: exports.AgentTemplateWithRelationsSchema.nullable(),
|
|
21
|
+
leadForm: agent_lead_form_schema_1.AgentLeadFormSchema.nullable(),
|
|
22
|
+
documents: zod_1.z.array(agent_document_schema_1.AgentDocumentSchema),
|
|
23
|
+
channels: zod_1.z.array(agent_channel_schema_1.AgentChannelSchema),
|
|
24
|
+
tools: zod_1.z.array(agent_tool_schema_1.AgentToolSchema),
|
|
25
|
+
});
|
|
@@ -3,13 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.AgentChannelSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const enums_1 = require("../../constants/agents/enums");
|
|
6
|
-
const agent_channel_credentials_schema_1 = require("./agent-channel-credentials.schema");
|
|
7
6
|
exports.AgentChannelSchema = zod_1.z.object({
|
|
8
7
|
id: zod_1.z.string().uuid(),
|
|
9
8
|
agentId: zod_1.z.string().uuid(),
|
|
10
9
|
channelType: zod_1.z.nativeEnum(enums_1.AGENT_CHANNEL_TYPE),
|
|
11
10
|
status: zod_1.z.nativeEnum(enums_1.AGENT_CHANNEL_STATUS),
|
|
12
|
-
credentials: agent_channel_credentials_schema_1.AgentChannelCredentialsSchema,
|
|
13
11
|
lastCheckedAt: zod_1.z.date().nullable(),
|
|
14
12
|
lastError: zod_1.z.string().nullable(),
|
|
15
13
|
createdAt: zod_1.z.date(),
|
|
@@ -3,14 +3,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.AgentTemplateSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const agent_interaction_mode_enum_1 = require("../../constants/agents/enums/agent-interaction-mode.enum");
|
|
6
|
+
const icon_variants_schema_1 = require("../icon-variants.schema");
|
|
6
7
|
exports.AgentTemplateSchema = zod_1.z.object({
|
|
7
8
|
id: zod_1.z.string().uuid(),
|
|
8
9
|
categoryId: zod_1.z.string().uuid(),
|
|
9
10
|
name: zod_1.z.string(),
|
|
10
11
|
description: zod_1.z.string(),
|
|
11
|
-
|
|
12
|
+
icons: icon_variants_schema_1.IconVariantsSchema,
|
|
13
|
+
altIcons: icon_variants_schema_1.IconVariantsSchema.optional(),
|
|
12
14
|
systemPrompt: zod_1.z.string().nullable(),
|
|
13
15
|
interactionMode: zod_1.z.nativeEnum(agent_interaction_mode_enum_1.AGENT_INTERACTION_MODE),
|
|
16
|
+
isHumanHelp: zod_1.z.boolean(),
|
|
17
|
+
useDocuments: zod_1.z.boolean(),
|
|
14
18
|
order: zod_1.z.number(),
|
|
15
19
|
isActive: zod_1.z.boolean(),
|
|
16
20
|
createdAt: zod_1.z.date(),
|
|
@@ -3,13 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.AgentToolSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const enums_1 = require("../../constants/agents/enums");
|
|
6
|
-
const agent_tool_credentials_schema_1 = require("./agent-tool-credentials.schema");
|
|
7
6
|
exports.AgentToolSchema = zod_1.z.object({
|
|
8
7
|
id: zod_1.z.string().uuid(),
|
|
9
8
|
agentId: zod_1.z.string().uuid(),
|
|
10
9
|
toolType: zod_1.z.nativeEnum(enums_1.AGENT_TOOL_TYPE),
|
|
11
10
|
status: zod_1.z.nativeEnum(enums_1.AGENT_TOOL_STATUS),
|
|
12
|
-
credentials: agent_tool_credentials_schema_1.AgentToolCredentialsSchema,
|
|
13
11
|
createdAt: zod_1.z.date(),
|
|
14
12
|
updatedAt: zod_1.z.date(),
|
|
15
13
|
});
|
|
@@ -4,13 +4,14 @@ exports.AgentSchema = void 0;
|
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const agent_interaction_mode_enum_1 = require("../../constants/agents/enums/agent-interaction-mode.enum");
|
|
6
6
|
const agent_status_enum_1 = require("../../constants/agents/enums/agent-status.enum");
|
|
7
|
+
const icon_variants_schema_1 = require("../icon-variants.schema");
|
|
7
8
|
exports.AgentSchema = zod_1.z.object({
|
|
8
9
|
id: zod_1.z.string().uuid(),
|
|
9
10
|
teamAccountId: zod_1.z.string().uuid(),
|
|
10
11
|
templateId: zod_1.z.string().uuid().nullable(),
|
|
11
12
|
name: zod_1.z.string(),
|
|
12
13
|
description: zod_1.z.string(),
|
|
13
|
-
|
|
14
|
+
icons: icon_variants_schema_1.IconVariantsSchema,
|
|
14
15
|
avatar: zod_1.z.string().nullable(),
|
|
15
16
|
greetingPhrase: zod_1.z.string().nullable(),
|
|
16
17
|
instructions: zod_1.z.string().nullable(),
|
|
@@ -38,4 +38,5 @@ __exportStar(require("./agent-document-find-result.schema"), exports);
|
|
|
38
38
|
__exportStar(require("./agent-document-chunk.schema"), exports);
|
|
39
39
|
__exportStar(require("./agent-document-search-result.schema"), exports);
|
|
40
40
|
__exportStar(require("./agent.schema"), exports);
|
|
41
|
+
__exportStar(require("./agent-aggregate.schema"), exports);
|
|
41
42
|
__exportStar(require("./channel.schema"), exports);
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { AGENT_INTERACTION_MODE } from '../../../constants/agents/enums/agent-interaction-mode.enum';
|
|
3
3
|
import { AgentTemplateSchema } from '../../../models/agents/agent-template.schema';
|
|
4
|
+
import { IconVariantsSchema } from '../../../models/icon-variants.schema';
|
|
4
5
|
|
|
5
6
|
export namespace CreateAgentTemplateCommand {
|
|
6
7
|
export const RequestBodySchema = z.object({
|
|
7
8
|
categoryId: z.string().uuid(),
|
|
8
9
|
name: z.string(),
|
|
9
10
|
description: z.string(),
|
|
10
|
-
|
|
11
|
+
icons: IconVariantsSchema.optional(),
|
|
12
|
+
altIcons: IconVariantsSchema.optional(),
|
|
11
13
|
systemPrompt: z.string().nullable().optional(),
|
|
12
14
|
interactionMode: z.nativeEnum(AGENT_INTERACTION_MODE).optional(),
|
|
15
|
+
isHumanHelp: z.boolean().optional(),
|
|
16
|
+
useDocuments: z.boolean().optional(),
|
|
13
17
|
order: z.number().optional(),
|
|
14
18
|
});
|
|
15
19
|
export type RequestBody = z.infer<typeof RequestBodySchema>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { AGENT_INTERACTION_MODE } from '../../../constants/agents/enums/agent-interaction-mode.enum';
|
|
3
3
|
import { AgentTemplateSchema } from '../../../models/agents/agent-template.schema';
|
|
4
|
+
import { IconVariantsSchema } from '../../../models/icon-variants.schema';
|
|
4
5
|
|
|
5
6
|
export namespace UpdateAgentTemplateCommand {
|
|
6
7
|
export const RequestParamsSchema = z.object({
|
|
@@ -12,9 +13,12 @@ export namespace UpdateAgentTemplateCommand {
|
|
|
12
13
|
categoryId: z.string().uuid().optional(),
|
|
13
14
|
name: z.string().optional(),
|
|
14
15
|
description: z.string().optional(),
|
|
15
|
-
|
|
16
|
+
icons: IconVariantsSchema.optional(),
|
|
17
|
+
altIcons: IconVariantsSchema.optional(),
|
|
16
18
|
systemPrompt: z.string().nullable().optional(),
|
|
17
19
|
interactionMode: z.nativeEnum(AGENT_INTERACTION_MODE).optional(),
|
|
20
|
+
isHumanHelp: z.boolean().optional(),
|
|
21
|
+
useDocuments: z.boolean().optional(),
|
|
18
22
|
order: z.number().optional(),
|
|
19
23
|
isActive: z.boolean().optional(),
|
|
20
24
|
});
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { AGENT_INTERACTION_MODE } from '../../../constants/agents/enums/agent-interaction-mode.enum';
|
|
3
3
|
import { AgentSchema } from '../../../models/agents/agent.schema';
|
|
4
|
+
import { IconVariantsSchema } from '../../../models/icon-variants.schema';
|
|
4
5
|
|
|
5
6
|
export namespace CreateAgentCommand {
|
|
6
7
|
export const RequestBodySchema = z.object({
|
|
7
|
-
templateId: z.string().uuid()
|
|
8
|
+
templateId: z.string().uuid(),
|
|
8
9
|
name: z.string(),
|
|
9
|
-
|
|
10
|
+
icons: IconVariantsSchema.optional(),
|
|
10
11
|
avatar: z.string().nullable().optional(),
|
|
11
12
|
greetingPhrase: z.string().nullable().optional(),
|
|
12
13
|
instructions: z.string().nullable().optional(),
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { AgentAggregateSchema } from '../../../models/agents/agent-aggregate.schema';
|
|
3
|
+
import { LOCALE } from '@purpleschool/rugpt-lib-common';
|
|
4
|
+
|
|
5
|
+
export namespace GetAgentAggregateCommand {
|
|
6
|
+
export const RequestParamsSchema = z.object({
|
|
7
|
+
id: z.string().uuid(),
|
|
8
|
+
});
|
|
9
|
+
export type RequestParams = z.infer<typeof RequestParamsSchema>;
|
|
10
|
+
|
|
11
|
+
export const RequestSchema = z.object({
|
|
12
|
+
id: z.string().uuid(),
|
|
13
|
+
userId: z.string().uuid(),
|
|
14
|
+
teamAccountId: z.string().uuid(),
|
|
15
|
+
teamMemberRole: z.string(),
|
|
16
|
+
locale: z.nativeEnum(LOCALE),
|
|
17
|
+
});
|
|
18
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
19
|
+
|
|
20
|
+
export const ResponseSchema = z.object({
|
|
21
|
+
data: AgentAggregateSchema,
|
|
22
|
+
});
|
|
23
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
24
|
+
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { IconVariantsSchema } from '../../../models/icon-variants.schema';
|
|
2
3
|
|
|
3
4
|
export const AgentPublicInfoSchema = z.object({
|
|
4
5
|
greetingPhrase: z.string().nullable(),
|
|
5
6
|
activity: z.boolean(),
|
|
6
|
-
|
|
7
|
+
icons: IconVariantsSchema,
|
|
7
8
|
avatar: z.string().nullable(),
|
|
8
9
|
});
|
|
9
10
|
|
|
@@ -2,6 +2,7 @@ import { z } from 'zod';
|
|
|
2
2
|
import { AGENT_INTERACTION_MODE } from '../../../constants/agents/enums/agent-interaction-mode.enum';
|
|
3
3
|
import { AGENT_STATUS } from '../../../constants/agents/enums/agent-status.enum';
|
|
4
4
|
import { AgentSchema } from '../../../models/agents/agent.schema';
|
|
5
|
+
import { IconVariantsSchema } from '../../../models/icon-variants.schema';
|
|
5
6
|
|
|
6
7
|
export namespace UpdateAgentCommand {
|
|
7
8
|
export const RequestParamsSchema = z.object({
|
|
@@ -13,7 +14,7 @@ export namespace UpdateAgentCommand {
|
|
|
13
14
|
templateId: z.string().uuid().nullable().optional(),
|
|
14
15
|
name: z.string().optional(),
|
|
15
16
|
description: z.string().optional(),
|
|
16
|
-
|
|
17
|
+
icons: IconVariantsSchema.optional(),
|
|
17
18
|
avatar: z.string().nullable().optional(),
|
|
18
19
|
greetingPhrase: z.string().nullable().optional(),
|
|
19
20
|
instructions: z.string().nullable().optional(),
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { AgentSchema } from './agent.schema';
|
|
3
|
+
import { AgentTemplateSchema } from './agent-template.schema';
|
|
4
|
+
import { AgentTemplateCategorySchema } from './agent-template-category.schema';
|
|
5
|
+
import { AgentTemplateInstructionSchema } from './agent-template-instruction.schema';
|
|
6
|
+
import { AgentLeadFormSchema } from './agent-lead-form.schema';
|
|
7
|
+
import { AgentDocumentSchema } from './agent-document.schema';
|
|
8
|
+
import { AgentChannelSchema } from './agent-channel.schema';
|
|
9
|
+
import { AgentToolSchema } from './agent-tool.schema';
|
|
10
|
+
import { AgentAiModelSchema } from './agent-ai-model.schema';
|
|
11
|
+
|
|
12
|
+
export const AgentTemplateWithRelationsSchema = AgentTemplateSchema.extend({
|
|
13
|
+
category: AgentTemplateCategorySchema,
|
|
14
|
+
instructions: z.array(AgentTemplateInstructionSchema),
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export type AgentTemplateWithRelations = z.infer<typeof AgentTemplateWithRelationsSchema>;
|
|
18
|
+
|
|
19
|
+
export const AgentAggregateSchema = AgentSchema.extend({
|
|
20
|
+
aiModel: AgentAiModelSchema.nullable(),
|
|
21
|
+
template: AgentTemplateWithRelationsSchema.nullable(),
|
|
22
|
+
leadForm: AgentLeadFormSchema.nullable(),
|
|
23
|
+
documents: z.array(AgentDocumentSchema),
|
|
24
|
+
channels: z.array(AgentChannelSchema),
|
|
25
|
+
tools: z.array(AgentToolSchema),
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
export type AgentAggregate = z.infer<typeof AgentAggregateSchema>;
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { AGENT_CHANNEL_STATUS, AGENT_CHANNEL_TYPE } from '../../constants/agents/enums';
|
|
3
|
-
import { AgentChannelCredentialsSchema } from './agent-channel-credentials.schema';
|
|
4
3
|
|
|
5
4
|
export const AgentChannelSchema = z.object({
|
|
6
5
|
id: z.string().uuid(),
|
|
7
6
|
agentId: z.string().uuid(),
|
|
8
7
|
channelType: z.nativeEnum(AGENT_CHANNEL_TYPE),
|
|
9
8
|
status: z.nativeEnum(AGENT_CHANNEL_STATUS),
|
|
10
|
-
credentials: AgentChannelCredentialsSchema,
|
|
11
9
|
lastCheckedAt: z.date().nullable(),
|
|
12
10
|
lastError: z.string().nullable(),
|
|
13
11
|
createdAt: z.date(),
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { AGENT_INTERACTION_MODE } from '../../constants/agents/enums/agent-interaction-mode.enum';
|
|
3
|
+
import { IconVariantsSchema } from '../icon-variants.schema';
|
|
3
4
|
|
|
4
5
|
export const AgentTemplateSchema = z.object({
|
|
5
6
|
id: z.string().uuid(),
|
|
6
7
|
categoryId: z.string().uuid(),
|
|
7
8
|
name: z.string(),
|
|
8
9
|
description: z.string(),
|
|
9
|
-
|
|
10
|
+
icons: IconVariantsSchema,
|
|
11
|
+
altIcons: IconVariantsSchema.optional(),
|
|
10
12
|
systemPrompt: z.string().nullable(),
|
|
11
13
|
interactionMode: z.nativeEnum(AGENT_INTERACTION_MODE),
|
|
14
|
+
isHumanHelp: z.boolean(),
|
|
15
|
+
useDocuments: z.boolean(),
|
|
12
16
|
order: z.number(),
|
|
13
17
|
isActive: z.boolean(),
|
|
14
18
|
createdAt: z.date(),
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { AGENT_TOOL_STATUS, AGENT_TOOL_TYPE } from '../../constants/agents/enums';
|
|
3
|
-
import { AgentToolCredentialsSchema } from './agent-tool-credentials.schema';
|
|
4
3
|
|
|
5
4
|
export const AgentToolSchema = z.object({
|
|
6
5
|
id: z.string().uuid(),
|
|
7
6
|
agentId: z.string().uuid(),
|
|
8
7
|
toolType: z.nativeEnum(AGENT_TOOL_TYPE),
|
|
9
8
|
status: z.nativeEnum(AGENT_TOOL_STATUS),
|
|
10
|
-
credentials: AgentToolCredentialsSchema,
|
|
11
9
|
createdAt: z.date(),
|
|
12
10
|
updatedAt: z.date(),
|
|
13
11
|
});
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { AGENT_INTERACTION_MODE } from '../../constants/agents/enums/agent-interaction-mode.enum';
|
|
3
3
|
import { AGENT_STATUS } from '../../constants/agents/enums/agent-status.enum';
|
|
4
|
+
import { IconVariantsSchema } from '../icon-variants.schema';
|
|
4
5
|
|
|
5
6
|
export const AgentSchema = z.object({
|
|
6
7
|
id: z.string().uuid(),
|
|
@@ -8,7 +9,7 @@ export const AgentSchema = z.object({
|
|
|
8
9
|
templateId: z.string().uuid().nullable(),
|
|
9
10
|
name: z.string(),
|
|
10
11
|
description: z.string(),
|
|
11
|
-
|
|
12
|
+
icons: IconVariantsSchema,
|
|
12
13
|
avatar: z.string().nullable(),
|
|
13
14
|
greetingPhrase: z.string().nullable(),
|
|
14
15
|
instructions: z.string().nullable(),
|
package/models/agents/index.ts
CHANGED
|
@@ -22,4 +22,5 @@ export * from './agent-document-find-result.schema';
|
|
|
22
22
|
export * from './agent-document-chunk.schema';
|
|
23
23
|
export * from './agent-document-search-result.schema';
|
|
24
24
|
export * from './agent.schema';
|
|
25
|
+
export * from './agent-aggregate.schema';
|
|
25
26
|
export * from './channel.schema';
|
|
@@ -11,7 +11,11 @@ export const IconVariantsSchema = z.object({
|
|
|
11
11
|
}),
|
|
12
12
|
});
|
|
13
13
|
|
|
14
|
+
export type IconVariants = z.infer<typeof IconVariantsSchema>;
|
|
15
|
+
|
|
14
16
|
export const IconVariantCanvasSchema = z.object({
|
|
15
17
|
onPanel: IconVariantsSchema,
|
|
16
18
|
onCanvas: IconVariantsSchema,
|
|
17
19
|
});
|
|
20
|
+
|
|
21
|
+
export type IconVariantCanvas = z.infer<typeof IconVariantCanvasSchema>;
|