@runnerpro/backend 1.13.37 → 1.13.38

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.
@@ -220,31 +220,25 @@ const sendMessage = (req, res, { sendNotification, firebaseMessaging, isClient }
220
220
  const idCliente = isClient ? req.session.userid : req.body.idCliente;
221
221
  let idWorkout, type = 1;
222
222
  if (!isClient) {
223
- console.time('promise all 1');
224
223
  [text] = yield Promise.all([
225
224
  // Cambiar el tono del texto a uno neutro y corregir la ortografía
226
225
  cambiarTonoEntrenadorNeutro(text, idCliente),
227
226
  // Si es entrenador, se marca leído cuando se envía un mensaje
228
227
  getPreferredLanguageForChat({ text, idCliente, isClient }),
229
228
  ]);
230
- console.timeEnd('promise all 1');
231
229
  }
232
230
  // Devuelve el texto en el otro idioma si el cliente no habla español y el idioma del cliente
233
- console.time('getPreferredLanguageForChat');
234
231
  const { textSpanish, textPreferredLanguage, preferredLanguage } = yield getPreferredLanguageForChat({
235
232
  text,
236
233
  idCliente,
237
234
  isClient,
238
235
  });
239
- console.timeEnd('getPreferredLanguageForChat');
240
236
  // Enviado cuando es un mensaje de comentario sobre intelligence
241
237
  if (newMessage) {
242
238
  type = 6;
243
239
  idWorkout = newMessage.idWorkout;
244
240
  }
245
- console.time('query');
246
241
  const [message] = yield (0, index_1.query)('INSERT INTO [CHAT MESSAGE] ([ID CLIENTE], [ID SENDER], [TEXT], [TEXT PREFERRED LANGUAGE], [PREFERRED LANGUAGE], [REPLY MESSAGE ID], [ID WORKOUT], [TYPE]) VALUES (?, ?, ?, ?, ?, ?, ?, ?) RETURNING [ID]', [isClient ? userid : idCliente, userid, textSpanish, textPreferredLanguage, preferredLanguage, replyMessageId, idWorkout, type]);
247
- console.timeEnd('query');
248
242
  res.send({ idMessage: message.id, text: textSpanish });
249
243
  if (!isClient) {
250
244
  sendNotification({
@@ -414,7 +408,6 @@ const cambiarTonoEntrenadorNeutro = (text, idCliente) => __awaiter(void 0, void
414
408
  if (idCliente !== 'sJzhGqaJcddq96x80hZAlPJ6pET2')
415
409
  return text;
416
410
  try {
417
- console.time('sendPrompt');
418
411
  const textCorregido = yield (0, prompt_1.sendPrompt)(`
419
412
  Actúa como un sistema automático de corrección y estandarización de texto para una aplicación de fitness. Tu única función es procesar un mensaje y devolver una única versión mejorada.
420
413
 
@@ -441,8 +434,6 @@ Sigue estas reglas estrictamente:
441
434
  **Texto Original:** ${text}
442
435
  **Texto Corregido:**
443
436
  `);
444
- console.log('textCorregido', textCorregido);
445
- console.timeEnd('sendPrompt');
446
437
  return textCorregido;
447
438
  }
448
439
  catch (error) {
@@ -1 +1 @@
1
- {"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../../../../../src/chat/api/conversation.ts"],"names":[],"mappings":"AAmBA,QAAA,MAAM,iBAAiB,0BAA2B,GAAG,SAuBpD,CAAC;AA2cF,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
1
+ {"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../../../../../src/chat/api/conversation.ts"],"names":[],"mappings":"AAmBA,QAAA,MAAM,iBAAiB,0BAA2B,GAAG,SAuBpD,CAAC;AAkcF,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@runnerpro/backend",
3
- "version": "1.13.37",
3
+ "version": "1.13.38",
4
4
  "description": "A collection of common backend functions",
5
5
  "exports": {
6
6
  ".": "./lib/cjs/index.js"