@vincemakes/kiso-provider-anthropic 0.27.0 → 0.28.0
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/index.js +16 -0
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -34,6 +34,14 @@ export function createAnthropicAdapter(client, adapterOpts = {}) {
|
|
|
34
34
|
const caching = adapterOpts.promptCaching === true;
|
|
35
35
|
return {
|
|
36
36
|
async *stream(options) {
|
|
37
|
+
// PA-1a (D3, the thinking table read 2026-09-07): the thinking wire.
|
|
38
|
+
// `adaptive` and `disabled` serialize as { type }; absent adds NO
|
|
39
|
+
// key (the byte anchor — every 5-line model thinks by default).
|
|
40
|
+
// `enabled` is manual extended thinking and needs a budget_tokens
|
|
41
|
+
// the XP-1 setting has no axis for; the registry lists it for no
|
|
42
|
+
// first-party model, so reaching here with it is a wiring error —
|
|
43
|
+
// refused loudly, never guessed. Checked BEFORE the request.
|
|
44
|
+
const thinking = options.reasoning?.thinking === undefined ? undefined : thinkingParam(options.reasoning.thinking);
|
|
37
45
|
// D4: the stream CREATION is inside the error normalization —
|
|
38
46
|
// connection/timeout/5xx failures before the first byte are
|
|
39
47
|
// mapped, retryable StructuredErrors.
|
|
@@ -48,6 +56,7 @@ export function createAnthropicAdapter(client, adapterOpts = {}) {
|
|
|
48
56
|
// mode list for the entered models, so no valid
|
|
49
57
|
// selection can produce one; nothing is guessed.
|
|
50
58
|
...(options.reasoning?.effort !== undefined ? { output_config: { effort: options.reasoning.effort } } : {}),
|
|
59
|
+
...(thinking !== undefined ? { thinking } : {}),
|
|
51
60
|
...(options.systemPrompt !== undefined
|
|
52
61
|
? {
|
|
53
62
|
system: caching
|
|
@@ -353,6 +362,13 @@ function toAnthropicMessages(messages, model) {
|
|
|
353
362
|
}
|
|
354
363
|
return out;
|
|
355
364
|
}
|
|
365
|
+
/** PA-1a (D3): the request's `thinking` object for a RESOLVED mode. */
|
|
366
|
+
function thinkingParam(mode) {
|
|
367
|
+
if (mode === "enabled") {
|
|
368
|
+
throw new Error("thinking 'enabled' (extended thinking with budget_tokens) is not driven by kiso on this provider — select adaptive or disabled");
|
|
369
|
+
}
|
|
370
|
+
return { type: mode };
|
|
371
|
+
}
|
|
356
372
|
/** PH-1c.1 — the rolling conversation breakpoint: the LAST message's
|
|
357
373
|
* LAST content block gains cache_control, so the next request's
|
|
358
374
|
* stable prefix (this whole conversation) is a cache hit. String
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vincemakes/kiso-provider-anthropic",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.28.0",
|
|
4
4
|
"description": "kiso Anthropic adapter — official SDK wire events mapped to the kiso event union.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@anthropic-ai/sdk": "^0.115.0",
|
|
25
|
-
"@vincemakes/kiso-core": "0.
|
|
25
|
+
"@vincemakes/kiso-core": "0.28.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@types/node": "^26.1.2",
|