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 +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +21 -19
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +21 -19
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -27029,6 +27029,7 @@ var GPTModel = /* @__PURE__ */ ((GPTModel2) => {
|
|
|
27029
27029
|
GPTModel2["GPT4_1106_PREVIEW"] = "gpt-4-1106-preview";
|
|
27030
27030
|
GPTModel2["GPT4_0125_PREVIEW"] = "gpt-4-0125-preview";
|
|
27031
27031
|
GPTModel2["GPT4_0409"] = "gpt-4-turbo-2024-04-09";
|
|
27032
|
+
GPTModel2["GPT4O"] = "gpt-4o";
|
|
27032
27033
|
return GPTModel2;
|
|
27033
27034
|
})(GPTModel || {});
|
|
27034
27035
|
var GroqModel = /* @__PURE__ */ ((GroqModel2) => {
|
|
@@ -31707,7 +31708,7 @@ async function callOpenAIStream(identifier, openAiPayload, openAiConfig, chunkTi
|
|
|
31707
31708
|
);
|
|
31708
31709
|
const error = new Error("Stream error: OpenAI error");
|
|
31709
31710
|
error.data = json.error;
|
|
31710
|
-
error.requestBody =
|
|
31711
|
+
error.requestBody = openAiPayload;
|
|
31711
31712
|
throw error;
|
|
31712
31713
|
}
|
|
31713
31714
|
if (chunkIndex !== 0)
|
|
@@ -32128,26 +32129,27 @@ async function prepareOpenAIPayload(payload) {
|
|
|
32128
32129
|
});
|
|
32129
32130
|
}
|
|
32130
32131
|
for (const file of message.files || []) {
|
|
32131
|
-
if (
|
|
32132
|
+
if ((_b = file.mimeType) == null ? void 0 : _b.startsWith("image")) {
|
|
32133
|
+
if (file.url) {
|
|
32134
|
+
openAIContentBlocks.push({
|
|
32135
|
+
type: "image_url",
|
|
32136
|
+
image_url: {
|
|
32137
|
+
url: file.url
|
|
32138
|
+
}
|
|
32139
|
+
});
|
|
32140
|
+
} else if (file.data) {
|
|
32141
|
+
openAIContentBlocks.push({
|
|
32142
|
+
type: "image_url",
|
|
32143
|
+
image_url: {
|
|
32144
|
+
url: `data:${file.mimeType};base64,${file.data}`
|
|
32145
|
+
}
|
|
32146
|
+
});
|
|
32147
|
+
}
|
|
32148
|
+
} else {
|
|
32132
32149
|
console.warn(
|
|
32133
|
-
"
|
|
32150
|
+
"Skipping file. Type not supported by OpenAI API:",
|
|
32151
|
+
file.mimeType
|
|
32134
32152
|
);
|
|
32135
|
-
continue;
|
|
32136
|
-
}
|
|
32137
|
-
if (file.url) {
|
|
32138
|
-
openAIContentBlocks.push({
|
|
32139
|
-
type: "image_url",
|
|
32140
|
-
image_url: {
|
|
32141
|
-
url: file.url
|
|
32142
|
-
}
|
|
32143
|
-
});
|
|
32144
|
-
} else if (file.data) {
|
|
32145
|
-
openAIContentBlocks.push({
|
|
32146
|
-
type: "image_url",
|
|
32147
|
-
image_url: {
|
|
32148
|
-
url: `data:${file.mimeType};base64,${file.data}`
|
|
32149
|
-
}
|
|
32150
|
-
});
|
|
32151
32153
|
}
|
|
32152
32154
|
}
|
|
32153
32155
|
preparedPayload.messages.push({
|