@absolutejs/ai 0.6.5 → 0.6.7
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/CHANGELOG.md +12 -0
- package/README.md +18 -0
- package/changelog.json +26 -0
- package/dist/ai/index.js +363 -188
- package/dist/ai/index.js.map +17 -16
- package/dist/ai/providers/anthropic.js +147 -104
- package/dist/ai/providers/anthropic.js.map +8 -8
- package/dist/ai/providers/gemini.js +146 -103
- package/dist/ai/providers/gemini.js.map +7 -7
- package/dist/ai/providers/ollama.js +61 -20
- package/dist/ai/providers/ollama.js.map +5 -5
- package/dist/ai/providers/openai.js +245 -151
- package/dist/ai/providers/openai.js.map +11 -10
- package/dist/ai/providers/openaiCompatible.js +245 -151
- package/dist/ai/providers/openaiCompatible.js.map +11 -10
- package/dist/ai/providers/openaiResponses.js +243 -149
- package/dist/ai/providers/openaiResponses.js.map +10 -9
- package/dist/ai/providers/openrouter.js +246 -152
- package/dist/ai/providers/openrouter.js.map +12 -11
- package/dist/src/ai/contextPolicy.d.ts +2 -0
- package/dist/src/ai/errors/providerError.d.ts +2 -0
- package/dist/src/ai/index.d.ts +3 -0
- package/dist/src/ai/inputCapacity.d.ts +4 -2
- package/dist/src/ai/prepareTextInput.d.ts +2 -0
- package/dist/src/ai/providerFallback.d.ts +27 -8
- package/dist/src/ai/providers/openaiSchema.d.ts +4 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,18 @@ This file is generated by `absolute-changelog` from the entries in
|
|
|
6
6
|
`changelog/`. Edit an entry, not this file — and add new ones under
|
|
7
7
|
`changelog/unreleased/`.
|
|
8
8
|
|
|
9
|
+
## 0.6.7 — 2026-10-22
|
|
10
|
+
|
|
11
|
+
### Fixed
|
|
12
|
+
|
|
13
|
+
- **Retain the requested model when validating legacy document checkpoints after provider recovery**
|
|
14
|
+
|
|
15
|
+
## 0.6.6 — 2026-10-22
|
|
16
|
+
|
|
17
|
+
### Changed
|
|
18
|
+
|
|
19
|
+
- **Recover approved providers in either direction across preparation and streaming; preserve checkpoints, normalize finite-key OpenAI schemas, and clear cancelled billing probes** (`AIInputError`, `PrepareAITextInputOptions`, `AIContextPolicy`, `streamWithProviderFallback`)
|
|
20
|
+
|
|
9
21
|
## 0.6.5 — 2026-10-22
|
|
10
22
|
|
|
11
23
|
### Changed
|
package/README.md
CHANGED
|
@@ -593,3 +593,21 @@ polls or subscribes to actual progress, and binds actions to authenticated route
|
|
|
593
593
|
|
|
594
594
|
|
|
595
595
|
`streamWithProviderFallback` accepts approved model IDs, an individually metered `stream(model)` callback, and an optional `onFallback` hook. It never restarts after a chunk or caller cancellation. `ProviderError.billingUnavailable` identifies provider billing failures; `notSent` identifies requests blocked locally. Billing suppression is scoped to the configured provider instance, with a five-minute probe interval.
|
|
596
|
+
|
|
597
|
+
|
|
598
|
+
### Recovery across approved providers
|
|
599
|
+
|
|
600
|
+
Set `contextPolicy.providerFallback` on generation helpers and
|
|
601
|
+
`providerFallback` on `prepareAITextInput` / `prepareAITextInputStep` to cover
|
|
602
|
+
both token-capacity checks and generation. `models` accepts an array or a
|
|
603
|
+
function of the current model; the requested model runs first. Use a provider
|
|
604
|
+
router containing every approved model. Each alternate validates its own input
|
|
605
|
+
capacity. Optional `onFallback({ from, to, error })` reports the switch.
|
|
606
|
+
|
|
607
|
+
Recovery stops after any output chunk, including tool/usage chunks, and never
|
|
608
|
+
replays cancellation or accounting/application errors. Completed document
|
|
609
|
+
sections retain validated checkpoints across provider switches. Finite-key
|
|
610
|
+
OpenAI record schemas are translated to optional named properties without
|
|
611
|
+
removing value constraints. `isProviderError` works across package entrypoints;
|
|
612
|
+
`isPermanentAIProviderFailure` classifies terminal provider/preflight failures
|
|
613
|
+
for job runners. Callers own retry budgets, funding, and model approval.
|
package/changelog.json
CHANGED
|
@@ -2,6 +2,32 @@
|
|
|
2
2
|
"contract": 1,
|
|
3
3
|
"name": "@absolutejs/ai",
|
|
4
4
|
"releases": [
|
|
5
|
+
{
|
|
6
|
+
"changes": [
|
|
7
|
+
{
|
|
8
|
+
"kind": "fixed",
|
|
9
|
+
"summary": "Retain the requested model when validating legacy document checkpoints after provider recovery"
|
|
10
|
+
}
|
|
11
|
+
],
|
|
12
|
+
"date": "2026-10-22",
|
|
13
|
+
"version": "0.6.7"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"changes": [
|
|
17
|
+
{
|
|
18
|
+
"kind": "changed",
|
|
19
|
+
"summary": "Recover approved providers in either direction across preparation and streaming; preserve checkpoints, normalize finite-key OpenAI schemas, and clear cancelled billing probes",
|
|
20
|
+
"symbols": [
|
|
21
|
+
"AIInputError",
|
|
22
|
+
"PrepareAITextInputOptions",
|
|
23
|
+
"AIContextPolicy",
|
|
24
|
+
"streamWithProviderFallback"
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
"date": "2026-10-22",
|
|
29
|
+
"version": "0.6.6"
|
|
30
|
+
},
|
|
5
31
|
{
|
|
6
32
|
"changes": [
|
|
7
33
|
{
|