tychat-contracts 1.0.37 → 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.
Files changed (37) hide show
  1. package/dist/ai/agent-response.dto.d.ts +16 -0
  2. package/dist/ai/agent-response.dto.d.ts.map +1 -0
  3. package/dist/ai/agent-response.dto.js +130 -0
  4. package/dist/ai/ai-integration-request.dto.d.ts +8 -0
  5. package/dist/ai/ai-integration-request.dto.d.ts.map +1 -0
  6. package/dist/ai/ai-integration-request.dto.js +69 -0
  7. package/dist/ai/ai-integration-response.dto.d.ts +5 -0
  8. package/dist/ai/ai-integration-response.dto.d.ts.map +1 -0
  9. package/dist/ai/ai-integration-response.dto.js +37 -0
  10. package/dist/ai/create-agent.dto.d.ts +13 -0
  11. package/dist/ai/create-agent.dto.d.ts.map +1 -0
  12. package/dist/ai/create-agent.dto.js +112 -0
  13. package/dist/ai/index.d.ts +8 -0
  14. package/dist/ai/index.d.ts.map +1 -0
  15. package/dist/ai/index.js +23 -0
  16. package/dist/ai/integration-provider.dto.d.ts +3 -0
  17. package/dist/ai/integration-provider.dto.d.ts.map +1 -0
  18. package/dist/ai/integration-provider.dto.js +4 -0
  19. package/dist/ai/list-models.dto.d.ts +10 -0
  20. package/dist/ai/list-models.dto.d.ts.map +1 -0
  21. package/dist/ai/list-models.dto.js +62 -0
  22. package/dist/ai/update-agent.dto.d.ts +12 -0
  23. package/dist/ai/update-agent.dto.d.ts.map +1 -0
  24. package/dist/ai/update-agent.dto.js +108 -0
  25. package/dist/index.d.ts +1 -0
  26. package/dist/index.d.ts.map +1 -1
  27. package/dist/index.js +1 -0
  28. package/package.json +1 -1
  29. package/src/ai/agent-response.dto.ts +93 -0
  30. package/src/ai/ai-integration-request.dto.ts +46 -0
  31. package/src/ai/ai-integration-response.dto.ts +20 -0
  32. package/src/ai/create-agent.dto.ts +91 -0
  33. package/src/ai/index.ts +7 -0
  34. package/src/ai/integration-provider.dto.ts +3 -0
  35. package/src/ai/list-models.dto.ts +41 -0
  36. package/src/ai/update-agent.dto.ts +89 -0
  37. package/src/index.ts +1 -0
@@ -0,0 +1,16 @@
1
+ import { AiIntegrationDto } from './integration-provider.dto';
2
+ export declare class AgentResponseDto {
3
+ id: string;
4
+ tenant: string;
5
+ unitId: number;
6
+ integration: AiIntegrationDto;
7
+ model: string;
8
+ systemPrompt: string;
9
+ temperature: number;
10
+ active: boolean;
11
+ openAiApiKey?: string;
12
+ geminiApiKey?: string;
13
+ createdAt: string;
14
+ updatedAt: string;
15
+ }
16
+ //# sourceMappingURL=agent-response.dto.d.ts.map
@@ -0,0 +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;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"}
@@ -0,0 +1,130 @@
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.AgentResponseDto = 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 AgentResponseDto {
17
+ id;
18
+ tenant;
19
+ unitId;
20
+ integration;
21
+ model;
22
+ systemPrompt;
23
+ temperature;
24
+ active;
25
+ openAiApiKey;
26
+ geminiApiKey;
27
+ createdAt;
28
+ updatedAt;
29
+ }
30
+ exports.AgentResponseDto = AgentResponseDto;
31
+ __decorate([
32
+ (0, swagger_1.ApiProperty)({
33
+ description: 'Agent id',
34
+ example: '550e8400-e29b-41d4-a716-446655440000',
35
+ }),
36
+ (0, class_validator_1.IsUUID)('4'),
37
+ __metadata("design:type", String)
38
+ ], AgentResponseDto.prototype, "id", void 0);
39
+ __decorate([
40
+ (0, swagger_1.ApiProperty)({
41
+ description: 'Tenant slug that owns this agent',
42
+ example: 'clinic-alpha',
43
+ }),
44
+ (0, class_validator_1.IsString)(),
45
+ (0, class_validator_1.IsNotEmpty)(),
46
+ __metadata("design:type", String)
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);
56
+ __decorate([
57
+ (0, swagger_1.ApiProperty)({
58
+ description: 'Integration provider used by the agent',
59
+ enum: integration_provider_dto_1.AI_INTEGRATIONS,
60
+ example: 'OPENAI',
61
+ }),
62
+ (0, class_validator_1.IsEnum)(integration_provider_dto_1.AI_INTEGRATIONS),
63
+ __metadata("design:type", String)
64
+ ], AgentResponseDto.prototype, "integration", void 0);
65
+ __decorate([
66
+ (0, swagger_1.ApiProperty)({
67
+ description: 'Model name used by the provider',
68
+ example: 'gpt-4.1-mini',
69
+ }),
70
+ (0, class_validator_1.IsString)(),
71
+ __metadata("design:type", String)
72
+ ], AgentResponseDto.prototype, "model", void 0);
73
+ __decorate([
74
+ (0, swagger_1.ApiProperty)({
75
+ description: 'System prompt used by this agent',
76
+ example: 'You are a helpful assistant.',
77
+ }),
78
+ (0, class_validator_1.IsString)(),
79
+ __metadata("design:type", String)
80
+ ], AgentResponseDto.prototype, "systemPrompt", void 0);
81
+ __decorate([
82
+ (0, swagger_1.ApiProperty)({
83
+ description: 'Sampling temperature used for generation',
84
+ example: 0.7,
85
+ }),
86
+ (0, class_validator_1.IsNumber)(),
87
+ __metadata("design:type", Number)
88
+ ], AgentResponseDto.prototype, "temperature", void 0);
89
+ __decorate([
90
+ (0, swagger_1.ApiProperty)({
91
+ description: 'Whether this agent is currently active',
92
+ example: true,
93
+ }),
94
+ (0, class_validator_1.IsBoolean)(),
95
+ __metadata("design:type", Boolean)
96
+ ], AgentResponseDto.prototype, "active", void 0);
97
+ __decorate([
98
+ (0, swagger_1.ApiPropertyOptional)({
99
+ description: 'OpenAI API key configured for this agent',
100
+ example: 'sk-****',
101
+ }),
102
+ (0, class_validator_1.IsOptional)(),
103
+ (0, class_validator_1.IsString)(),
104
+ __metadata("design:type", String)
105
+ ], AgentResponseDto.prototype, "openAiApiKey", void 0);
106
+ __decorate([
107
+ (0, swagger_1.ApiPropertyOptional)({
108
+ description: 'Gemini API key configured for this agent',
109
+ example: 'AIza****',
110
+ }),
111
+ (0, class_validator_1.IsOptional)(),
112
+ (0, class_validator_1.IsString)(),
113
+ __metadata("design:type", String)
114
+ ], AgentResponseDto.prototype, "geminiApiKey", void 0);
115
+ __decorate([
116
+ (0, swagger_1.ApiProperty)({
117
+ description: 'Creation date',
118
+ example: '2026-03-16T17:20:00.000Z',
119
+ }),
120
+ (0, class_validator_1.IsDateString)(),
121
+ __metadata("design:type", String)
122
+ ], AgentResponseDto.prototype, "createdAt", void 0);
123
+ __decorate([
124
+ (0, swagger_1.ApiProperty)({
125
+ description: 'Last update date',
126
+ example: '2026-03-16T17:20:00.000Z',
127
+ }),
128
+ (0, class_validator_1.IsDateString)(),
129
+ __metadata("design:type", String)
130
+ ], AgentResponseDto.prototype, "updatedAt", void 0);
@@ -0,0 +1,8 @@
1
+ export declare class AiIntegrationRequestDto {
2
+ tenant: string;
3
+ unitId?: number;
4
+ message: string;
5
+ is_document: boolean;
6
+ documents_url?: string[];
7
+ }
8
+ //# sourceMappingURL=ai-integration-request.dto.d.ts.map
@@ -0,0 +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;IASf,MAAM,CAAC,EAAE,MAAM,CAAC;IAQhB,OAAO,EAAE,MAAM,CAAC;IAOhB,WAAW,EAAE,OAAO,CAAC;IAUrB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;CAC1B"}
@@ -0,0 +1,69 @@
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.AiIntegrationRequestDto = void 0;
13
+ const swagger_1 = require("@nestjs/swagger");
14
+ const class_validator_1 = require("class-validator");
15
+ class AiIntegrationRequestDto {
16
+ tenant;
17
+ unitId;
18
+ message;
19
+ is_document;
20
+ documents_url;
21
+ }
22
+ exports.AiIntegrationRequestDto = AiIntegrationRequestDto;
23
+ __decorate([
24
+ (0, swagger_1.ApiProperty)({
25
+ description: 'Tenant slug',
26
+ example: 'clinic-alpha',
27
+ }),
28
+ (0, class_validator_1.IsString)(),
29
+ (0, class_validator_1.IsNotEmpty)(),
30
+ __metadata("design:type", String)
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);
42
+ __decorate([
43
+ (0, swagger_1.ApiProperty)({
44
+ description: 'User message used as model input',
45
+ example: 'Hello, how can I reschedule my appointment?',
46
+ }),
47
+ (0, class_validator_1.IsString)(),
48
+ (0, class_validator_1.IsNotEmpty)(),
49
+ __metadata("design:type", String)
50
+ ], AiIntegrationRequestDto.prototype, "message", void 0);
51
+ __decorate([
52
+ (0, swagger_1.ApiProperty)({
53
+ description: 'Indicates whether the input is document-based',
54
+ example: false,
55
+ }),
56
+ (0, class_validator_1.IsBoolean)(),
57
+ __metadata("design:type", Boolean)
58
+ ], AiIntegrationRequestDto.prototype, "is_document", void 0);
59
+ __decorate([
60
+ (0, swagger_1.ApiPropertyOptional)({
61
+ description: 'Document URLs used as additional context',
62
+ type: [String],
63
+ example: ['https://cdn.example.com/doc-1.pdf'],
64
+ }),
65
+ (0, class_validator_1.IsOptional)(),
66
+ (0, class_validator_1.IsArray)(),
67
+ (0, class_validator_1.IsString)({ each: true }),
68
+ __metadata("design:type", Array)
69
+ ], AiIntegrationRequestDto.prototype, "documents_url", void 0);
@@ -0,0 +1,5 @@
1
+ export declare class AiIntegrationResponseDto {
2
+ tenant: string;
3
+ output: string;
4
+ }
5
+ //# sourceMappingURL=ai-integration-response.dto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-integration-response.dto.d.ts","sourceRoot":"","sources":["../../src/ai/ai-integration-response.dto.ts"],"names":[],"mappings":"AAGA,qBAAa,wBAAwB;IAOnC,MAAM,EAAE,MAAM,CAAC;IAQf,MAAM,EAAE,MAAM,CAAC;CAChB"}
@@ -0,0 +1,37 @@
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.AiIntegrationResponseDto = void 0;
13
+ const swagger_1 = require("@nestjs/swagger");
14
+ const class_validator_1 = require("class-validator");
15
+ class AiIntegrationResponseDto {
16
+ tenant;
17
+ output;
18
+ }
19
+ exports.AiIntegrationResponseDto = AiIntegrationResponseDto;
20
+ __decorate([
21
+ (0, swagger_1.ApiProperty)({
22
+ description: 'Tenant slug',
23
+ example: 'clinic-alpha',
24
+ }),
25
+ (0, class_validator_1.IsString)(),
26
+ (0, class_validator_1.IsNotEmpty)(),
27
+ __metadata("design:type", String)
28
+ ], AiIntegrationResponseDto.prototype, "tenant", void 0);
29
+ __decorate([
30
+ (0, swagger_1.ApiProperty)({
31
+ description: 'Model output content',
32
+ example: 'Sure, I can help you reschedule your appointment.',
33
+ }),
34
+ (0, class_validator_1.IsString)(),
35
+ (0, class_validator_1.IsNotEmpty)(),
36
+ __metadata("design:type", String)
37
+ ], AiIntegrationResponseDto.prototype, "output", void 0);
@@ -0,0 +1,13 @@
1
+ import { AiIntegrationDto } from './integration-provider.dto';
2
+ export declare class CreateAgentDto {
3
+ tenant: string;
4
+ unitId: number;
5
+ integration: AiIntegrationDto;
6
+ model: string;
7
+ systemPrompt: string;
8
+ temperature: number;
9
+ active: boolean;
10
+ openAiApiKey?: string;
11
+ geminiApiKey?: string;
12
+ }
13
+ //# sourceMappingURL=create-agent.dto.d.ts.map
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,112 @@
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.CreateAgentDto = 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 CreateAgentDto {
17
+ tenant;
18
+ unitId;
19
+ integration;
20
+ model;
21
+ systemPrompt;
22
+ temperature;
23
+ active;
24
+ openAiApiKey;
25
+ geminiApiKey;
26
+ }
27
+ exports.CreateAgentDto = CreateAgentDto;
28
+ __decorate([
29
+ (0, swagger_1.ApiProperty)({
30
+ description: 'Tenant slug that owns this agent',
31
+ example: 'clinic-alpha',
32
+ }),
33
+ (0, class_validator_1.IsString)(),
34
+ (0, class_validator_1.IsNotEmpty)(),
35
+ __metadata("design:type", String)
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);
46
+ __decorate([
47
+ (0, swagger_1.ApiProperty)({
48
+ description: 'Integration provider used by the agent',
49
+ enum: integration_provider_dto_1.AI_INTEGRATIONS,
50
+ example: 'OPENAI',
51
+ }),
52
+ (0, class_validator_1.IsEnum)(integration_provider_dto_1.AI_INTEGRATIONS),
53
+ __metadata("design:type", String)
54
+ ], CreateAgentDto.prototype, "integration", void 0);
55
+ __decorate([
56
+ (0, swagger_1.ApiProperty)({
57
+ description: 'Model name used by the provider',
58
+ example: 'gpt-4.1-mini',
59
+ }),
60
+ (0, class_validator_1.IsString)(),
61
+ (0, class_validator_1.IsNotEmpty)(),
62
+ __metadata("design:type", String)
63
+ ], CreateAgentDto.prototype, "model", void 0);
64
+ __decorate([
65
+ (0, swagger_1.ApiProperty)({
66
+ description: 'System prompt applied before user messages',
67
+ example: 'You are an assistant for healthcare front-desk tasks.',
68
+ }),
69
+ (0, class_validator_1.IsString)(),
70
+ (0, class_validator_1.IsNotEmpty)(),
71
+ __metadata("design:type", String)
72
+ ], CreateAgentDto.prototype, "systemPrompt", void 0);
73
+ __decorate([
74
+ (0, swagger_1.ApiProperty)({
75
+ description: 'Sampling temperature used for generation',
76
+ minimum: 0,
77
+ maximum: 2,
78
+ example: 0.7,
79
+ }),
80
+ (0, class_validator_1.IsNumber)(),
81
+ (0, class_validator_1.Min)(0),
82
+ (0, class_validator_1.Max)(2),
83
+ __metadata("design:type", Number)
84
+ ], CreateAgentDto.prototype, "temperature", void 0);
85
+ __decorate([
86
+ (0, swagger_1.ApiProperty)({
87
+ description: 'Whether this agent is active for the tenant',
88
+ example: true,
89
+ }),
90
+ (0, class_validator_1.IsBoolean)(),
91
+ __metadata("design:type", Boolean)
92
+ ], CreateAgentDto.prototype, "active", void 0);
93
+ __decorate([
94
+ (0, swagger_1.ApiPropertyOptional)({
95
+ description: 'OpenAI API key for this tenant and agent',
96
+ example: 'sk-****',
97
+ }),
98
+ (0, class_validator_1.IsOptional)(),
99
+ (0, class_validator_1.IsString)(),
100
+ (0, class_validator_1.IsNotEmpty)(),
101
+ __metadata("design:type", String)
102
+ ], CreateAgentDto.prototype, "openAiApiKey", void 0);
103
+ __decorate([
104
+ (0, swagger_1.ApiPropertyOptional)({
105
+ description: 'Gemini API key for this tenant and agent',
106
+ example: 'AIza****',
107
+ }),
108
+ (0, class_validator_1.IsOptional)(),
109
+ (0, class_validator_1.IsString)(),
110
+ (0, class_validator_1.IsNotEmpty)(),
111
+ __metadata("design:type", String)
112
+ ], CreateAgentDto.prototype, "geminiApiKey", void 0);
@@ -0,0 +1,8 @@
1
+ export * from './integration-provider.dto';
2
+ export * from './create-agent.dto';
3
+ export * from './update-agent.dto';
4
+ export * from './agent-response.dto';
5
+ export * from './ai-integration-request.dto';
6
+ export * from './ai-integration-response.dto';
7
+ export * from './list-models.dto';
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +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;AAC9C,cAAc,mBAAmB,CAAC"}
@@ -0,0 +1,23 @@
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("./integration-provider.dto"), exports);
18
+ __exportStar(require("./create-agent.dto"), exports);
19
+ __exportStar(require("./update-agent.dto"), exports);
20
+ __exportStar(require("./agent-response.dto"), exports);
21
+ __exportStar(require("./ai-integration-request.dto"), exports);
22
+ __exportStar(require("./ai-integration-response.dto"), exports);
23
+ __exportStar(require("./list-models.dto"), exports);
@@ -0,0 +1,3 @@
1
+ export declare const AI_INTEGRATIONS: readonly ["GEMINI", "OPENAI"];
2
+ export type AiIntegrationDto = (typeof AI_INTEGRATIONS)[number];
3
+ //# sourceMappingURL=integration-provider.dto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"integration-provider.dto.d.ts","sourceRoot":"","sources":["../../src/ai/integration-provider.dto.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,+BAAgC,CAAC;AAE7D,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AI_INTEGRATIONS = void 0;
4
+ exports.AI_INTEGRATIONS = ['GEMINI', 'OPENAI'];
@@ -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);
@@ -0,0 +1,12 @@
1
+ import { AiIntegrationDto } from './integration-provider.dto';
2
+ export declare class UpdateAgentDto {
3
+ unitId?: number;
4
+ integration?: AiIntegrationDto;
5
+ model?: string;
6
+ systemPrompt?: string;
7
+ temperature?: number;
8
+ active?: boolean;
9
+ openAiApiKey?: string;
10
+ geminiApiKey?: string;
11
+ }
12
+ //# sourceMappingURL=update-agent.dto.d.ts.map
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,108 @@
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.UpdateAgentDto = 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 UpdateAgentDto {
17
+ unitId;
18
+ integration;
19
+ model;
20
+ systemPrompt;
21
+ temperature;
22
+ active;
23
+ openAiApiKey;
24
+ geminiApiKey;
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);
37
+ __decorate([
38
+ (0, swagger_1.ApiPropertyOptional)({
39
+ description: 'Integration provider used by the agent',
40
+ enum: integration_provider_dto_1.AI_INTEGRATIONS,
41
+ example: 'GEMINI',
42
+ }),
43
+ (0, class_validator_1.IsOptional)(),
44
+ (0, class_validator_1.IsEnum)(integration_provider_dto_1.AI_INTEGRATIONS),
45
+ __metadata("design:type", String)
46
+ ], UpdateAgentDto.prototype, "integration", void 0);
47
+ __decorate([
48
+ (0, swagger_1.ApiPropertyOptional)({
49
+ description: 'Model name used by the provider',
50
+ example: 'gemini-2.5-flash',
51
+ }),
52
+ (0, class_validator_1.IsOptional)(),
53
+ (0, class_validator_1.IsString)(),
54
+ (0, class_validator_1.IsNotEmpty)(),
55
+ __metadata("design:type", String)
56
+ ], UpdateAgentDto.prototype, "model", void 0);
57
+ __decorate([
58
+ (0, swagger_1.ApiPropertyOptional)({
59
+ description: 'System prompt applied before user messages',
60
+ example: 'You are a concise assistant for customer support.',
61
+ }),
62
+ (0, class_validator_1.IsOptional)(),
63
+ (0, class_validator_1.IsString)(),
64
+ (0, class_validator_1.IsNotEmpty)(),
65
+ __metadata("design:type", String)
66
+ ], UpdateAgentDto.prototype, "systemPrompt", void 0);
67
+ __decorate([
68
+ (0, swagger_1.ApiPropertyOptional)({
69
+ description: 'Sampling temperature used for generation',
70
+ minimum: 0,
71
+ maximum: 2,
72
+ example: 0.3,
73
+ }),
74
+ (0, class_validator_1.IsOptional)(),
75
+ (0, class_validator_1.IsNumber)(),
76
+ (0, class_validator_1.Min)(0),
77
+ (0, class_validator_1.Max)(2),
78
+ __metadata("design:type", Number)
79
+ ], UpdateAgentDto.prototype, "temperature", void 0);
80
+ __decorate([
81
+ (0, swagger_1.ApiPropertyOptional)({
82
+ description: 'Whether this agent is active for the tenant',
83
+ example: true,
84
+ }),
85
+ (0, class_validator_1.IsOptional)(),
86
+ (0, class_validator_1.IsBoolean)(),
87
+ __metadata("design:type", Boolean)
88
+ ], UpdateAgentDto.prototype, "active", void 0);
89
+ __decorate([
90
+ (0, swagger_1.ApiPropertyOptional)({
91
+ description: 'OpenAI API key for this tenant and agent',
92
+ example: 'sk-****',
93
+ }),
94
+ (0, class_validator_1.IsOptional)(),
95
+ (0, class_validator_1.IsString)(),
96
+ (0, class_validator_1.IsNotEmpty)(),
97
+ __metadata("design:type", String)
98
+ ], UpdateAgentDto.prototype, "openAiApiKey", void 0);
99
+ __decorate([
100
+ (0, swagger_1.ApiPropertyOptional)({
101
+ description: 'Gemini API key for this tenant and agent',
102
+ example: 'AIza****',
103
+ }),
104
+ (0, class_validator_1.IsOptional)(),
105
+ (0, class_validator_1.IsString)(),
106
+ (0, class_validator_1.IsNotEmpty)(),
107
+ __metadata("design:type", String)
108
+ ], UpdateAgentDto.prototype, "geminiApiKey", void 0);
package/dist/index.d.ts CHANGED
@@ -8,4 +8,5 @@ export * from './specialties';
8
8
  export * from './professionals';
9
9
  export * from './payments';
10
10
  export * from './billing';
11
+ export * from './ai';
11
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,MAAM,CAAC"}
package/dist/index.js CHANGED
@@ -24,3 +24,4 @@ __exportStar(require("./specialties"), exports);
24
24
  __exportStar(require("./professionals"), exports);
25
25
  __exportStar(require("./payments"), exports);
26
26
  __exportStar(require("./billing"), exports);
27
+ __exportStar(require("./ai"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tychat-contracts",
3
- "version": "1.0.37",
3
+ "version": "1.0.39",
4
4
  "description": "DTOs compartilhados com class-validator (API e microserviços)",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -0,0 +1,93 @@
1
+ import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
2
+ import { IsBoolean, IsDateString, IsEnum, IsNotEmpty, IsNumber, IsOptional, IsString, IsUUID } from 'class-validator';
3
+ import { AI_INTEGRATIONS, AiIntegrationDto } from './integration-provider.dto';
4
+
5
+ export class AgentResponseDto {
6
+ @ApiProperty({
7
+ description: 'Agent id',
8
+ example: '550e8400-e29b-41d4-a716-446655440000',
9
+ })
10
+ @IsUUID('4')
11
+ id: string;
12
+
13
+ @ApiProperty({
14
+ description: 'Tenant slug that owns this agent',
15
+ example: 'clinic-alpha',
16
+ })
17
+ @IsString()
18
+ @IsNotEmpty()
19
+ tenant: string;
20
+
21
+ @ApiProperty({
22
+ description: 'Tenant unit id where this agent will be used',
23
+ example: 1,
24
+ })
25
+ @IsNumber()
26
+ unitId: number;
27
+
28
+ @ApiProperty({
29
+ description: 'Integration provider used by the agent',
30
+ enum: AI_INTEGRATIONS,
31
+ example: 'OPENAI',
32
+ })
33
+ @IsEnum(AI_INTEGRATIONS)
34
+ integration: AiIntegrationDto;
35
+
36
+ @ApiProperty({
37
+ description: 'Model name used by the provider',
38
+ example: 'gpt-4.1-mini',
39
+ })
40
+ @IsString()
41
+ model: string;
42
+
43
+ @ApiProperty({
44
+ description: 'System prompt used by this agent',
45
+ example: 'You are a helpful assistant.',
46
+ })
47
+ @IsString()
48
+ systemPrompt: string;
49
+
50
+ @ApiProperty({
51
+ description: 'Sampling temperature used for generation',
52
+ example: 0.7,
53
+ })
54
+ @IsNumber()
55
+ temperature: number;
56
+
57
+ @ApiProperty({
58
+ description: 'Whether this agent is currently active',
59
+ example: true,
60
+ })
61
+ @IsBoolean()
62
+ active: boolean;
63
+
64
+ @ApiPropertyOptional({
65
+ description: 'OpenAI API key configured for this agent',
66
+ example: 'sk-****',
67
+ })
68
+ @IsOptional()
69
+ @IsString()
70
+ openAiApiKey?: string;
71
+
72
+ @ApiPropertyOptional({
73
+ description: 'Gemini API key configured for this agent',
74
+ example: 'AIza****',
75
+ })
76
+ @IsOptional()
77
+ @IsString()
78
+ geminiApiKey?: string;
79
+
80
+ @ApiProperty({
81
+ description: 'Creation date',
82
+ example: '2026-03-16T17:20:00.000Z',
83
+ })
84
+ @IsDateString()
85
+ createdAt: string;
86
+
87
+ @ApiProperty({
88
+ description: 'Last update date',
89
+ example: '2026-03-16T17:20:00.000Z',
90
+ })
91
+ @IsDateString()
92
+ updatedAt: string;
93
+ }
@@ -0,0 +1,46 @@
1
+ import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
2
+ import { IsArray, IsBoolean, IsInt, IsNotEmpty, IsOptional, IsString, Min } from 'class-validator';
3
+
4
+ export class AiIntegrationRequestDto {
5
+ @ApiProperty({
6
+ description: 'Tenant slug',
7
+ example: 'clinic-alpha',
8
+ })
9
+ @IsString()
10
+ @IsNotEmpty()
11
+ tenant: string;
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
+
22
+ @ApiProperty({
23
+ description: 'User message used as model input',
24
+ example: 'Hello, how can I reschedule my appointment?',
25
+ })
26
+ @IsString()
27
+ @IsNotEmpty()
28
+ message: string;
29
+
30
+ @ApiProperty({
31
+ description: 'Indicates whether the input is document-based',
32
+ example: false,
33
+ })
34
+ @IsBoolean()
35
+ is_document: boolean;
36
+
37
+ @ApiPropertyOptional({
38
+ description: 'Document URLs used as additional context',
39
+ type: [String],
40
+ example: ['https://cdn.example.com/doc-1.pdf'],
41
+ })
42
+ @IsOptional()
43
+ @IsArray()
44
+ @IsString({ each: true })
45
+ documents_url?: string[];
46
+ }
@@ -0,0 +1,20 @@
1
+ import { ApiProperty } from '@nestjs/swagger';
2
+ import { IsNotEmpty, IsString } from 'class-validator';
3
+
4
+ export class AiIntegrationResponseDto {
5
+ @ApiProperty({
6
+ description: 'Tenant slug',
7
+ example: 'clinic-alpha',
8
+ })
9
+ @IsString()
10
+ @IsNotEmpty()
11
+ tenant: string;
12
+
13
+ @ApiProperty({
14
+ description: 'Model output content',
15
+ example: 'Sure, I can help you reschedule your appointment.',
16
+ })
17
+ @IsString()
18
+ @IsNotEmpty()
19
+ output: string;
20
+ }
@@ -0,0 +1,91 @@
1
+ import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
2
+ import {
3
+ IsBoolean,
4
+ IsEnum,
5
+ IsInt,
6
+ IsNotEmpty,
7
+ IsNumber,
8
+ IsOptional,
9
+ IsString,
10
+ Max,
11
+ Min,
12
+ } from 'class-validator';
13
+ import { AI_INTEGRATIONS, AiIntegrationDto } from './integration-provider.dto';
14
+
15
+ export class CreateAgentDto {
16
+ @ApiProperty({
17
+ description: 'Tenant slug that owns this agent',
18
+ example: 'clinic-alpha',
19
+ })
20
+ @IsString()
21
+ @IsNotEmpty()
22
+ tenant: string;
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
+
32
+ @ApiProperty({
33
+ description: 'Integration provider used by the agent',
34
+ enum: AI_INTEGRATIONS,
35
+ example: 'OPENAI',
36
+ })
37
+ @IsEnum(AI_INTEGRATIONS)
38
+ integration: AiIntegrationDto;
39
+
40
+ @ApiProperty({
41
+ description: 'Model name used by the provider',
42
+ example: 'gpt-4.1-mini',
43
+ })
44
+ @IsString()
45
+ @IsNotEmpty()
46
+ model: string;
47
+
48
+ @ApiProperty({
49
+ description: 'System prompt applied before user messages',
50
+ example: 'You are an assistant for healthcare front-desk tasks.',
51
+ })
52
+ @IsString()
53
+ @IsNotEmpty()
54
+ systemPrompt: string;
55
+
56
+ @ApiProperty({
57
+ description: 'Sampling temperature used for generation',
58
+ minimum: 0,
59
+ maximum: 2,
60
+ example: 0.7,
61
+ })
62
+ @IsNumber()
63
+ @Min(0)
64
+ @Max(2)
65
+ temperature: number;
66
+
67
+ @ApiProperty({
68
+ description: 'Whether this agent is active for the tenant',
69
+ example: true,
70
+ })
71
+ @IsBoolean()
72
+ active: boolean;
73
+
74
+ @ApiPropertyOptional({
75
+ description: 'OpenAI API key for this tenant and agent',
76
+ example: 'sk-****',
77
+ })
78
+ @IsOptional()
79
+ @IsString()
80
+ @IsNotEmpty()
81
+ openAiApiKey?: string;
82
+
83
+ @ApiPropertyOptional({
84
+ description: 'Gemini API key for this tenant and agent',
85
+ example: 'AIza****',
86
+ })
87
+ @IsOptional()
88
+ @IsString()
89
+ @IsNotEmpty()
90
+ geminiApiKey?: string;
91
+ }
@@ -0,0 +1,7 @@
1
+ export * from './integration-provider.dto';
2
+ export * from './create-agent.dto';
3
+ export * from './update-agent.dto';
4
+ export * from './agent-response.dto';
5
+ export * from './ai-integration-request.dto';
6
+ export * from './ai-integration-response.dto';
7
+ export * from './list-models.dto';
@@ -0,0 +1,3 @@
1
+ export const AI_INTEGRATIONS = ['GEMINI', 'OPENAI'] as const;
2
+
3
+ export type AiIntegrationDto = (typeof AI_INTEGRATIONS)[number];
@@ -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
+ }
@@ -0,0 +1,89 @@
1
+ import { ApiPropertyOptional } from '@nestjs/swagger';
2
+ import {
3
+ IsBoolean,
4
+ IsEnum,
5
+ IsInt,
6
+ IsNotEmpty,
7
+ IsNumber,
8
+ IsOptional,
9
+ IsString,
10
+ Max,
11
+ Min,
12
+ } from 'class-validator';
13
+ import { AI_INTEGRATIONS, AiIntegrationDto } from './integration-provider.dto';
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
+
25
+ @ApiPropertyOptional({
26
+ description: 'Integration provider used by the agent',
27
+ enum: AI_INTEGRATIONS,
28
+ example: 'GEMINI',
29
+ })
30
+ @IsOptional()
31
+ @IsEnum(AI_INTEGRATIONS)
32
+ integration?: AiIntegrationDto;
33
+
34
+ @ApiPropertyOptional({
35
+ description: 'Model name used by the provider',
36
+ example: 'gemini-2.5-flash',
37
+ })
38
+ @IsOptional()
39
+ @IsString()
40
+ @IsNotEmpty()
41
+ model?: string;
42
+
43
+ @ApiPropertyOptional({
44
+ description: 'System prompt applied before user messages',
45
+ example: 'You are a concise assistant for customer support.',
46
+ })
47
+ @IsOptional()
48
+ @IsString()
49
+ @IsNotEmpty()
50
+ systemPrompt?: string;
51
+
52
+ @ApiPropertyOptional({
53
+ description: 'Sampling temperature used for generation',
54
+ minimum: 0,
55
+ maximum: 2,
56
+ example: 0.3,
57
+ })
58
+ @IsOptional()
59
+ @IsNumber()
60
+ @Min(0)
61
+ @Max(2)
62
+ temperature?: number;
63
+
64
+ @ApiPropertyOptional({
65
+ description: 'Whether this agent is active for the tenant',
66
+ example: true,
67
+ })
68
+ @IsOptional()
69
+ @IsBoolean()
70
+ active?: boolean;
71
+
72
+ @ApiPropertyOptional({
73
+ description: 'OpenAI API key for this tenant and agent',
74
+ example: 'sk-****',
75
+ })
76
+ @IsOptional()
77
+ @IsString()
78
+ @IsNotEmpty()
79
+ openAiApiKey?: string;
80
+
81
+ @ApiPropertyOptional({
82
+ description: 'Gemini API key for this tenant and agent',
83
+ example: 'AIza****',
84
+ })
85
+ @IsOptional()
86
+ @IsString()
87
+ @IsNotEmpty()
88
+ geminiApiKey?: string;
89
+ }
package/src/index.ts CHANGED
@@ -8,3 +8,4 @@ export * from './specialties';
8
8
  export * from './professionals';
9
9
  export * from './payments';
10
10
  export * from './billing';
11
+ export * from './ai';