190proof 1.0.38 → 1.0.39

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
@@ -9,7 +9,8 @@ declare enum GPTModel {
9
9
  GPT35_0125 = "gpt-3.5-turbo-0125",
10
10
  GPT4_1106_PREVIEW = "gpt-4-1106-preview",
11
11
  GPT4_0125_PREVIEW = "gpt-4-0125-preview",
12
- GPT4_0409 = "gpt-4-turbo-2024-04-09"
12
+ GPT4_0409 = "gpt-4-turbo-2024-04-09",
13
+ GPT4O = "gpt-4o"
13
14
  }
14
15
  declare enum GroqModel {
15
16
  LLAMA_3_70B_8192 = "llama3-70b-8192"
package/dist/index.d.ts CHANGED
@@ -9,7 +9,8 @@ declare enum GPTModel {
9
9
  GPT35_0125 = "gpt-3.5-turbo-0125",
10
10
  GPT4_1106_PREVIEW = "gpt-4-1106-preview",
11
11
  GPT4_0125_PREVIEW = "gpt-4-0125-preview",
12
- GPT4_0409 = "gpt-4-turbo-2024-04-09"
12
+ GPT4_0409 = "gpt-4-turbo-2024-04-09",
13
+ GPT4O = "gpt-4o"
13
14
  }
14
15
  declare enum GroqModel {
15
16
  LLAMA_3_70B_8192 = "llama3-70b-8192"
package/dist/index.js CHANGED
@@ -27035,6 +27035,7 @@ var GPTModel = /* @__PURE__ */ ((GPTModel2) => {
27035
27035
  GPTModel2["GPT4_1106_PREVIEW"] = "gpt-4-1106-preview";
27036
27036
  GPTModel2["GPT4_0125_PREVIEW"] = "gpt-4-0125-preview";
27037
27037
  GPTModel2["GPT4_0409"] = "gpt-4-turbo-2024-04-09";
27038
+ GPTModel2["GPT4O"] = "gpt-4o";
27038
27039
  return GPTModel2;
27039
27040
  })(GPTModel || {});
27040
27041
  var GroqModel = /* @__PURE__ */ ((GroqModel2) => {
@@ -31713,7 +31714,7 @@ async function callOpenAIStream(identifier, openAiPayload, openAiConfig, chunkTi
31713
31714
  );
31714
31715
  const error = new Error("Stream error: OpenAI error");
31715
31716
  error.data = json.error;
31716
- error.requestBody = JSON.stringify(openAiPayload);
31717
+ error.requestBody = openAiPayload;
31717
31718
  throw error;
31718
31719
  }
31719
31720
  if (chunkIndex !== 0)
@@ -32134,26 +32135,27 @@ async function prepareOpenAIPayload(payload) {
32134
32135
  });
32135
32136
  }
32136
32137
  for (const file of message.files || []) {
32137
- if (!((_b = file.mimeType) == null ? void 0 : _b.startsWith("image"))) {
32138
+ if ((_b = file.mimeType) == null ? void 0 : _b.startsWith("image")) {
32139
+ if (file.url) {
32140
+ openAIContentBlocks.push({
32141
+ type: "image_url",
32142
+ image_url: {
32143
+ url: file.url
32144
+ }
32145
+ });
32146
+ } else if (file.data) {
32147
+ openAIContentBlocks.push({
32148
+ type: "image_url",
32149
+ image_url: {
32150
+ url: `data:${file.mimeType};base64,${file.data}`
32151
+ }
32152
+ });
32153
+ }
32154
+ } else {
32138
32155
  console.warn(
32139
- "OpenAI API does not support non-image file types. Skipping file."
32156
+ "Skipping file. Type not supported by OpenAI API:",
32157
+ file.mimeType
32140
32158
  );
32141
- continue;
32142
- }
32143
- if (file.url) {
32144
- openAIContentBlocks.push({
32145
- type: "image_url",
32146
- image_url: {
32147
- url: file.url
32148
- }
32149
- });
32150
- } else if (file.data) {
32151
- openAIContentBlocks.push({
32152
- type: "image_url",
32153
- image_url: {
32154
- url: `data:${file.mimeType};base64,${file.data}`
32155
- }
32156
- });
32157
32159
  }
32158
32160
  }
32159
32161
  preparedPayload.messages.push({