* fix(nitro): Update config for new nitro * fix(nitro): Update new name mapping * feat(nitro): Update new version d09bae4 * chore(nitro): Update windows to new version * fix: Update path to none Co-authored-by: Louis <133622055+louis-jan@users.noreply.github.com> * fix: Update inline conditional for binary selection re: platform Co-authored-by: Louis <133622055+louis-jan@users.noreply.github.com> * fix(nitro): Update port for nitro webserver --------- Co-authored-by: Louis <133622055+louis-jan@users.noreply.github.com>
28 lines
860 B
JavaScript
28 lines
860 B
JavaScript
const MODULE_PATH = "inference-plugin/dist/module.js";
|
|
|
|
const initModel = async (product) =>
|
|
new Promise(async (resolve) => {
|
|
if (window.electronAPI) {
|
|
window.electronAPI
|
|
.invokePluginFunc(MODULE_PATH, "initModel", product)
|
|
.then((res) => resolve(res));
|
|
}
|
|
});
|
|
|
|
const dispose = async () =>
|
|
new Promise(async (resolve) => {
|
|
if (window.electronAPI) {
|
|
window.electronAPI
|
|
.invokePluginFunc(MODULE_PATH, "dispose")
|
|
.then((res) => resolve(res));
|
|
}
|
|
});
|
|
const inferenceUrl = () => "http://localhost:3928/llama/chat_completion";
|
|
|
|
// Register all the above functions and objects with the relevant extension points
|
|
export function init({ register }) {
|
|
register("initModel", "initModel", initModel);
|
|
register("inferenceUrl", "inferenceUrl", inferenceUrl);
|
|
register("dispose", "dispose", dispose);
|
|
}
|