dsh-think-translate 1.0.1 → 1.0.2
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/lib/client.js +14 -2
- package/lib/index.js +5 -5
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -975,9 +975,21 @@ window.__ModuleLoader__.load({
|
|
|
975
975
|
createElement("select", {
|
|
976
976
|
className: "xl-sel", value: cfg.priority || "google",
|
|
977
977
|
onChange: function (e) {
|
|
978
|
-
var
|
|
978
|
+
var p = e.target.value;
|
|
979
|
+
var next = Object.assign({}, cfg, { priority: p });
|
|
979
980
|
setCfg(next);
|
|
980
|
-
|
|
981
|
+
// Selecting the local model must also enable the openai
|
|
982
|
+
// provider — priority and enabled are independent fields,
|
|
983
|
+
// and a disabled provider is silently skipped by the chain
|
|
984
|
+
// (falls back to google), which confused users (2026-08-25).
|
|
985
|
+
var patch = { priority: p };
|
|
986
|
+
if (p === "openai" && cfg.providers && cfg.providers.openai && !cfg.providers.openai.enabled) {
|
|
987
|
+
patch.providers = { openai: { enabled: true } };
|
|
988
|
+
}
|
|
989
|
+
fetch("/_xlate/config", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(patch) })
|
|
990
|
+
.then(function (r) { return r.json(); })
|
|
991
|
+
.then(function (c) { setCfg(c); })
|
|
992
|
+
.catch(function () {});
|
|
981
993
|
}
|
|
982
994
|
}, priorities.map(function (p) {
|
|
983
995
|
return createElement("option", { key: p, value: p }, (t.labels[p] || p));
|
package/lib/index.js
CHANGED
|
@@ -21,16 +21,16 @@ export const inject = ['webServer', 'subprocess', 'timer']
|
|
|
21
21
|
|
|
22
22
|
const CONFIG_PATH = fileURLToPath(new URL('./config.json', import.meta.url))
|
|
23
23
|
|
|
24
|
-
// Defaults:
|
|
25
|
-
//
|
|
26
|
-
//
|
|
27
|
-
//
|
|
24
|
+
// Defaults: local model (Ollama) enabled from the start — the chain is
|
|
25
|
+
// fail-open, so if Ollama is down it falls back to google/bing. Selecting the
|
|
26
|
+
// local model in the UI also re-enables the provider (priority and enabled
|
|
27
|
+
// are independent fields; a disabled provider is silently skipped).
|
|
28
28
|
const DEFAULT_CONFIG = {
|
|
29
29
|
priority: 'google',
|
|
30
30
|
providers: {
|
|
31
31
|
google: { enabled: true },
|
|
32
32
|
bing: { enabled: true },
|
|
33
|
-
openai: { enabled:
|
|
33
|
+
openai: { enabled: true, baseURL: 'http://localhost:11434/v1', model: 'qwen2.5:7b-instruct', apiKey: 'ollama-local' },
|
|
34
34
|
},
|
|
35
35
|
}
|
|
36
36
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-think-translate",
|
|
3
3
|
"description": "Display-layer translation for the DSH web app: thinking chain, task cards, and optional answer text, in 8 target languages (local Ollama / Google / Bing, fail-open)",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.2",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"exports": {
|