@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 =
|
|
1500
|
+
prefix = `
|
|
1501
|
+
|
|
1502
|
+
\u{1F4C4} SVG Source Code (${img.name}):
|
|
1501
1503
|
`;
|
|
1502
1504
|
} else if (!isVisionModel2(modelId || "")) {
|
|
1503
|
-
prefix =
|
|
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 +=
|
|
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
|
|
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
|
|
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
package/dist/react/index.js
CHANGED
package/package.json
CHANGED