@runnerpro/backend 1.16.2 → 1.16.4

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.
@@ -523,9 +523,7 @@ Sigue estas reglas estrictamente:
523
523
  **Texto Original:** ${text}
524
524
  **Texto Corregido:**
525
525
  `, 'LITE');
526
- // @ts-ignore
527
526
  textCorregido = textCorregido.replace(/[¡¿]/g, '');
528
- // @ts-ignore
529
527
  // Eliminar el último punto de las frases
530
528
  textCorregido = textCorregido.trim().replace(/\.$/, '');
531
529
  return textCorregido;
@@ -11,7 +11,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.sendPrompt = void 0;
13
13
  const vertexai_1 = require("@google-cloud/vertexai");
14
- function sendPrompt(prompt, model = 'FLASH') {
14
+ function sendPrompt(prompt, model = 'FLASH', systemPrompt = null) {
15
15
  var _a, _b, _c;
16
16
  return __awaiter(this, void 0, void 0, function* () {
17
17
  // Inicializa el cliente de Vertex AI
@@ -35,6 +35,10 @@ function sendPrompt(prompt, model = 'FLASH') {
35
35
  topP: 0.8,
36
36
  topK: 20,
37
37
  },
38
+ systemInstruction: systemPrompt ? {
39
+ role: 'system',
40
+ parts: [{ text: systemPrompt }],
41
+ } : undefined,
38
42
  });
39
43
  const resp = yield generativeModel.generateContent(prompt);
40
44
  // Early return si no hay candidates
@@ -46,7 +50,7 @@ function sendPrompt(prompt, model = 'FLASH') {
46
50
  if (!parts || parts.length === 0)
47
51
  return '';
48
52
  // Return del texto si existe
49
- return { text: ((_c = parts[0]) === null || _c === void 0 ? void 0 : _c.text) || '', modelGemini };
53
+ return ((_c = parts[0]) === null || _c === void 0 ? void 0 : _c.text) || '';
50
54
  });
51
55
  }
52
56
  exports.sendPrompt = sendPrompt;
@@ -1 +1 @@
1
- {"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../../../../../src/chat/api/conversation.ts"],"names":[],"mappings":"AAkBA,QAAA,MAAM,iBAAiB,0BAA2B,GAAG,SA0BpD,CAAC;AA6PF,QAAA,MAAM,gBAAgB;;;;mBAkBrB,CAAC;AAwRF,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,CAAC"}
1
+ {"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../../../../../src/chat/api/conversation.ts"],"names":[],"mappings":"AAkBA,QAAA,MAAM,iBAAiB,0BAA2B,GAAG,SA0BpD,CAAC;AA6PF,QAAA,MAAM,gBAAgB;;;;mBAkBrB,CAAC;AAsRF,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,CAAC"}
@@ -1,6 +1,3 @@
1
- declare function sendPrompt(prompt: string, model?: string): Promise<"" | {
2
- text: string;
3
- modelGemini: any;
4
- }>;
1
+ declare function sendPrompt(prompt: string, model?: string, systemPrompt?: string): Promise<string>;
5
2
  export { sendPrompt };
6
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/prompt/index.ts"],"names":[],"mappings":"AAEA,iBAAe,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,GAAE,MAAgB;;;GAmChE;AAED,OAAO,EAAE,UAAU,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/prompt/index.ts"],"names":[],"mappings":"AAEA,iBAAe,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,GAAE,MAAgB,EAAE,YAAY,GAAE,MAAa,mBAuC7F;AAED,OAAO,EAAE,UAAU,EAAE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@runnerpro/backend",
3
- "version": "1.16.2",
3
+ "version": "1.16.4",
4
4
  "description": "A collection of common backend functions",
5
5
  "exports": {
6
6
  ".": "./lib/cjs/index.js"