tychat-contracts 1.0.38 → 1.0.39
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/dist/ai/agent-response.dto.d.ts +1 -0
- package/dist/ai/agent-response.dto.d.ts.map +1 -1
- package/dist/ai/agent-response.dto.js +9 -0
- package/dist/ai/ai-integration-request.dto.d.ts +3 -2
- package/dist/ai/ai-integration-request.dto.d.ts.map +1 -1
- package/dist/ai/ai-integration-request.dto.js +15 -4
- package/dist/ai/create-agent.dto.d.ts +1 -0
- package/dist/ai/create-agent.dto.d.ts.map +1 -1
- package/dist/ai/create-agent.dto.js +10 -0
- package/dist/ai/index.d.ts +1 -0
- package/dist/ai/index.d.ts.map +1 -1
- package/dist/ai/index.js +1 -0
- package/dist/ai/list-models.dto.d.ts +10 -0
- package/dist/ai/list-models.dto.d.ts.map +1 -0
- package/dist/ai/list-models.dto.js +62 -0
- package/dist/ai/update-agent.dto.d.ts +1 -0
- package/dist/ai/update-agent.dto.d.ts.map +1 -1
- package/dist/ai/update-agent.dto.js +11 -0
- package/package.json +1 -1
- package/src/ai/agent-response.dto.ts +7 -0
- package/src/ai/ai-integration-request.dto.ts +12 -3
- package/src/ai/create-agent.dto.ts +19 -1
- package/src/ai/index.ts +1 -0
- package/src/ai/list-models.dto.ts +41 -0
- package/src/ai/update-agent.dto.ts +10 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-response.dto.d.ts","sourceRoot":"","sources":["../../src/ai/agent-response.dto.ts"],"names":[],"mappings":"AAEA,OAAO,EAAmB,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAE/E,qBAAa,gBAAgB;IAM3B,EAAE,EAAE,MAAM,CAAC;IAQX,MAAM,EAAE,MAAM,CAAC;IAQf,WAAW,EAAE,gBAAgB,CAAC;IAO9B,KAAK,EAAE,MAAM,CAAC;IAOd,YAAY,EAAE,MAAM,CAAC;IAOrB,WAAW,EAAE,MAAM,CAAC;IAOpB,MAAM,EAAE,OAAO,CAAC;IAQhB,YAAY,CAAC,EAAE,MAAM,CAAC;IAQtB,YAAY,CAAC,EAAE,MAAM,CAAC;IAOtB,SAAS,EAAE,MAAM,CAAC;IAOlB,SAAS,EAAE,MAAM,CAAC;CACnB"}
|
|
1
|
+
{"version":3,"file":"agent-response.dto.d.ts","sourceRoot":"","sources":["../../src/ai/agent-response.dto.ts"],"names":[],"mappings":"AAEA,OAAO,EAAmB,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAE/E,qBAAa,gBAAgB;IAM3B,EAAE,EAAE,MAAM,CAAC;IAQX,MAAM,EAAE,MAAM,CAAC;IAOf,MAAM,EAAE,MAAM,CAAC;IAQf,WAAW,EAAE,gBAAgB,CAAC;IAO9B,KAAK,EAAE,MAAM,CAAC;IAOd,YAAY,EAAE,MAAM,CAAC;IAOrB,WAAW,EAAE,MAAM,CAAC;IAOpB,MAAM,EAAE,OAAO,CAAC;IAQhB,YAAY,CAAC,EAAE,MAAM,CAAC;IAQtB,YAAY,CAAC,EAAE,MAAM,CAAC;IAOtB,SAAS,EAAE,MAAM,CAAC;IAOlB,SAAS,EAAE,MAAM,CAAC;CACnB"}
|
|
@@ -16,6 +16,7 @@ const integration_provider_dto_1 = require("./integration-provider.dto");
|
|
|
16
16
|
class AgentResponseDto {
|
|
17
17
|
id;
|
|
18
18
|
tenant;
|
|
19
|
+
unitId;
|
|
19
20
|
integration;
|
|
20
21
|
model;
|
|
21
22
|
systemPrompt;
|
|
@@ -44,6 +45,14 @@ __decorate([
|
|
|
44
45
|
(0, class_validator_1.IsNotEmpty)(),
|
|
45
46
|
__metadata("design:type", String)
|
|
46
47
|
], AgentResponseDto.prototype, "tenant", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, swagger_1.ApiProperty)({
|
|
50
|
+
description: 'Tenant unit id where this agent will be used',
|
|
51
|
+
example: 1,
|
|
52
|
+
}),
|
|
53
|
+
(0, class_validator_1.IsNumber)(),
|
|
54
|
+
__metadata("design:type", Number)
|
|
55
|
+
], AgentResponseDto.prototype, "unitId", void 0);
|
|
47
56
|
__decorate([
|
|
48
57
|
(0, swagger_1.ApiProperty)({
|
|
49
58
|
description: 'Integration provider used by the agent',
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export declare class AiIntegrationRequestDto {
|
|
2
2
|
tenant: string;
|
|
3
|
+
unitId?: number;
|
|
3
4
|
message: string;
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
is_document: boolean;
|
|
6
|
+
documents_url?: string[];
|
|
6
7
|
}
|
|
7
8
|
//# sourceMappingURL=ai-integration-request.dto.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-integration-request.dto.d.ts","sourceRoot":"","sources":["../../src/ai/ai-integration-request.dto.ts"],"names":[],"mappings":"AAGA,qBAAa,uBAAuB;IAOlC,MAAM,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"ai-integration-request.dto.d.ts","sourceRoot":"","sources":["../../src/ai/ai-integration-request.dto.ts"],"names":[],"mappings":"AAGA,qBAAa,uBAAuB;IAOlC,MAAM,EAAE,MAAM,CAAC;IASf,MAAM,CAAC,EAAE,MAAM,CAAC;IAQhB,OAAO,EAAE,MAAM,CAAC;IAOhB,WAAW,EAAE,OAAO,CAAC;IAUrB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;CAC1B"}
|
|
@@ -14,9 +14,10 @@ const swagger_1 = require("@nestjs/swagger");
|
|
|
14
14
|
const class_validator_1 = require("class-validator");
|
|
15
15
|
class AiIntegrationRequestDto {
|
|
16
16
|
tenant;
|
|
17
|
+
unitId;
|
|
17
18
|
message;
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
is_document;
|
|
20
|
+
documents_url;
|
|
20
21
|
}
|
|
21
22
|
exports.AiIntegrationRequestDto = AiIntegrationRequestDto;
|
|
22
23
|
__decorate([
|
|
@@ -28,6 +29,16 @@ __decorate([
|
|
|
28
29
|
(0, class_validator_1.IsNotEmpty)(),
|
|
29
30
|
__metadata("design:type", String)
|
|
30
31
|
], AiIntegrationRequestDto.prototype, "tenant", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
34
|
+
description: 'Tenant unit id used to select the active agent',
|
|
35
|
+
example: 1,
|
|
36
|
+
}),
|
|
37
|
+
(0, class_validator_1.IsOptional)(),
|
|
38
|
+
(0, class_validator_1.IsInt)(),
|
|
39
|
+
(0, class_validator_1.Min)(1),
|
|
40
|
+
__metadata("design:type", Number)
|
|
41
|
+
], AiIntegrationRequestDto.prototype, "unitId", void 0);
|
|
31
42
|
__decorate([
|
|
32
43
|
(0, swagger_1.ApiProperty)({
|
|
33
44
|
description: 'User message used as model input',
|
|
@@ -44,7 +55,7 @@ __decorate([
|
|
|
44
55
|
}),
|
|
45
56
|
(0, class_validator_1.IsBoolean)(),
|
|
46
57
|
__metadata("design:type", Boolean)
|
|
47
|
-
], AiIntegrationRequestDto.prototype, "
|
|
58
|
+
], AiIntegrationRequestDto.prototype, "is_document", void 0);
|
|
48
59
|
__decorate([
|
|
49
60
|
(0, swagger_1.ApiPropertyOptional)({
|
|
50
61
|
description: 'Document URLs used as additional context',
|
|
@@ -55,4 +66,4 @@ __decorate([
|
|
|
55
66
|
(0, class_validator_1.IsArray)(),
|
|
56
67
|
(0, class_validator_1.IsString)({ each: true }),
|
|
57
68
|
__metadata("design:type", Array)
|
|
58
|
-
], AiIntegrationRequestDto.prototype, "
|
|
69
|
+
], AiIntegrationRequestDto.prototype, "documents_url", void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-agent.dto.d.ts","sourceRoot":"","sources":["../../src/ai/create-agent.dto.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"create-agent.dto.d.ts","sourceRoot":"","sources":["../../src/ai/create-agent.dto.ts"],"names":[],"mappings":"AAYA,OAAO,EAAmB,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAE/E,qBAAa,cAAc;IAOzB,MAAM,EAAE,MAAM,CAAC;IAQf,MAAM,EAAE,MAAM,CAAC;IAQf,WAAW,EAAE,gBAAgB,CAAC;IAQ9B,KAAK,EAAE,MAAM,CAAC;IAQd,YAAY,EAAE,MAAM,CAAC;IAWrB,WAAW,EAAE,MAAM,CAAC;IAOpB,MAAM,EAAE,OAAO,CAAC;IAShB,YAAY,CAAC,EAAE,MAAM,CAAC;IAStB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB"}
|
|
@@ -15,6 +15,7 @@ const class_validator_1 = require("class-validator");
|
|
|
15
15
|
const integration_provider_dto_1 = require("./integration-provider.dto");
|
|
16
16
|
class CreateAgentDto {
|
|
17
17
|
tenant;
|
|
18
|
+
unitId;
|
|
18
19
|
integration;
|
|
19
20
|
model;
|
|
20
21
|
systemPrompt;
|
|
@@ -33,6 +34,15 @@ __decorate([
|
|
|
33
34
|
(0, class_validator_1.IsNotEmpty)(),
|
|
34
35
|
__metadata("design:type", String)
|
|
35
36
|
], CreateAgentDto.prototype, "tenant", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, swagger_1.ApiProperty)({
|
|
39
|
+
description: 'Tenant unit id where this agent will be used',
|
|
40
|
+
example: 1,
|
|
41
|
+
}),
|
|
42
|
+
(0, class_validator_1.IsInt)(),
|
|
43
|
+
(0, class_validator_1.Min)(1),
|
|
44
|
+
__metadata("design:type", Number)
|
|
45
|
+
], CreateAgentDto.prototype, "unitId", void 0);
|
|
36
46
|
__decorate([
|
|
37
47
|
(0, swagger_1.ApiProperty)({
|
|
38
48
|
description: 'Integration provider used by the agent',
|
package/dist/ai/index.d.ts
CHANGED
package/dist/ai/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ai/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,+BAA+B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ai/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,mBAAmB,CAAC"}
|
package/dist/ai/index.js
CHANGED
|
@@ -20,3 +20,4 @@ __exportStar(require("./update-agent.dto"), exports);
|
|
|
20
20
|
__exportStar(require("./agent-response.dto"), exports);
|
|
21
21
|
__exportStar(require("./ai-integration-request.dto"), exports);
|
|
22
22
|
__exportStar(require("./ai-integration-response.dto"), exports);
|
|
23
|
+
__exportStar(require("./list-models.dto"), exports);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AiIntegrationDto } from './integration-provider.dto';
|
|
2
|
+
export declare class ListAiModelsRequestDto {
|
|
3
|
+
integration: AiIntegrationDto;
|
|
4
|
+
apiKey?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare class ListAiModelsResponseDto {
|
|
7
|
+
integration: AiIntegrationDto;
|
|
8
|
+
models: string[];
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=list-models.dto.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-models.dto.d.ts","sourceRoot":"","sources":["../../src/ai/list-models.dto.ts"],"names":[],"mappings":"AAEA,OAAO,EAAmB,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAE/E,qBAAa,sBAAsB;IAOjC,WAAW,EAAE,gBAAgB,CAAC;IAS9B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,qBAAa,uBAAuB;IAOlC,WAAW,EAAE,gBAAgB,CAAC;IAS9B,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ListAiModelsResponseDto = exports.ListAiModelsRequestDto = void 0;
|
|
13
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
const integration_provider_dto_1 = require("./integration-provider.dto");
|
|
16
|
+
class ListAiModelsRequestDto {
|
|
17
|
+
integration;
|
|
18
|
+
apiKey;
|
|
19
|
+
}
|
|
20
|
+
exports.ListAiModelsRequestDto = ListAiModelsRequestDto;
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, swagger_1.ApiProperty)({
|
|
23
|
+
description: 'Integration provider to list available models',
|
|
24
|
+
enum: integration_provider_dto_1.AI_INTEGRATIONS,
|
|
25
|
+
example: 'OPENAI',
|
|
26
|
+
}),
|
|
27
|
+
(0, class_validator_1.IsEnum)(integration_provider_dto_1.AI_INTEGRATIONS),
|
|
28
|
+
__metadata("design:type", String)
|
|
29
|
+
], ListAiModelsRequestDto.prototype, "integration", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
32
|
+
description: 'Optional provider API key used to list models. Falls back to env key when omitted.',
|
|
33
|
+
example: 'sk-****',
|
|
34
|
+
}),
|
|
35
|
+
(0, class_validator_1.IsOptional)(),
|
|
36
|
+
(0, class_validator_1.IsString)(),
|
|
37
|
+
__metadata("design:type", String)
|
|
38
|
+
], ListAiModelsRequestDto.prototype, "apiKey", void 0);
|
|
39
|
+
class ListAiModelsResponseDto {
|
|
40
|
+
integration;
|
|
41
|
+
models;
|
|
42
|
+
}
|
|
43
|
+
exports.ListAiModelsResponseDto = ListAiModelsResponseDto;
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, swagger_1.ApiProperty)({
|
|
46
|
+
description: 'Integration provider',
|
|
47
|
+
enum: integration_provider_dto_1.AI_INTEGRATIONS,
|
|
48
|
+
example: 'GEMINI',
|
|
49
|
+
}),
|
|
50
|
+
(0, class_validator_1.IsEnum)(integration_provider_dto_1.AI_INTEGRATIONS),
|
|
51
|
+
__metadata("design:type", String)
|
|
52
|
+
], ListAiModelsResponseDto.prototype, "integration", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
(0, swagger_1.ApiProperty)({
|
|
55
|
+
description: 'Available model ids for the selected integration',
|
|
56
|
+
type: [String],
|
|
57
|
+
example: ['gpt-4.1-mini', 'gpt-4o-mini'],
|
|
58
|
+
}),
|
|
59
|
+
(0, class_validator_1.IsArray)(),
|
|
60
|
+
(0, class_validator_1.IsString)({ each: true }),
|
|
61
|
+
__metadata("design:type", Array)
|
|
62
|
+
], ListAiModelsResponseDto.prototype, "models", void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-agent.dto.d.ts","sourceRoot":"","sources":["../../src/ai/update-agent.dto.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"update-agent.dto.d.ts","sourceRoot":"","sources":["../../src/ai/update-agent.dto.ts"],"names":[],"mappings":"AAYA,OAAO,EAAmB,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAE/E,qBAAa,cAAc;IAQzB,MAAM,CAAC,EAAE,MAAM,CAAC;IAShB,WAAW,CAAC,EAAE,gBAAgB,CAAC;IAS/B,KAAK,CAAC,EAAE,MAAM,CAAC;IASf,YAAY,CAAC,EAAE,MAAM,CAAC;IAYtB,WAAW,CAAC,EAAE,MAAM,CAAC;IAQrB,MAAM,CAAC,EAAE,OAAO,CAAC;IASjB,YAAY,CAAC,EAAE,MAAM,CAAC;IAStB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB"}
|
|
@@ -14,6 +14,7 @@ const swagger_1 = require("@nestjs/swagger");
|
|
|
14
14
|
const class_validator_1 = require("class-validator");
|
|
15
15
|
const integration_provider_dto_1 = require("./integration-provider.dto");
|
|
16
16
|
class UpdateAgentDto {
|
|
17
|
+
unitId;
|
|
17
18
|
integration;
|
|
18
19
|
model;
|
|
19
20
|
systemPrompt;
|
|
@@ -23,6 +24,16 @@ class UpdateAgentDto {
|
|
|
23
24
|
geminiApiKey;
|
|
24
25
|
}
|
|
25
26
|
exports.UpdateAgentDto = UpdateAgentDto;
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
29
|
+
description: 'Tenant unit id where this agent will be used',
|
|
30
|
+
example: 1,
|
|
31
|
+
}),
|
|
32
|
+
(0, class_validator_1.IsOptional)(),
|
|
33
|
+
(0, class_validator_1.IsInt)(),
|
|
34
|
+
(0, class_validator_1.Min)(1),
|
|
35
|
+
__metadata("design:type", Number)
|
|
36
|
+
], UpdateAgentDto.prototype, "unitId", void 0);
|
|
26
37
|
__decorate([
|
|
27
38
|
(0, swagger_1.ApiPropertyOptional)({
|
|
28
39
|
description: 'Integration provider used by the agent',
|
package/package.json
CHANGED
|
@@ -18,6 +18,13 @@ export class AgentResponseDto {
|
|
|
18
18
|
@IsNotEmpty()
|
|
19
19
|
tenant: string;
|
|
20
20
|
|
|
21
|
+
@ApiProperty({
|
|
22
|
+
description: 'Tenant unit id where this agent will be used',
|
|
23
|
+
example: 1,
|
|
24
|
+
})
|
|
25
|
+
@IsNumber()
|
|
26
|
+
unitId: number;
|
|
27
|
+
|
|
21
28
|
@ApiProperty({
|
|
22
29
|
description: 'Integration provider used by the agent',
|
|
23
30
|
enum: AI_INTEGRATIONS,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
|
2
|
-
import { IsArray, IsBoolean, IsNotEmpty, IsOptional, IsString } from 'class-validator';
|
|
2
|
+
import { IsArray, IsBoolean, IsInt, IsNotEmpty, IsOptional, IsString, Min } from 'class-validator';
|
|
3
3
|
|
|
4
4
|
export class AiIntegrationRequestDto {
|
|
5
5
|
@ApiProperty({
|
|
@@ -10,6 +10,15 @@ export class AiIntegrationRequestDto {
|
|
|
10
10
|
@IsNotEmpty()
|
|
11
11
|
tenant: string;
|
|
12
12
|
|
|
13
|
+
@ApiPropertyOptional({
|
|
14
|
+
description: 'Tenant unit id used to select the active agent',
|
|
15
|
+
example: 1,
|
|
16
|
+
})
|
|
17
|
+
@IsOptional()
|
|
18
|
+
@IsInt()
|
|
19
|
+
@Min(1)
|
|
20
|
+
unitId?: number;
|
|
21
|
+
|
|
13
22
|
@ApiProperty({
|
|
14
23
|
description: 'User message used as model input',
|
|
15
24
|
example: 'Hello, how can I reschedule my appointment?',
|
|
@@ -23,7 +32,7 @@ export class AiIntegrationRequestDto {
|
|
|
23
32
|
example: false,
|
|
24
33
|
})
|
|
25
34
|
@IsBoolean()
|
|
26
|
-
|
|
35
|
+
is_document: boolean;
|
|
27
36
|
|
|
28
37
|
@ApiPropertyOptional({
|
|
29
38
|
description: 'Document URLs used as additional context',
|
|
@@ -33,5 +42,5 @@ export class AiIntegrationRequestDto {
|
|
|
33
42
|
@IsOptional()
|
|
34
43
|
@IsArray()
|
|
35
44
|
@IsString({ each: true })
|
|
36
|
-
|
|
45
|
+
documents_url?: string[];
|
|
37
46
|
}
|
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
IsBoolean,
|
|
4
|
+
IsEnum,
|
|
5
|
+
IsInt,
|
|
6
|
+
IsNotEmpty,
|
|
7
|
+
IsNumber,
|
|
8
|
+
IsOptional,
|
|
9
|
+
IsString,
|
|
10
|
+
Max,
|
|
11
|
+
Min,
|
|
12
|
+
} from 'class-validator';
|
|
3
13
|
import { AI_INTEGRATIONS, AiIntegrationDto } from './integration-provider.dto';
|
|
4
14
|
|
|
5
15
|
export class CreateAgentDto {
|
|
@@ -11,6 +21,14 @@ export class CreateAgentDto {
|
|
|
11
21
|
@IsNotEmpty()
|
|
12
22
|
tenant: string;
|
|
13
23
|
|
|
24
|
+
@ApiProperty({
|
|
25
|
+
description: 'Tenant unit id where this agent will be used',
|
|
26
|
+
example: 1,
|
|
27
|
+
})
|
|
28
|
+
@IsInt()
|
|
29
|
+
@Min(1)
|
|
30
|
+
unitId: number;
|
|
31
|
+
|
|
14
32
|
@ApiProperty({
|
|
15
33
|
description: 'Integration provider used by the agent',
|
|
16
34
|
enum: AI_INTEGRATIONS,
|
package/src/ai/index.ts
CHANGED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
|
2
|
+
import { IsArray, IsEnum, IsOptional, IsString } from 'class-validator';
|
|
3
|
+
import { AI_INTEGRATIONS, AiIntegrationDto } from './integration-provider.dto';
|
|
4
|
+
|
|
5
|
+
export class ListAiModelsRequestDto {
|
|
6
|
+
@ApiProperty({
|
|
7
|
+
description: 'Integration provider to list available models',
|
|
8
|
+
enum: AI_INTEGRATIONS,
|
|
9
|
+
example: 'OPENAI',
|
|
10
|
+
})
|
|
11
|
+
@IsEnum(AI_INTEGRATIONS)
|
|
12
|
+
integration: AiIntegrationDto;
|
|
13
|
+
|
|
14
|
+
@ApiPropertyOptional({
|
|
15
|
+
description:
|
|
16
|
+
'Optional provider API key used to list models. Falls back to env key when omitted.',
|
|
17
|
+
example: 'sk-****',
|
|
18
|
+
})
|
|
19
|
+
@IsOptional()
|
|
20
|
+
@IsString()
|
|
21
|
+
apiKey?: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export class ListAiModelsResponseDto {
|
|
25
|
+
@ApiProperty({
|
|
26
|
+
description: 'Integration provider',
|
|
27
|
+
enum: AI_INTEGRATIONS,
|
|
28
|
+
example: 'GEMINI',
|
|
29
|
+
})
|
|
30
|
+
@IsEnum(AI_INTEGRATIONS)
|
|
31
|
+
integration: AiIntegrationDto;
|
|
32
|
+
|
|
33
|
+
@ApiProperty({
|
|
34
|
+
description: 'Available model ids for the selected integration',
|
|
35
|
+
type: [String],
|
|
36
|
+
example: ['gpt-4.1-mini', 'gpt-4o-mini'],
|
|
37
|
+
})
|
|
38
|
+
@IsArray()
|
|
39
|
+
@IsString({ each: true })
|
|
40
|
+
models: string[];
|
|
41
|
+
}
|
|
@@ -2,6 +2,7 @@ import { ApiPropertyOptional } from '@nestjs/swagger';
|
|
|
2
2
|
import {
|
|
3
3
|
IsBoolean,
|
|
4
4
|
IsEnum,
|
|
5
|
+
IsInt,
|
|
5
6
|
IsNotEmpty,
|
|
6
7
|
IsNumber,
|
|
7
8
|
IsOptional,
|
|
@@ -12,6 +13,15 @@ import {
|
|
|
12
13
|
import { AI_INTEGRATIONS, AiIntegrationDto } from './integration-provider.dto';
|
|
13
14
|
|
|
14
15
|
export class UpdateAgentDto {
|
|
16
|
+
@ApiPropertyOptional({
|
|
17
|
+
description: 'Tenant unit id where this agent will be used',
|
|
18
|
+
example: 1,
|
|
19
|
+
})
|
|
20
|
+
@IsOptional()
|
|
21
|
+
@IsInt()
|
|
22
|
+
@Min(1)
|
|
23
|
+
unitId?: number;
|
|
24
|
+
|
|
15
25
|
@ApiPropertyOptional({
|
|
16
26
|
description: 'Integration provider used by the agent',
|
|
17
27
|
enum: AI_INTEGRATIONS,
|