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 CHANGED
@@ -31945,6 +31945,10 @@ async function prepareGoogleAIPayload(payload) {
31945
31945
  } : void 0
31946
31946
  };
31947
31947
  for (const message of payload.messages) {
31948
+ if (message.role === "system") {
31949
+ preparedPayload.systemInstruction = message.content;
31950
+ continue;
31951
+ }
31948
31952
  const googleAIContentParts = [];
31949
31953
  if (message.content) {
31950
31954
  googleAIContentParts.push({
@@ -31982,7 +31986,7 @@ async function prepareGoogleAIPayload(payload) {
31982
31986
  }
31983
31987
  }
31984
31988
  preparedPayload.messages.push({
31985
- role: message.role === "user" ? "user" : "model",
31989
+ role: message.role === "assistant" ? "model" : message.role,
31986
31990
  parts: googleAIContentParts
31987
31991
  });
31988
31992
  }
@@ -31993,7 +31997,8 @@ async function callGoogleAI(identifier, payload) {
31993
31997
  const genAI = new GoogleGenerativeAI(process.env.GEMINI_API_KEY);
31994
31998
  const model = genAI.getGenerativeModel({
31995
31999
  model: payload.model,
31996
- tools: payload.tools
32000
+ tools: payload.tools,
32001
+ systemInstruction: payload.systemInstruction
31997
32002
  });
31998
32003
  const history = payload.messages.slice(0, -1);
31999
32004
  const lastMessage = payload.messages.slice(-1)[0];