pi-neuralwatt-provider 1.7.0 → 1.7.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/custom-models.json +4 -2
- package/index.ts +3 -4
- package/package.json +1 -1
- package/patch.json +5 -4
- package/tests/thinking-levels.test.ts +18 -19
package/custom-models.json
CHANGED
|
@@ -19,7 +19,8 @@
|
|
|
19
19
|
"low": "low",
|
|
20
20
|
"medium": "medium",
|
|
21
21
|
"high": "high",
|
|
22
|
-
"xhigh": null
|
|
22
|
+
"xhigh": null,
|
|
23
|
+
"max": null
|
|
23
24
|
},
|
|
24
25
|
"compat": {
|
|
25
26
|
"supportsDeveloperRole": false,
|
|
@@ -68,7 +69,8 @@
|
|
|
68
69
|
"low": "low",
|
|
69
70
|
"medium": "medium",
|
|
70
71
|
"high": "high",
|
|
71
|
-
"xhigh": null
|
|
72
|
+
"xhigh": null,
|
|
73
|
+
"max": null
|
|
72
74
|
},
|
|
73
75
|
"compat": {
|
|
74
76
|
"supportsDeveloperRole": false,
|
package/index.ts
CHANGED
|
@@ -64,10 +64,8 @@
|
|
|
64
64
|
* @see https://neuralwatt.com
|
|
65
65
|
*/
|
|
66
66
|
|
|
67
|
-
import type { SimpleStreamOptions } from "@earendil-works/pi-ai";
|
|
68
|
-
import { clampThinkingLevel } from "@earendil-works/pi-ai";
|
|
69
|
-
import { streamOpenAICompletions } from "@earendil-works/pi-ai/compat";
|
|
70
|
-
import type { AssistantMessageEventStream } from "@earendil-works/pi-ai";
|
|
67
|
+
import type { SimpleStreamOptions, AssistantMessageEventStream } from "@earendil-works/pi-ai/compat";
|
|
68
|
+
import { clampThinkingLevel, streamOpenAICompletions } from "@earendil-works/pi-ai/compat";
|
|
71
69
|
import { getAgentDir, type ExtensionAPI, type ModelRegistry } from "@earendil-works/pi-coding-agent";
|
|
72
70
|
import modelsData from "./models.json" with { type: "json" };
|
|
73
71
|
import customModelsData from "./custom-models.json" with { type: "json" };
|
|
@@ -205,6 +203,7 @@ interface NeuralwattModel {
|
|
|
205
203
|
medium?: string | null;
|
|
206
204
|
high?: string | null;
|
|
207
205
|
xhigh?: string | null;
|
|
206
|
+
max?: string | null;
|
|
208
207
|
};
|
|
209
208
|
compat?: {
|
|
210
209
|
supportsDeveloperRole?: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-neuralwatt-provider",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.2",
|
|
4
4
|
"description": "Neuralwatt provider extension for pi - Access Kimi, GLM, Qwen, GPT-OSS, Devstral, and MiniMax models through the Neuralwatt API",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.ts",
|
package/patch.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"low": null,
|
|
7
7
|
"medium": null,
|
|
8
8
|
"high": "high",
|
|
9
|
-
"
|
|
9
|
+
"max": "max"
|
|
10
10
|
},
|
|
11
11
|
"compat": {
|
|
12
12
|
"chatTemplateKwargs": {
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"low": null,
|
|
27
27
|
"medium": null,
|
|
28
28
|
"high": "high",
|
|
29
|
-
"
|
|
29
|
+
"max": "max"
|
|
30
30
|
},
|
|
31
31
|
"compat": {
|
|
32
32
|
"chatTemplateKwargs": {
|
|
@@ -40,7 +40,8 @@
|
|
|
40
40
|
"low": "low",
|
|
41
41
|
"medium": "medium",
|
|
42
42
|
"high": "high",
|
|
43
|
-
"xhigh": null
|
|
43
|
+
"xhigh": null,
|
|
44
|
+
"max": null
|
|
44
45
|
},
|
|
45
46
|
"compat": {
|
|
46
47
|
"maxTokensField": "max_tokens",
|
|
@@ -61,7 +62,7 @@
|
|
|
61
62
|
"low": "low",
|
|
62
63
|
"medium": "medium",
|
|
63
64
|
"high": "high",
|
|
64
|
-
"
|
|
65
|
+
"max": "high"
|
|
65
66
|
},
|
|
66
67
|
"compat": {
|
|
67
68
|
"maxTokensField": "max_tokens",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { describe, expect, it, beforeEach, afterEach, vi } from "vitest";
|
|
2
2
|
import { streamNeuralwatt } from "../index";
|
|
3
|
-
import { __streamCalls, __resetStreamCalls, __setClamp } from "@earendil-works/pi-ai";
|
|
3
|
+
import { __streamCalls, __resetStreamCalls, __setClamp } from "@earendil-works/pi-ai/compat";
|
|
4
4
|
import patchesData from "../patch.json" with { type: "json" };
|
|
5
5
|
|
|
6
6
|
// A GLM-5.2 model shaped exactly as the extension registers it (embedded
|
|
@@ -17,7 +17,7 @@ const glm52 = {
|
|
|
17
17
|
low: null,
|
|
18
18
|
medium: null,
|
|
19
19
|
high: "high",
|
|
20
|
-
|
|
20
|
+
max: "max",
|
|
21
21
|
},
|
|
22
22
|
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
|
|
23
23
|
contextWindow: 131072,
|
|
@@ -78,18 +78,18 @@ describe("streamNeuralwatt thinking-level forwarding", () => {
|
|
|
78
78
|
const spy = vi.fn((_m: any, level: any) => level);
|
|
79
79
|
__setClamp(spy);
|
|
80
80
|
|
|
81
|
-
const stream = streamNeuralwatt(glm52, context, { apiKey: "sk-test", reasoning: "
|
|
81
|
+
const stream = streamNeuralwatt(glm52, context, { apiKey: "sk-test", reasoning: "max" } as any);
|
|
82
82
|
stream.end();
|
|
83
83
|
|
|
84
84
|
expect(spy).toHaveBeenCalledTimes(1);
|
|
85
|
-
expect(spy).toHaveBeenCalledWith(expect.objectContaining({ id: "glm-5.2" }), "
|
|
86
|
-
expect(__streamCalls[0].options.reasoningEffort).toBe("
|
|
85
|
+
expect(spy).toHaveBeenCalledWith(expect.objectContaining({ id: "glm-5.2" }), "max");
|
|
86
|
+
expect(__streamCalls[0].options.reasoningEffort).toBe("max");
|
|
87
87
|
});
|
|
88
88
|
|
|
89
89
|
it("forwards the clampThinkingLevel return value as reasoningEffort", () => {
|
|
90
90
|
__setClamp(() => "max");
|
|
91
91
|
|
|
92
|
-
const stream = streamNeuralwatt(glm52, context, { apiKey: "sk-test", reasoning: "
|
|
92
|
+
const stream = streamNeuralwatt(glm52, context, { apiKey: "sk-test", reasoning: "high" } as any);
|
|
93
93
|
stream.end();
|
|
94
94
|
|
|
95
95
|
expect(__streamCalls[0].options.reasoningEffort).toBe("max");
|
|
@@ -113,10 +113,10 @@ describe("GLM-5.2 family patch.json thinkingLevelMap", () => {
|
|
|
113
113
|
low: null,
|
|
114
114
|
medium: null,
|
|
115
115
|
high: "high",
|
|
116
|
-
|
|
116
|
+
max: "max",
|
|
117
117
|
};
|
|
118
118
|
|
|
119
|
-
for (const id of ["glm-5.2", "glm-5.2-
|
|
119
|
+
for (const id of ["glm-5.2", "glm-5.2-short"]) {
|
|
120
120
|
it(`${id} maps onto GLM-5.2's three real states (skip / high / max)`, () => {
|
|
121
121
|
expect(patches[id]?.thinkingLevelMap).toEqual(expectedMap);
|
|
122
122
|
});
|
|
@@ -137,20 +137,19 @@ describe("Kimi K2.7 family patch.json thinkingLevelMap", () => {
|
|
|
137
137
|
low: "low",
|
|
138
138
|
medium: "medium",
|
|
139
139
|
high: "high",
|
|
140
|
-
|
|
140
|
+
max: "high",
|
|
141
141
|
};
|
|
142
142
|
|
|
143
|
-
for (const id of ["kimi-k2.7-code"
|
|
144
|
-
it(`${id}
|
|
143
|
+
for (const id of ["kimi-k2.7-code"]) {
|
|
144
|
+
it(`${id} thinkingLevelMap clamps max → high (model caps at highest supported)`, () => {
|
|
145
145
|
expect(patches[id]?.thinkingLevelMap).toEqual(expectedMap);
|
|
146
146
|
});
|
|
147
147
|
}
|
|
148
148
|
|
|
149
|
-
it("kimi-k2.7-code
|
|
150
|
-
//
|
|
151
|
-
//
|
|
152
|
-
|
|
153
|
-
expect(patches["kimi-k2.7-code"]?.thinkingLevelMap?.xhigh).toBe("high");
|
|
149
|
+
it("kimi-k2.7-code max maps to high (clamps to highest supported)", () => {
|
|
150
|
+
// K2.7 caps at high; this clamps max → high so /reasoning max is honored as a
|
|
151
|
+
// real level rather than silently passed through to an API that rejects it.
|
|
152
|
+
expect(patches["kimi-k2.7-code"]?.thinkingLevelMap?.max).toBe("high");
|
|
154
153
|
});
|
|
155
154
|
});
|
|
156
155
|
|
|
@@ -276,7 +275,7 @@ describe("patch.json chatTemplateKwargs enablement (behavioral E2E-verified)", (
|
|
|
276
275
|
|
|
277
276
|
// Kimi K2.6/K2.7 reasoning variants: preserve_thinking: true
|
|
278
277
|
// (doc-backed; behavioral E2E: 0/6 → 6/6 recall)
|
|
279
|
-
const kimi = ["kimi-k2.6", "kimi-k2.
|
|
278
|
+
const kimi = ["kimi-k2.6", "kimi-k2.7-code"];
|
|
280
279
|
for (const id of kimi) {
|
|
281
280
|
it(`${id} opts into full-history via preserve_thinking: true`, () => {
|
|
282
281
|
expect(patches[id]?.compat?.chatTemplateKwargs).toEqual({ preserve_thinking: true });
|
|
@@ -288,8 +287,8 @@ describe("patch.json chatTemplateKwargs enablement (behavioral E2E-verified)", (
|
|
|
288
287
|
// GLM-5.2 reasoning variants: clear_thinking: false
|
|
289
288
|
// (NOT in the docs' full-history table, which lists clear_thinking only for
|
|
290
289
|
// GLM-5.1; but behavioral E2E proved it functional on GLM-5.2: 1/4 → 4/4 recall,
|
|
291
|
-
// confirmed family-wide on base/short
|
|
292
|
-
const glm = ["glm-5.2", "glm-5.2-
|
|
290
|
+
// confirmed family-wide on base/short). Non-reasoning -fast variants excluded.
|
|
291
|
+
const glm = ["glm-5.2", "glm-5.2-short"];
|
|
293
292
|
for (const id of glm) {
|
|
294
293
|
it(`${id} opts into full-history via clear_thinking: false`, () => {
|
|
295
294
|
expect(patches[id]?.compat?.chatTemplateKwargs).toEqual({ clear_thinking: false });
|