190proof 1.0.39 → 1.0.40
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.js +7 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -31939,6 +31939,10 @@ async function prepareGoogleAIPayload(payload) {
|
|
|
31939
31939
|
} : void 0
|
|
31940
31940
|
};
|
|
31941
31941
|
for (const message of payload.messages) {
|
|
31942
|
+
if (message.role === "system") {
|
|
31943
|
+
preparedPayload.systemInstruction = message.content;
|
|
31944
|
+
continue;
|
|
31945
|
+
}
|
|
31942
31946
|
const googleAIContentParts = [];
|
|
31943
31947
|
if (message.content) {
|
|
31944
31948
|
googleAIContentParts.push({
|
|
@@ -31976,7 +31980,7 @@ async function prepareGoogleAIPayload(payload) {
|
|
|
31976
31980
|
}
|
|
31977
31981
|
}
|
|
31978
31982
|
preparedPayload.messages.push({
|
|
31979
|
-
role: message.role === "
|
|
31983
|
+
role: message.role === "assistant" ? "model" : message.role,
|
|
31980
31984
|
parts: googleAIContentParts
|
|
31981
31985
|
});
|
|
31982
31986
|
}
|
|
@@ -31987,7 +31991,8 @@ async function callGoogleAI(identifier, payload) {
|
|
|
31987
31991
|
const genAI = new GoogleGenerativeAI(process.env.GEMINI_API_KEY);
|
|
31988
31992
|
const model = genAI.getGenerativeModel({
|
|
31989
31993
|
model: payload.model,
|
|
31990
|
-
tools: payload.tools
|
|
31994
|
+
tools: payload.tools,
|
|
31995
|
+
systemInstruction: payload.systemInstruction
|
|
31991
31996
|
});
|
|
31992
31997
|
const history = payload.messages.slice(0, -1);
|
|
31993
31998
|
const lastMessage = payload.messages.slice(-1)[0];
|