@blank-utils/llm 0.3.14 → 0.3.16
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.
|
@@ -1115,6 +1115,7 @@ function cn(...inputs) {
|
|
|
1115
1115
|
}
|
|
1116
1116
|
function sanitizeMarkdownLanguageBlocks(markdown) {
|
|
1117
1117
|
let cleanMarkdown = markdown;
|
|
1118
|
+
cleanMarkdown = cleanMarkdown.replace(/```([a-zA-Z0-9+#-]*)[_|█▋]+[ \t]*(?:\n|$)/gi, "```$1\n");
|
|
1118
1119
|
cleanMarkdown = cleanMarkdown.replace(/```[ \t]*(?:mer(?:m|ma|mai)?|mmd|graphviz)[ \t]*(?:\n|$)/gi, "```mermaid\n");
|
|
1119
1120
|
cleanMarkdown = cleanMarkdown.replace(/```[ \t]*(?:m|me)[ \t]*$/gi, "```mermaid\n");
|
|
1120
1121
|
cleanMarkdown = cleanMarkdown.replace(/```[ \t]*(?:\n|$)[ \t]*(graph(?: TB| TD| BT| RL| LR)|sequenceDiagram|classDiagram|stateDiagram|pie(?: title)?|flowchart|gantt|journey)/gi, "```mermaid\n$1");
|
|
@@ -1148,10 +1149,14 @@ var DEFAULT_SYSTEM_PROMPT = `You are a helpful AI assistant.
|
|
|
1148
1149
|
- You can use Code Blocks with language syntax highlighting.
|
|
1149
1150
|
- You can use Mermaid diagrams to visualize structured data, processes, and architectures.
|
|
1150
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)\`.
|
|
1151
1154
|
- For example:
|
|
1152
1155
|
\`\`\`mermaid
|
|
1153
1156
|
graph TD
|
|
1154
|
-
A --> B
|
|
1157
|
+
A[Start of testing] --> B{Is valid?}
|
|
1158
|
+
B -- Yes --> C[Continue]
|
|
1159
|
+
B -- No --> D[Error]
|
|
1155
1160
|
\`\`\`
|
|
1156
1161
|
- You can use LaTeX math ($$ ... $$).`;
|
|
1157
1162
|
var ALL_MODELS = { ...WEBLLM_MODELS, ...TRANSFORMERS_MODELS };
|
package/dist/index.js
CHANGED
package/dist/react/index.js
CHANGED
package/package.json
CHANGED