plenna_utilities 1.7.2 → 1.9.0
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/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/src/AI/bedrock/index.d.ts +10 -0
- package/dist/src/AI/bedrock/index.js +27 -0
- package/dist/src/common/custom/types/index.d.ts +4 -0
- package/dist/src/common/custom/types/index.js +2 -0
- package/dist/src/common/infrastructure/yaml-converter/configurations/slack.yaml +90 -0
- package/package.json +7 -5
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -29,3 +29,4 @@ __exportStar(require("./src/mailer"), exports);
|
|
|
29
29
|
__exportStar(require("./src/airTable"), exports);
|
|
30
30
|
__exportStar(require("./src/alerts/presenter"), exports);
|
|
31
31
|
__exportStar(require("./src/common/domain/shared"), exports);
|
|
32
|
+
__exportStar(require("./src/AI/bedrock"), exports);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type PromptVariableValues } from '@aws-sdk/client-bedrock-runtime';
|
|
2
|
+
interface IPlennaBedrockArgs {
|
|
3
|
+
modelId: string;
|
|
4
|
+
}
|
|
5
|
+
export declare class PlennaBedrock {
|
|
6
|
+
private readonly modelId;
|
|
7
|
+
constructor(params: IPlennaBedrockArgs);
|
|
8
|
+
converse(variables: Record<string, PromptVariableValues>): Promise<string>;
|
|
9
|
+
}
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PlennaBedrock = void 0;
|
|
4
|
+
const client_bedrock_runtime_1 = require("@aws-sdk/client-bedrock-runtime");
|
|
5
|
+
class PlennaBedrock {
|
|
6
|
+
modelId;
|
|
7
|
+
constructor(params) {
|
|
8
|
+
this.modelId = params.modelId;
|
|
9
|
+
}
|
|
10
|
+
async converse(variables) {
|
|
11
|
+
const client = new client_bedrock_runtime_1.BedrockRuntimeClient({ region: 'us-east-2' });
|
|
12
|
+
const command = new client_bedrock_runtime_1.ConverseCommand({
|
|
13
|
+
modelId: this.modelId,
|
|
14
|
+
promptVariables: variables
|
|
15
|
+
});
|
|
16
|
+
try {
|
|
17
|
+
const response = await client.send(command);
|
|
18
|
+
const summary = response?.output?.message?.content?.[0]?.text ?? 'No se pudo generar resumen';
|
|
19
|
+
return summary;
|
|
20
|
+
}
|
|
21
|
+
catch (err) {
|
|
22
|
+
console.error('Error en Bedrock:', err);
|
|
23
|
+
return 'Fallo al invocar Bedrock';
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.PlennaBedrock = PlennaBedrock;
|
|
@@ -30,3 +30,93 @@ templates:
|
|
|
30
30
|
elements:
|
|
31
31
|
- type: mrkdwn
|
|
32
32
|
text: 'Generado automáticamente por el sistema de validación de agendas.'
|
|
33
|
+
|
|
34
|
+
noAvailableDoctorsSchedule:
|
|
35
|
+
channel: 'C09E6K166KH'
|
|
36
|
+
text: '🚨 No hay disponibilidad en el calendario de doctores'
|
|
37
|
+
blocks:
|
|
38
|
+
- type: header
|
|
39
|
+
text:
|
|
40
|
+
type: plain_text
|
|
41
|
+
text: '🚫 La px no encontró disponibilidad en calendario'
|
|
42
|
+
emoji: true
|
|
43
|
+
- type: divider
|
|
44
|
+
- type: section
|
|
45
|
+
fields:
|
|
46
|
+
- type: mrkdwn
|
|
47
|
+
text: "*Servicio:*\n{serviceTitle}"
|
|
48
|
+
- type: mrkdwn
|
|
49
|
+
text: "*Modalidad:*\n{serviceModality}"
|
|
50
|
+
- type: mrkdwn
|
|
51
|
+
text: "*Especialidad:*\n{serviceSpecialty}"
|
|
52
|
+
- type: mrkdwn
|
|
53
|
+
text: "*Plenna Id:*\n{servicePlennaId}"
|
|
54
|
+
- type: divider
|
|
55
|
+
- type: section
|
|
56
|
+
fields:
|
|
57
|
+
- type: mrkdwn
|
|
58
|
+
text: "*Especialista:*\n{doctorName}"
|
|
59
|
+
- type: mrkdwn
|
|
60
|
+
text: "*Correo:*\n{doctorEmail}"
|
|
61
|
+
- type: mrkdwn
|
|
62
|
+
text: "*Clínica:*\n{clinicName}"
|
|
63
|
+
- type: mrkdwn
|
|
64
|
+
text: "*Última fecha de busqueda:*\n{lastDateSearch}"
|
|
65
|
+
- type: divider
|
|
66
|
+
- type: section
|
|
67
|
+
fields:
|
|
68
|
+
- type: mrkdwn
|
|
69
|
+
text: "*Paciente:*\n{patientName}"
|
|
70
|
+
- type: mrkdwn
|
|
71
|
+
text: "*Correo de px:*\n{patientEmail}"
|
|
72
|
+
- type: mrkdwn
|
|
73
|
+
text: "*Teléfono de paciente:*\n{patientPhone}"
|
|
74
|
+
- type: divider
|
|
75
|
+
- type: section
|
|
76
|
+
text:
|
|
77
|
+
type: plain_text
|
|
78
|
+
emoji: true
|
|
79
|
+
text: '🕵️ Verifica que hayan horarios configurados en Huli para esta doctora.'
|
|
80
|
+
|
|
81
|
+
patientNeedsACloserAppointment:
|
|
82
|
+
channel: 'C09ELN5A92S'
|
|
83
|
+
text: '🕒 La paciente busca una cita antes de la programada'
|
|
84
|
+
blocks:
|
|
85
|
+
- type: header
|
|
86
|
+
text:
|
|
87
|
+
type: plain_text
|
|
88
|
+
text: '🕒 La paciente busca una cita antes de la programada'
|
|
89
|
+
emoji: true
|
|
90
|
+
- type: divider
|
|
91
|
+
- type: section
|
|
92
|
+
fields:
|
|
93
|
+
- type: mrkdwn
|
|
94
|
+
text: "*Paciente:*\n{patientName}"
|
|
95
|
+
- type: mrkdwn
|
|
96
|
+
text: "*Correo de px:*\n{patientEmail}"
|
|
97
|
+
- type: mrkdwn
|
|
98
|
+
text: "*Teléfono de paciente:*\n{patientPhone}"
|
|
99
|
+
- type: divider
|
|
100
|
+
- type: section
|
|
101
|
+
fields:
|
|
102
|
+
- type: mrkdwn
|
|
103
|
+
text: "*Servicio:*\n{serviceTitle}"
|
|
104
|
+
- type: mrkdwn
|
|
105
|
+
text: "*Modalidad:*\n{serviceModality}"
|
|
106
|
+
- type: mrkdwn
|
|
107
|
+
text: "*Especialidad:*\n{serviceSpecialty}"
|
|
108
|
+
- type: mrkdwn
|
|
109
|
+
text: "*Plenna Id:*\n{servicePlennaId}"
|
|
110
|
+
- type: divider
|
|
111
|
+
- type: section
|
|
112
|
+
fields:
|
|
113
|
+
- type: mrkdwn
|
|
114
|
+
text: "*Especialista de la cita:*\n{doctorName}"
|
|
115
|
+
- type: mrkdwn
|
|
116
|
+
text: "*Correo de la especialista:*\n{doctorEmail}"
|
|
117
|
+
- type: mrkdwn
|
|
118
|
+
text: "*Clínica de la cita:*\n{clinicName}"
|
|
119
|
+
- type: mrkdwn
|
|
120
|
+
text: "*Fecha de la cita:*\n{dateAppointment}"
|
|
121
|
+
- type: mrkdwn
|
|
122
|
+
text: "*Hora de la cita:*\n{hourAppointment}"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "plenna_utilities",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.9.0",
|
|
4
4
|
"description": "plenna's utils for backend projects",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -25,25 +25,27 @@
|
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@types/aws-lambda": "^8.10.140",
|
|
27
27
|
"@types/node": "^20.14.5",
|
|
28
|
+
"@types/yamljs": "^0.2.34",
|
|
28
29
|
"@typescript-eslint/eslint-plugin": "^6.21.0",
|
|
29
30
|
"eslint": "^8.57.0",
|
|
30
31
|
"eslint-config-standard-with-typescript": "^43.0.1",
|
|
31
32
|
"eslint-plugin-import": "^2.29.1",
|
|
32
33
|
"eslint-plugin-n": "^16.6.2",
|
|
33
34
|
"eslint-plugin-promise": "^6.1.1",
|
|
34
|
-
"@types/yamljs": "^0.2.34",
|
|
35
35
|
"typescript": "^5.4.5"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
+
"@aws-sdk/client-bedrock-agent": "^3.600.0",
|
|
39
|
+
"@aws-sdk/client-bedrock-runtime": "^3.600.0",
|
|
38
40
|
"@aws-sdk/client-s3": "^3.600.0",
|
|
39
41
|
"@aws-sdk/s3-request-presigner": "^3.600.0",
|
|
40
42
|
"@googleapis/docs": "^3.0.2",
|
|
41
43
|
"@googleapis/drive": "^8.10.0",
|
|
42
44
|
"@googleapis/sheets": "^8.0.0",
|
|
45
|
+
"@slack/web-api": "^6.9.1",
|
|
43
46
|
"customerio-node": "^4.1.1",
|
|
47
|
+
"dotenv": "^16.4.5",
|
|
44
48
|
"google-auth-library": "^9.11.0",
|
|
45
|
-
"yaml": "^2.3.0"
|
|
46
|
-
"@slack/web-api": "^6.9.1",
|
|
47
|
-
"dotenv": "^16.4.5"
|
|
49
|
+
"yaml": "^2.3.0"
|
|
48
50
|
}
|
|
49
51
|
}
|