@aria-framework/ai 0.14.1 → 0.14.3
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/index.js +6 -1
- package/package.json +3 -2
- package/providerStore.js +10 -0
- package/providers/lmx.js +0 -0
package/index.js
CHANGED
|
@@ -103,7 +103,12 @@ function createAiClient(deps = {}) {
|
|
|
103
103
|
if (!cfg.enabled) {
|
|
104
104
|
throw new AiError('disabled', 'AI assistance is switched off. An administrator can enable it in Settings.');
|
|
105
105
|
}
|
|
106
|
-
|
|
106
|
+
// A MODEL NAME IS REQUIRED OF EVERY PROVIDER THAT HAS ONE TO CONFIGURE — which is all of them
|
|
107
|
+
// except a supervised stack. There the model is a FACT the supervisor reports about an engine,
|
|
108
|
+
// not a setting: the operator picks an engine and whatever it is running answers. Insisting on
|
|
109
|
+
// a model name would make an lmx endpoint unusable by demanding the one field the design says
|
|
110
|
+
// not to store, and would say so with a message naming nothing an operator could go and fill in.
|
|
111
|
+
if (!cfg.model && cfg.provider !== 'lmx') {
|
|
107
112
|
throw new AiError('unconfigured', 'No model name is configured.');
|
|
108
113
|
}
|
|
109
114
|
const adapter = PROVIDERS[cfg.provider];
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aria-framework/ai",
|
|
3
3
|
"description": "Aria App Framework — AI module. A dependency-injected model seam (createAiClient) over several providers (LM Studio / OpenAI-compatible / Anthropic), with a fact-preservation guard, generic Polish and Generate writing engines, and a browser polish widget. Prompts and config stay in the consuming app.",
|
|
4
|
-
"version": "0.14.
|
|
4
|
+
"version": "0.14.3",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"private": false,
|
|
7
7
|
"publishConfig": {
|
|
@@ -43,6 +43,7 @@
|
|
|
43
43
|
"test": "node test/smoke.js && node test/usageStore.js && node test/providerStore.js && node test/speedStore.js && node test/health.js && node test/listModels.js && node test/benchmark.js && node test/lmxDiscovery.js && node test/lmx.js && node test/packaging.js && node test/views.js"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"undici": "^8.10.0"
|
|
46
|
+
"undici": "^8.10.0",
|
|
47
|
+
"ejs": "^3.1.10"
|
|
47
48
|
}
|
|
48
49
|
}
|
package/providerStore.js
CHANGED
|
@@ -183,6 +183,16 @@ function createProviderStore(opts = {}) {
|
|
|
183
183
|
maxTokens: Number(row.max_tokens) || 1024,
|
|
184
184
|
contextTokens: Number(row.context_tokens) || 8192,
|
|
185
185
|
dailyTokenCap: Number(row.daily_token_cap) || 0,
|
|
186
|
+
// WHICH ENGINE ON WHICH SUPERVISED STACK. Carried through because a `kind: lmx` config
|
|
187
|
+
// without it is unusable: the adapter has no address of its own to fall back on, and would
|
|
188
|
+
// report "no supervisor is configured" for a row that names one perfectly well.
|
|
189
|
+
//
|
|
190
|
+
// A THIRD LIST THAT HAS TO AGREE. FIELDS says what may be written, schemaFor() creates the
|
|
191
|
+
// columns, and this decides what a caller actually receives — a field can be stored
|
|
192
|
+
// correctly and still never arrive. The guard in test/providerStore.js now compares all
|
|
193
|
+
// three, having originally compared only the first two and missed exactly this.
|
|
194
|
+
lmxInstance: row.lmx_instance || null,
|
|
195
|
+
lmxEngine: row.lmx_engine || null,
|
|
186
196
|
// Carried on the resolved config so a speed test can judge a result without a second read.
|
|
187
197
|
// 0 means no expectation was recorded, which is different from "expected to be slow".
|
|
188
198
|
minTokensPerSec: Number(row.min_tokens_per_sec) || 0
|
package/providers/lmx.js
CHANGED
|
Binary file
|