@runnerpro/backend 1.16.3 → 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.
package/lib/cjs/prompt/index.js
CHANGED
|
@@ -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
|
|
@@ -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,
|
|
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"}
|