190proof 1.0.39 → 1.0.41

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.d.mts CHANGED
@@ -53,6 +53,7 @@ interface OpenAIConfig {
53
53
  deployment: string;
54
54
  apiVersion: string;
55
55
  apiKey: string;
56
+ endpoint?: string;
56
57
  }>;
57
58
  }
58
59
  interface AnthropicAIConfig {
package/dist/index.d.ts CHANGED
@@ -53,6 +53,7 @@ interface OpenAIConfig {
53
53
  deployment: string;
54
54
  apiVersion: string;
55
55
  apiKey: string;
56
+ endpoint?: string;
56
57
  }>;
57
58
  }
58
59
  interface AnthropicAIConfig {
package/dist/index.js CHANGED
@@ -31586,7 +31586,12 @@ async function callOpenAIStream(identifier, openAiPayload, openAiConfig, chunkTi
31586
31586
  );
31587
31587
  }
31588
31588
  const azureConfig = openAiConfig.modelConfigMap[model];
31589
- const endpoint = `${openAiConfig.baseUrl}/azure-openai/${azureConfig.resource}/${azureConfig.deployment}/chat/completions?api-version=${azureConfig.apiVersion}`;
31589
+ let endpoint;
31590
+ if (azureConfig.endpoint) {
31591
+ endpoint = `${azureConfig.endpoint}/${azureConfig.deployment}/chat/completions?api-version=${azureConfig.apiVersion}`;
31592
+ } else {
31593
+ endpoint = `${openAiConfig.baseUrl}/azure-openai/${azureConfig.resource}/${azureConfig.deployment}/chat/completions?api-version=${azureConfig.apiVersion}`;
31594
+ }
31590
31595
  try {
31591
31596
  const stringifiedPayload = JSON.stringify({
31592
31597
  ...openAiPayload,
@@ -31945,6 +31950,10 @@ async function prepareGoogleAIPayload(payload) {
31945
31950
  } : void 0
31946
31951
  };
31947
31952
  for (const message of payload.messages) {
31953
+ if (message.role === "system") {
31954
+ preparedPayload.systemInstruction = message.content;
31955
+ continue;
31956
+ }
31948
31957
  const googleAIContentParts = [];
31949
31958
  if (message.content) {
31950
31959
  googleAIContentParts.push({
@@ -31982,7 +31991,7 @@ async function prepareGoogleAIPayload(payload) {
31982
31991
  }
31983
31992
  }
31984
31993
  preparedPayload.messages.push({
31985
- role: message.role === "user" ? "user" : "model",
31994
+ role: message.role === "assistant" ? "model" : message.role,
31986
31995
  parts: googleAIContentParts
31987
31996
  });
31988
31997
  }
@@ -31993,7 +32002,8 @@ async function callGoogleAI(identifier, payload) {
31993
32002
  const genAI = new GoogleGenerativeAI(process.env.GEMINI_API_KEY);
31994
32003
  const model = genAI.getGenerativeModel({
31995
32004
  model: payload.model,
31996
- tools: payload.tools
32005
+ tools: payload.tools,
32006
+ systemInstruction: payload.systemInstruction
31997
32007
  });
31998
32008
  const history = payload.messages.slice(0, -1);
31999
32009
  const lastMessage = payload.messages.slice(-1)[0];