@blank-utils/llm 0.3.15 → 0.3.17

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.
@@ -1149,10 +1149,14 @@ var DEFAULT_SYSTEM_PROMPT = `You are a helpful AI assistant.
1149
1149
  - You can use Code Blocks with language syntax highlighting.
1150
1150
  - You can use Mermaid diagrams to visualize structured data, processes, and architectures.
1151
1151
  - IMPORTANT: ALWAYS use exactly \`\`\`mermaid as the language tag. NEVER use \`\`\`mer, \`\`\`mmd, etc.
1152
+ - IMPORTANT: You MUST specify a valid Mermaid diagram type immediately after the tag (e.g., \`graph TD\`, \`flowchart LR\`, \`sequenceDiagram\`, \`stateDiagram\`, \`classDiagram\`).
1153
+ - Do not invent ad-hoc pseudo-code formats. Use strict Mermaid syntax. Node definitions look like: \`A[Node Title] --> B(Other Title)\`.
1152
1154
  - For example:
1153
1155
  \`\`\`mermaid
1154
1156
  graph TD
1155
- A --> B
1157
+ A[Start of testing] --> B{Is valid?}
1158
+ B -- Yes --> C[Continue]
1159
+ B -- No --> D[Error]
1156
1160
  \`\`\`
1157
1161
  - You can use LaTeX math ($$ ... $$).`;
1158
1162
  var ALL_MODELS = { ...WEBLLM_MODELS, ...TRANSFORMERS_MODELS };
@@ -1308,7 +1312,11 @@ function Chat({
1308
1312
  abortRef.current = false;
1309
1313
  const apiMessages = [];
1310
1314
  if (systemPrompt) {
1311
- apiMessages.push({ role: "system", content: systemPrompt });
1315
+ const finalSystemPrompt = systemPrompt !== DEFAULT_SYSTEM_PROMPT ? `${DEFAULT_SYSTEM_PROMPT}
1316
+
1317
+ Additional instructions:
1318
+ ${systemPrompt}` : systemPrompt;
1319
+ apiMessages.push({ role: "system", content: finalSystemPrompt });
1312
1320
  }
1313
1321
  currentMessages.forEach((m) => {
1314
1322
  let content = m.content;
package/dist/index.js CHANGED
@@ -26,7 +26,7 @@ import {
26
26
  useCompletion,
27
27
  useLLM,
28
28
  useStream
29
- } from "./chunk-BA2O74FQ.js";
29
+ } from "./chunk-CU46QZJ4.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-BA2O74FQ.js";
12
+ } from "../chunk-CU46QZJ4.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.3.15",
3
+ "version": "0.3.17",
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",