190proof 1.0.9 → 1.0.10
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 +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +8 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -8
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -31916,7 +31916,7 @@ async function prepareAnthropicPayload(payload) {
|
|
|
31916
31916
|
});
|
|
31917
31917
|
}
|
|
31918
31918
|
for (const file of message.files || []) {
|
|
31919
|
-
if (!file.
|
|
31919
|
+
if (!file.mimeType.startsWith("image")) {
|
|
31920
31920
|
console.warn(
|
|
31921
31921
|
"Anthropic API does not support non-image file types. Skipping file."
|
|
31922
31922
|
);
|
|
@@ -31928,22 +31928,22 @@ async function prepareAnthropicPayload(payload) {
|
|
|
31928
31928
|
source: {
|
|
31929
31929
|
type: "base64",
|
|
31930
31930
|
media_type: "image/png",
|
|
31931
|
-
data: await getNormalizedBase64PNG(file.url, file.
|
|
31931
|
+
data: await getNormalizedBase64PNG(file.url, file.mimeType)
|
|
31932
31932
|
}
|
|
31933
31933
|
});
|
|
31934
31934
|
} else if (file.data) {
|
|
31935
31935
|
if (!["image/png", "image/jpeg", "image/gif", "image/webp"].includes(
|
|
31936
|
-
file.
|
|
31936
|
+
file.mimeType
|
|
31937
31937
|
)) {
|
|
31938
31938
|
throw new Error(
|
|
31939
|
-
"Invalid image
|
|
31939
|
+
"Invalid image mimeType. Supported types are: image/png, image/jpeg, image/gif, image/webp"
|
|
31940
31940
|
);
|
|
31941
31941
|
}
|
|
31942
31942
|
anthropicContentBlocks.push({
|
|
31943
31943
|
type: "image",
|
|
31944
31944
|
source: {
|
|
31945
31945
|
type: "base64",
|
|
31946
|
-
media_type: file.
|
|
31946
|
+
media_type: file.mimeType,
|
|
31947
31947
|
data: file.data
|
|
31948
31948
|
}
|
|
31949
31949
|
});
|
|
@@ -31974,7 +31974,7 @@ async function prepareOpenAIPayload(payload) {
|
|
|
31974
31974
|
});
|
|
31975
31975
|
}
|
|
31976
31976
|
for (const file of message.files || []) {
|
|
31977
|
-
if (!file.
|
|
31977
|
+
if (!file.mimeType.startsWith("image")) {
|
|
31978
31978
|
console.warn(
|
|
31979
31979
|
"OpenAI API does not support non-image file types. Skipping file."
|
|
31980
31980
|
);
|
|
@@ -31986,7 +31986,7 @@ async function prepareOpenAIPayload(payload) {
|
|
|
31986
31986
|
image_url: {
|
|
31987
31987
|
url: `data:image/png;base64,${await getNormalizedBase64PNG(
|
|
31988
31988
|
file.url,
|
|
31989
|
-
file.
|
|
31989
|
+
file.mimeType
|
|
31990
31990
|
)}`
|
|
31991
31991
|
}
|
|
31992
31992
|
});
|
|
@@ -31994,7 +31994,7 @@ async function prepareOpenAIPayload(payload) {
|
|
|
31994
31994
|
openAIContentBlocks.push({
|
|
31995
31995
|
type: "image_url",
|
|
31996
31996
|
image_url: {
|
|
31997
|
-
url: `data:${file.
|
|
31997
|
+
url: `data:${file.mimeType};base64,${file.data}`
|
|
31998
31998
|
}
|
|
31999
31999
|
});
|
|
32000
32000
|
}
|