@thanh01.pmt/curriculum-kit 1.0.7 → 1.0.9
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/ai/index.cjs +26 -0
- package/dist/ai/index.cjs.map +1 -1
- package/dist/ai/index.d.cts +2 -2
- package/dist/ai/index.d.ts +2 -2
- package/dist/ai/index.mjs +26 -0
- package/dist/ai/index.mjs.map +1 -1
- package/dist/index.cjs +26 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +26 -0
- package/dist/index.mjs.map +1 -1
- package/dist/media/index.cjs +26 -0
- package/dist/media/index.cjs.map +1 -1
- package/dist/media/index.d.cts +3 -1
- package/dist/media/index.d.ts +3 -1
- package/dist/media/index.mjs +26 -0
- package/dist/media/index.mjs.map +1 -1
- package/dist/pipeline/index.cjs.map +1 -1
- package/dist/pipeline/index.mjs.map +1 -1
- package/dist/{streamRunner-C7j5LKon.d.cts → streamRunner-BTTzbb-l.d.cts} +19 -0
- package/dist/{streamRunner-C7j5LKon.d.ts → streamRunner-BTTzbb-l.d.ts} +19 -0
- package/dist/workflow/index.cjs +26 -0
- package/dist/workflow/index.cjs.map +1 -1
- package/dist/workflow/index.mjs +26 -0
- package/dist/workflow/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/ai/index.cjs
CHANGED
|
@@ -413,6 +413,32 @@ Guidelines:
|
|
|
413
413
|
3. Keep technical terminology and official API symbols intact.
|
|
414
414
|
4. Format output using clean Markdown, clear sections, bullet points, and code blocks where required.
|
|
415
415
|
5. Do NOT use emojis in headings, tab titles, or UI navigation labels.`;
|
|
416
|
+
if (options.customInference) {
|
|
417
|
+
try {
|
|
418
|
+
const text = await options.customInference({
|
|
419
|
+
systemInstruction,
|
|
420
|
+
userPrompt: messages.map((m) => m.content).join("\n\n"),
|
|
421
|
+
messages,
|
|
422
|
+
temperature,
|
|
423
|
+
maxTokens,
|
|
424
|
+
onChunk: onChunk ?? (() => {
|
|
425
|
+
})
|
|
426
|
+
});
|
|
427
|
+
if (text && text.trim()) return text;
|
|
428
|
+
throw createAiInferenceError({
|
|
429
|
+
errorCode: "ERR_AI_ALL_PROVIDERS_FAILED",
|
|
430
|
+
message: "customInference returned empty output",
|
|
431
|
+
rawError: { customInference: "empty response" }
|
|
432
|
+
});
|
|
433
|
+
} catch (e) {
|
|
434
|
+
if (e?.errorCode || e?.name === "AiInferenceError") throw e;
|
|
435
|
+
throw createAiInferenceError({
|
|
436
|
+
errorCode: "ERR_AI_ALL_PROVIDERS_FAILED",
|
|
437
|
+
message: `customInference failed: ${e?.message || e}`,
|
|
438
|
+
rawError: { customInference: String(e?.message || e) }
|
|
439
|
+
});
|
|
440
|
+
}
|
|
441
|
+
}
|
|
416
442
|
const formattedMessages = [
|
|
417
443
|
{ role: "system", content: systemInstruction },
|
|
418
444
|
...messages.map((m) => ({
|