Slash menu now lists the models.
Browse files- package-lock.json +2 -2
- package.json +1 -1
- src/app/init-milkdown.js +13 -14
package-lock.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
| 1 |
{
|
| 2 |
"name": "localm",
|
| 3 |
-
"version": "1.1.
|
| 4 |
"lockfileVersion": 3,
|
| 5 |
"requires": true,
|
| 6 |
"packages": {
|
| 7 |
"": {
|
| 8 |
"name": "localm",
|
| 9 |
-
"version": "1.1.
|
| 10 |
"license": "ISC",
|
| 11 |
"dependencies": {
|
| 12 |
"@huggingface/transformers": "^3.7.2",
|
|
|
|
| 1 |
{
|
| 2 |
"name": "localm",
|
| 3 |
+
"version": "1.1.15",
|
| 4 |
"lockfileVersion": 3,
|
| 5 |
"requires": true,
|
| 6 |
"packages": {
|
| 7 |
"": {
|
| 8 |
"name": "localm",
|
| 9 |
+
"version": "1.1.15",
|
| 10 |
"license": "ISC",
|
| 11 |
"dependencies": {
|
| 12 |
"@huggingface/transformers": "^3.7.2",
|
package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
{
|
| 2 |
"name": "localm",
|
| 3 |
-
"version": "1.1.
|
| 4 |
"description": "Chat application",
|
| 5 |
"scripts": {
|
| 6 |
"build": "esbuild src/index.js --target=es6 --bundle --sourcemap --outfile=./index.js --format=iife --external:fs --external:path --external:child_process --external:ws --external:katex/dist/katex.min.css",
|
|
|
|
| 1 |
{
|
| 2 |
"name": "localm",
|
| 3 |
+
"version": "1.1.16",
|
| 4 |
"description": "Chat application",
|
| 5 |
"scripts": {
|
| 6 |
"build": "esbuild src/index.js --target=es6 --bundle --sourcemap --outfile=./index.js --format=iife --external:fs --external:path --external:child_process --external:ws --external:katex/dist/katex.min.css",
|
src/app/init-milkdown.js
CHANGED
|
@@ -97,21 +97,20 @@ export async function initMilkdown({
|
|
| 97 |
image: null,
|
| 98 |
table: null,
|
| 99 |
math: null,
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
}
|
| 112 |
}
|
| 113 |
-
|
| 114 |
-
)
|
| 115 |
}
|
| 116 |
}
|
| 117 |
}
|
|
|
|
| 97 |
image: null,
|
| 98 |
table: null,
|
| 99 |
math: null,
|
| 100 |
+
},
|
| 101 |
+
// Use buildMenu API to inject dynamic items supported by Crepe
|
| 102 |
+
buildMenu: (groupBuilder) => {
|
| 103 |
+
// Put models under a dedicated group to avoid clashing with built-ins
|
| 104 |
+
const modelsGroup = groupBuilder.addGroup('models', 'Models');
|
| 105 |
+
availableModels.forEach((model) => {
|
| 106 |
+
modelsGroup.addItem(model.slashCommand, {
|
| 107 |
+
label: `${model.name} (${model.size})`,
|
| 108 |
+
icon: '🤖',
|
| 109 |
+
onRun: () => {
|
| 110 |
+
if (onSlashCommand) onSlashCommand(model.id);
|
|
|
|
| 111 |
}
|
| 112 |
+
});
|
| 113 |
+
});
|
| 114 |
}
|
| 115 |
}
|
| 116 |
}
|