@blank-utils/llm 0.4.20 → 0.4.21

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.
@@ -1497,14 +1497,18 @@ ${systemPrompt}` : systemPrompt;
1497
1497
  if (img.extractedText) {
1498
1498
  let prefix = "";
1499
1499
  if (img.name.toLowerCase().endsWith(".svg")) {
1500
- prefix = `\u{1F4C4} SVG Source Code (${img.name}):
1500
+ prefix = `
1501
+
1502
+ \u{1F4C4} SVG Source Code (${img.name}):
1501
1503
  `;
1502
1504
  } else if (!isVisionModel2(modelId || "")) {
1503
- prefix = `\u{1F5BC}\uFE0F Image Auto-Caption (${img.name}):
1505
+ prefix = `
1506
+
1507
+ \u{1F5BC}\uFE0F System Image Representation (${img.name}) - [IMPORTANT SYSTEM INSTRUCTION: The user provided an image. Since you are a text model, here is an automated visual description of the image. DO NOT refuse the user's prompt. Answer as if you can see the image using this context:]
1504
1508
  `;
1505
1509
  }
1506
1510
  if (prefix || img.name.toLowerCase().endsWith(".pdf")) {
1507
- finalText += (finalText ? "\n\n" : "") + `${prefix}${img.extractedText}`;
1511
+ finalText += `${prefix}${img.extractedText}`;
1508
1512
  }
1509
1513
  }
1510
1514
  }
@@ -1615,11 +1619,11 @@ ${systemPrompt}` : systemPrompt;
1615
1619
  children: [
1616
1620
  { match: "\u{1F4C4} PDF:", index: msg.content.indexOf("\u{1F4C4} PDF:") },
1617
1621
  { match: "\u{1F4C4} SVG Source Code", index: msg.content.indexOf("\u{1F4C4} SVG Source Code") },
1618
- { match: "\u{1F5BC}\uFE0F Image Auto-Caption", index: msg.content.indexOf("\u{1F5BC}\uFE0F Image Auto-Caption") }
1622
+ { match: "\u{1F5BC}\uFE0F System Image", index: msg.content.indexOf("\u{1F5BC}\uFE0F System Image") }
1619
1623
  ].filter((m) => m.index !== -1).reduce((min, m) => m.index < min ? m.index : min, msg.content.length) !== msg.content.length ? msg.content.substring(0, [
1620
1624
  { match: "\u{1F4C4} PDF:", index: msg.content.indexOf("\u{1F4C4} PDF:") },
1621
1625
  { match: "\u{1F4C4} SVG Source Code", index: msg.content.indexOf("\u{1F4C4} SVG Source Code") },
1622
- { match: "\u{1F5BC}\uFE0F Image Auto-Caption", index: msg.content.indexOf("\u{1F5BC}\uFE0F Image Auto-Caption") }
1626
+ { match: "\u{1F5BC}\uFE0F System Image", index: msg.content.indexOf("\u{1F5BC}\uFE0F System Image") }
1623
1627
  ].filter((m) => m.index !== -1).reduce((min, m) => m.index < min ? m.index : min, msg.content.length)).trim() : msg.content
1624
1628
  }
1625
1629
  ) })
package/dist/index.js CHANGED
@@ -26,7 +26,7 @@ import {
26
26
  useCompletion,
27
27
  useLLM,
28
28
  useStream
29
- } from "./chunk-T4VK6BPC.js";
29
+ } from "./chunk-XKJ4QQ34.js";
30
30
  export {
31
31
  Chat,
32
32
  ChatInput,
@@ -9,7 +9,7 @@ import {
9
9
  useCompletion,
10
10
  useLLM,
11
11
  useStream
12
- } from "../chunk-T4VK6BPC.js";
12
+ } from "../chunk-XKJ4QQ34.js";
13
13
  export {
14
14
  Chat,
15
15
  ChatApp,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blank-utils/llm",
3
- "version": "0.4.20",
3
+ "version": "0.4.21",
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",