@thanh01.pmt/curriculum-kit 1.0.16 → 1.0.17
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.cjs +0 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -6
- package/dist/index.d.ts +9 -6
- package/dist/index.mjs +0 -9
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -407,12 +407,15 @@ interface ExtractedStreamChunk {
|
|
|
407
407
|
* Pure function so the extraction contract is unit-testable.
|
|
408
408
|
*
|
|
409
409
|
* Reasoning arrives through provider-specific shapes:
|
|
410
|
-
* - `reasoning-delta` / legacy `reasoning` parts (mapped by SDK providers)
|
|
411
|
-
*
|
|
412
|
-
*
|
|
413
|
-
*
|
|
414
|
-
*
|
|
415
|
-
*
|
|
410
|
+
* - `reasoning-delta` / legacy `reasoning` parts (mapped by SDK providers).
|
|
411
|
+
*
|
|
412
|
+
* DUP-STREAM FIX (measured live against NVIDIA NIM nemotron-ultra, 2026-09-10):
|
|
413
|
+
* with `includeRawChunks: true` the SDK emits BOTH the mapped `text-delta`
|
|
414
|
+
* /`reasoning-delta` part AND the `raw` provider chunk carrying the SAME
|
|
415
|
+
* token. Extracting text from `raw` parts therefore duplicated every token
|
|
416
|
+
* ("Lớp 1ớp 1 (6-7 (6-7 tuổi)…"), destroying the JSON and causing the ~90%
|
|
417
|
+
* wizard prefill failure. The mapped parts are the single source of truth —
|
|
418
|
+
* `raw` parts must contribute NOTHING here.
|
|
416
419
|
*/
|
|
417
420
|
declare function extractStreamChunk(part: any): ExtractedStreamChunk;
|
|
418
421
|
declare function createStreamAbortSignal(budget: Required<StreamBudget>): StreamAbortHandle;
|
package/dist/index.d.ts
CHANGED
|
@@ -407,12 +407,15 @@ interface ExtractedStreamChunk {
|
|
|
407
407
|
* Pure function so the extraction contract is unit-testable.
|
|
408
408
|
*
|
|
409
409
|
* Reasoning arrives through provider-specific shapes:
|
|
410
|
-
* - `reasoning-delta` / legacy `reasoning` parts (mapped by SDK providers)
|
|
411
|
-
*
|
|
412
|
-
*
|
|
413
|
-
*
|
|
414
|
-
*
|
|
415
|
-
*
|
|
410
|
+
* - `reasoning-delta` / legacy `reasoning` parts (mapped by SDK providers).
|
|
411
|
+
*
|
|
412
|
+
* DUP-STREAM FIX (measured live against NVIDIA NIM nemotron-ultra, 2026-09-10):
|
|
413
|
+
* with `includeRawChunks: true` the SDK emits BOTH the mapped `text-delta`
|
|
414
|
+
* /`reasoning-delta` part AND the `raw` provider chunk carrying the SAME
|
|
415
|
+
* token. Extracting text from `raw` parts therefore duplicated every token
|
|
416
|
+
* ("Lớp 1ớp 1 (6-7 (6-7 tuổi)…"), destroying the JSON and causing the ~90%
|
|
417
|
+
* wizard prefill failure. The mapped parts are the single source of truth —
|
|
418
|
+
* `raw` parts must contribute NOTHING here.
|
|
416
419
|
*/
|
|
417
420
|
declare function extractStreamChunk(part: any): ExtractedStreamChunk;
|
|
418
421
|
declare function createStreamAbortSignal(budget: Required<StreamBudget>): StreamAbortHandle;
|
package/dist/index.mjs
CHANGED
|
@@ -13561,15 +13561,6 @@ function extractStreamChunk(part) {
|
|
|
13561
13561
|
const content = part.text ?? part.delta ?? "";
|
|
13562
13562
|
return content ? { content } : {};
|
|
13563
13563
|
}
|
|
13564
|
-
if (part.type === "raw") {
|
|
13565
|
-
const raw = part.rawValue;
|
|
13566
|
-
const delta = raw?.choices?.[0]?.delta;
|
|
13567
|
-
const reasoning = delta?.reasoning_content ?? delta?.reasoning ?? raw?.delta?.reasoning_content ?? raw?.delta?.reasoning;
|
|
13568
|
-
if (typeof reasoning === "string" && reasoning) return { thought: reasoning };
|
|
13569
|
-
const text = delta?.content ?? raw?.delta?.content;
|
|
13570
|
-
if (typeof text === "string" && text) return { content: text };
|
|
13571
|
-
return {};
|
|
13572
|
-
}
|
|
13573
13564
|
return {};
|
|
13574
13565
|
}
|
|
13575
13566
|
function createStreamAbortSignal(budget) {
|