@blank-utils/llm 0.5.0 → 0.5.1
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.
|
@@ -1215,33 +1215,19 @@ ${systemPrompt}` : systemPrompt;
|
|
|
1215
1215
|
currentMessages.forEach((m) => {
|
|
1216
1216
|
let content = m.content;
|
|
1217
1217
|
if (m.role === "user" && m.images && m.images.length > 0 && isVisionModel(modelId || "")) {
|
|
1218
|
-
|
|
1219
|
-
content
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
];
|
|
1223
|
-
} else {
|
|
1224
|
-
content = [
|
|
1225
|
-
...m.images.map((img) => ({ type: "image", image: img.dataUrl })),
|
|
1226
|
-
{ type: "text", text: m.content }
|
|
1227
|
-
];
|
|
1228
|
-
}
|
|
1218
|
+
content = [
|
|
1219
|
+
{ type: "text", text: m.content },
|
|
1220
|
+
...m.images.map((img) => ({ type: "image_url", image_url: { url: img.dataUrl } }))
|
|
1221
|
+
];
|
|
1229
1222
|
}
|
|
1230
1223
|
apiMessages.push({ role: m.role, content });
|
|
1231
1224
|
});
|
|
1232
1225
|
let finalUserContent = userContent;
|
|
1233
1226
|
if (attachedImages.length > 0 && isVisionModel(modelId || "")) {
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
];
|
|
1239
|
-
} else {
|
|
1240
|
-
finalUserContent = [
|
|
1241
|
-
...attachedImages.map((img) => ({ type: "image", image: img.dataUrl })),
|
|
1242
|
-
{ type: "text", text: userContent }
|
|
1243
|
-
];
|
|
1244
|
-
}
|
|
1227
|
+
finalUserContent = [
|
|
1228
|
+
{ type: "text", text: userContent },
|
|
1229
|
+
...attachedImages.map((img) => ({ type: "image_url", image_url: { url: img.dataUrl } }))
|
|
1230
|
+
];
|
|
1245
1231
|
}
|
|
1246
1232
|
apiMessages.push({ role: "user", content: finalUserContent });
|
|
1247
1233
|
try {
|
package/dist/index.js
CHANGED
package/dist/react/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blank-utils/llm",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"description": "Run LLMs directly in your browser with WebGPU acceleration. Supports React hooks and eager background loading.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
},
|
|
102
102
|
"dependencies": {
|
|
103
103
|
"@huggingface/transformers": "^3.8.1",
|
|
104
|
-
"@mlc-ai/web-llm": "^0.2.
|
|
104
|
+
"@mlc-ai/web-llm": "^0.2.81",
|
|
105
105
|
"@streamdown/code": "^1.0.3",
|
|
106
106
|
"@streamdown/math": "^1.0.2",
|
|
107
107
|
"@streamdown/mermaid": "^1.0.2",
|