@eclipse-docks/extension-webllm 0.7.127 → 0.7.132
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.
- package/dist/{i18n.de-CQxA5kmG.js → i18n.de-1c_lhkQt.js} +1 -1
- package/dist/{i18n.de-CQxA5kmG.js.map → i18n.de-1c_lhkQt.js.map} +1 -1
- package/dist/{i18n.en-BIC1ZmXn.js → i18n.en-9kAjUGx0.js} +1 -1
- package/dist/{i18n.en-BIC1ZmXn.js.map → i18n.en-9kAjUGx0.js.map} +1 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/{webllmservice-Bdz7vrud.js → webllmservice-lr842hZg.js} +1 -1
- package/dist/{webllmservice-Bdz7vrud.js.map → webllmservice-lr842hZg.js.map} +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18n.de-
|
|
1
|
+
{"version":3,"file":"i18n.de-1c_lhkQt.js","names":[],"sources":["../src/i18n.de.json"],"sourcesContent":["{\n \"EXT_WEBLLM_NAME\": \"WebLLM\",\n \"EXT_WEBLLM_DESC\": \"LLM-Inferenz im Browser\"\n}\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18n.en-
|
|
1
|
+
{"version":3,"file":"i18n.en-9kAjUGx0.js","names":[],"sources":["../src/i18n.en.json"],"sourcesContent":["{\n \"EXT_WEBLLM_NAME\": \"WebLLM\",\n \"EXT_WEBLLM_DESC\": \"In-Browser LLM inference\"\n}\n"],"mappings":""}
|
package/dist/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { extensionRegistry, i18n } from "@eclipse-docks/core";
|
|
2
2
|
import pkg from "../package.json";
|
|
3
3
|
//#region src/index.ts
|
|
4
|
-
var t = await i18n(/*
|
|
5
|
-
"./i18n.de.json": () => import("./i18n.de-
|
|
6
|
-
"./i18n.en.json": () => import("./i18n.en-
|
|
4
|
+
var t = await i18n(/* #__PURE__ */ Object.assign({
|
|
5
|
+
"./i18n.de.json": () => import("./i18n.de-1c_lhkQt.js"),
|
|
6
|
+
"./i18n.en.json": () => import("./i18n.en-9kAjUGx0.js")
|
|
7
7
|
}), true);
|
|
8
8
|
extensionRegistry.registerExtension({
|
|
9
9
|
id: pkg.name,
|
|
10
10
|
name: t.EXT_WEBLLM_NAME,
|
|
11
11
|
description: t.EXT_WEBLLM_DESC,
|
|
12
|
-
loader: () => import("./webllmservice-
|
|
12
|
+
loader: () => import("./webllmservice-lr842hZg.js"),
|
|
13
13
|
icon: "robot",
|
|
14
14
|
experimental: true
|
|
15
15
|
});
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["import { extensionRegistry, i18n } from '@eclipse-docks/core';\nimport pkg from '../package.json';\n\nconst t = await i18n(import.meta.glob('./i18n*.json'), true);\n\nextensionRegistry.registerExtension({\n id: pkg.name,\n name: t.EXT_WEBLLM_NAME,\n description: t.EXT_WEBLLM_DESC,\n loader: () => import(\"./webllmservice\"),\n icon: \"robot\",\n experimental: true,\n\n});\n"],"mappings":";;;AAGA,IAAM,IAAI,MAAM,KAAK,uBAAA,OAAA;CAAA,wBAAA,OAAA;CAAA,wBAAA,OAAA;CAAA,
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["import { extensionRegistry, i18n } from '@eclipse-docks/core';\nimport pkg from '../package.json';\n\nconst t = await i18n(import.meta.glob('./i18n*.json'), true);\n\nextensionRegistry.registerExtension({\n id: pkg.name,\n name: t.EXT_WEBLLM_NAME,\n description: t.EXT_WEBLLM_DESC,\n loader: () => import(\"./webllmservice\"),\n icon: \"robot\",\n experimental: true,\n\n});\n"],"mappings":";;;AAGA,IAAM,IAAI,MAAM,KAAK,uBAAA,OAAA;CAAA,wBAAA,OAAA;CAAA,wBAAA,OAAA;AAAA,CAAA,GAAkC,IAAI;AAE3D,kBAAkB,kBAAkB;CAClC,IAAI,IAAI;CACR,MAAM,EAAE;CACR,aAAa,EAAE;CACf,cAAc,OAAO;CACrB,MAAM;CACN,cAAc;AAEhB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webllmservice-
|
|
1
|
+
{"version":3,"file":"webllmservice-lr842hZg.js","names":[],"sources":["../src/webllmservice.ts"],"sourcesContent":["import {ChatCompletionMessageParam, MLCEngine} from \"@mlc-ai/web-llm\";\nimport { createLogger } from \"@eclipse-docks/core\";\nimport type {ChatMessage, ChatProvider, StreamChunk} from \"@eclipse-docks/extension-ai-system/api\";\n\nconst logger = createLogger('WebLLM');\nimport type {IProvider, StreamingParams, CompletionParams} from \"@eclipse-docks/extension-ai-system/api\";\nimport {aiService} from \"@eclipse-docks/extension-ai-system/api\";\n\nclass WebLLMProvider implements IProvider {\n name = \"webllm\";\n private engine?: MLCEngine;\n\n canHandle(chatProvider: ChatProvider): boolean {\n return chatProvider.name === \"webllm\";\n }\n\n private async init(model: string, parameters?: any): Promise<void> {\n if (this.engine) return;\n \n const initProgressCallback = (progress: any) => {\n logger.debug(\"Model loading progress:\", progress);\n };\n\n this.engine = new MLCEngine({initProgressCallback});\n await this.engine.reload(model, parameters);\n }\n\n async *stream(params: StreamingParams): AsyncIterable<StreamChunk> {\n if (!this.engine) {\n await this.init(params.model, params.chatConfig.parameters);\n }\n \n const internalMessages = params.messages.map((message) => {\n return {...message} as ChatCompletionMessageParam;\n });\n \n const result = await this.engine!.chat.completions.create({\n messages: internalMessages\n });\n \n const message = result.choices[0].message as ChatMessage;\n \n if (message.content) {\n for (const char of message.content) {\n yield {\n type: 'token',\n content: char\n };\n }\n }\n \n yield {\n type: 'done',\n content: ''\n };\n }\n\n async complete(params: CompletionParams): Promise<ChatMessage> {\n if (!this.engine) {\n await this.init(params.model, params.chatConfig.parameters);\n }\n \n const internalMessages = params.messages.map((message) => {\n return {...message} as ChatCompletionMessageParam;\n });\n \n const result = await this.engine!.chat.completions.create({\n messages: internalMessages\n });\n \n return result.choices[0].message as ChatMessage;\n }\n}\n\nexport default () => {\n aiService.registerStreamingFetcher(new WebLLMProvider());\n}"],"mappings":";;;;AAIA,IAAM,SAAS,aAAa,QAAQ;AAIpC,IAAM,iBAAN,MAA0C;;EAC/B,KAAA,OAAA;;CAGP,UAAU,cAAqC;EAC3C,OAAO,aAAa,SAAS;CACjC;CAEA,MAAc,KAAK,OAAe,YAAiC;EAC/D,IAAI,KAAK,QAAQ;EAEjB,MAAM,wBAAwB,aAAkB;GAC5C,OAAO,MAAM,2BAA2B,QAAQ;EACpD;EAEA,KAAK,SAAS,IAAI,UAAU,EAAC,qBAAoB,CAAC;EAClD,MAAM,KAAK,OAAO,OAAO,OAAO,UAAU;CAC9C;CAEA,OAAO,OAAO,QAAqD;EAC/D,IAAI,CAAC,KAAK,QACN,MAAM,KAAK,KAAK,OAAO,OAAO,OAAO,WAAW,UAAU;EAG9D,MAAM,mBAAmB,OAAO,SAAS,KAAK,YAAY;GACtD,OAAO,EAAC,GAAG,QAAO;EACtB,CAAC;EAMD,MAAM,WAAU,MAJK,KAAK,OAAQ,KAAK,YAAY,OAAO,EACtD,UAAU,iBACd,CAAC,EAAA,CAEsB,QAAQ,EAAE,CAAC;EAElC,IAAI,QAAQ,SACR,KAAK,MAAM,QAAQ,QAAQ,SACvB,MAAM;GACF,MAAM;GACN,SAAS;EACb;EAIR,MAAM;GACF,MAAM;GACN,SAAS;EACb;CACJ;CAEA,MAAM,SAAS,QAAgD;EAC3D,IAAI,CAAC,KAAK,QACN,MAAM,KAAK,KAAK,OAAO,OAAO,OAAO,WAAW,UAAU;EAG9D,MAAM,mBAAmB,OAAO,SAAS,KAAK,YAAY;GACtD,OAAO,EAAC,GAAG,QAAO;EACtB,CAAC;EAMD,QAAO,MAJc,KAAK,OAAQ,KAAK,YAAY,OAAO,EACtD,UAAU,iBACd,CAAC,EAAA,CAEa,QAAQ,EAAE,CAAC;CAC7B;AACJ;AAEA,IAAA,8BAAqB;CACjB,UAAU,yBAAyB,IAAI,eAAe,CAAC;AAC3D"}
|