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.mjs
CHANGED
|
@@ -31911,7 +31911,7 @@ async function prepareAnthropicPayload(payload) {
|
|
|
31911
31911
|
});
|
|
31912
31912
|
}
|
|
31913
31913
|
for (const file of message.files || []) {
|
|
31914
|
-
if (!file.
|
|
31914
|
+
if (!file.mimeType.startsWith("image")) {
|
|
31915
31915
|
console.warn(
|
|
31916
31916
|
"Anthropic API does not support non-image file types. Skipping file."
|
|
31917
31917
|
);
|
|
@@ -31923,22 +31923,22 @@ async function prepareAnthropicPayload(payload) {
|
|
|
31923
31923
|
source: {
|
|
31924
31924
|
type: "base64",
|
|
31925
31925
|
media_type: "image/png",
|
|
31926
|
-
data: await getNormalizedBase64PNG(file.url, file.
|
|
31926
|
+
data: await getNormalizedBase64PNG(file.url, file.mimeType)
|
|
31927
31927
|
}
|
|
31928
31928
|
});
|
|
31929
31929
|
} else if (file.data) {
|
|
31930
31930
|
if (!["image/png", "image/jpeg", "image/gif", "image/webp"].includes(
|
|
31931
|
-
file.
|
|
31931
|
+
file.mimeType
|
|
31932
31932
|
)) {
|
|
31933
31933
|
throw new Error(
|
|
31934
|
-
"Invalid image
|
|
31934
|
+
"Invalid image mimeType. Supported types are: image/png, image/jpeg, image/gif, image/webp"
|
|
31935
31935
|
);
|
|
31936
31936
|
}
|
|
31937
31937
|
anthropicContentBlocks.push({
|
|
31938
31938
|
type: "image",
|
|
31939
31939
|
source: {
|
|
31940
31940
|
type: "base64",
|
|
31941
|
-
media_type: file.
|
|
31941
|
+
media_type: file.mimeType,
|
|
31942
31942
|
data: file.data
|
|
31943
31943
|
}
|
|
31944
31944
|
});
|
|
@@ -31969,7 +31969,7 @@ async function prepareOpenAIPayload(payload) {
|
|
|
31969
31969
|
});
|
|
31970
31970
|
}
|
|
31971
31971
|
for (const file of message.files || []) {
|
|
31972
|
-
if (!file.
|
|
31972
|
+
if (!file.mimeType.startsWith("image")) {
|
|
31973
31973
|
console.warn(
|
|
31974
31974
|
"OpenAI API does not support non-image file types. Skipping file."
|
|
31975
31975
|
);
|
|
@@ -31981,7 +31981,7 @@ async function prepareOpenAIPayload(payload) {
|
|
|
31981
31981
|
image_url: {
|
|
31982
31982
|
url: `data:image/png;base64,${await getNormalizedBase64PNG(
|
|
31983
31983
|
file.url,
|
|
31984
|
-
file.
|
|
31984
|
+
file.mimeType
|
|
31985
31985
|
)}`
|
|
31986
31986
|
}
|
|
31987
31987
|
});
|
|
@@ -31989,7 +31989,7 @@ async function prepareOpenAIPayload(payload) {
|
|
|
31989
31989
|
openAIContentBlocks.push({
|
|
31990
31990
|
type: "image_url",
|
|
31991
31991
|
image_url: {
|
|
31992
|
-
url: `data:${file.
|
|
31992
|
+
url: `data:${file.mimeType};base64,${file.data}`
|
|
31993
31993
|
}
|
|
31994
31994
|
});
|
|
31995
31995
|
}
|