@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/index.cjs
CHANGED
|
@@ -450,6 +450,32 @@ Guidelines:
|
|
|
450
450
|
3. Keep technical terminology and official API symbols intact.
|
|
451
451
|
4. Format output using clean Markdown, clear sections, bullet points, and code blocks where required.
|
|
452
452
|
5. Do NOT use emojis in headings, tab titles, or UI navigation labels.`;
|
|
453
|
+
if (options.customInference) {
|
|
454
|
+
try {
|
|
455
|
+
const text = await options.customInference({
|
|
456
|
+
systemInstruction,
|
|
457
|
+
userPrompt: messages.map((m) => m.content).join("\n\n"),
|
|
458
|
+
messages,
|
|
459
|
+
temperature,
|
|
460
|
+
maxTokens,
|
|
461
|
+
onChunk: onChunk ?? (() => {
|
|
462
|
+
})
|
|
463
|
+
});
|
|
464
|
+
if (text && text.trim()) return text;
|
|
465
|
+
throw createAiInferenceError({
|
|
466
|
+
errorCode: "ERR_AI_ALL_PROVIDERS_FAILED",
|
|
467
|
+
message: "customInference returned empty output",
|
|
468
|
+
rawError: { customInference: "empty response" }
|
|
469
|
+
});
|
|
470
|
+
} catch (e) {
|
|
471
|
+
if (e?.errorCode || e?.name === "AiInferenceError") throw e;
|
|
472
|
+
throw createAiInferenceError({
|
|
473
|
+
errorCode: "ERR_AI_ALL_PROVIDERS_FAILED",
|
|
474
|
+
message: `customInference failed: ${e?.message || e}`,
|
|
475
|
+
rawError: { customInference: String(e?.message || e) }
|
|
476
|
+
});
|
|
477
|
+
}
|
|
478
|
+
}
|
|
453
479
|
const formattedMessages = [
|
|
454
480
|
{ role: "system", content: systemInstruction },
|
|
455
481
|
...messages.map((m) => ({
|