@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/media/index.cjs
CHANGED
|
@@ -656,6 +656,32 @@ Guidelines:
|
|
|
656
656
|
3. Keep technical terminology and official API symbols intact.
|
|
657
657
|
4. Format output using clean Markdown, clear sections, bullet points, and code blocks where required.
|
|
658
658
|
5. Do NOT use emojis in headings, tab titles, or UI navigation labels.`;
|
|
659
|
+
if (options.customInference) {
|
|
660
|
+
try {
|
|
661
|
+
const text = await options.customInference({
|
|
662
|
+
systemInstruction,
|
|
663
|
+
userPrompt: messages.map((m) => m.content).join("\n\n"),
|
|
664
|
+
messages,
|
|
665
|
+
temperature,
|
|
666
|
+
maxTokens,
|
|
667
|
+
onChunk: onChunk ?? (() => {
|
|
668
|
+
})
|
|
669
|
+
});
|
|
670
|
+
if (text && text.trim()) return text;
|
|
671
|
+
throw createAiInferenceError({
|
|
672
|
+
errorCode: "ERR_AI_ALL_PROVIDERS_FAILED",
|
|
673
|
+
message: "customInference returned empty output",
|
|
674
|
+
rawError: { customInference: "empty response" }
|
|
675
|
+
});
|
|
676
|
+
} catch (e) {
|
|
677
|
+
if (e?.errorCode || e?.name === "AiInferenceError") throw e;
|
|
678
|
+
throw createAiInferenceError({
|
|
679
|
+
errorCode: "ERR_AI_ALL_PROVIDERS_FAILED",
|
|
680
|
+
message: `customInference failed: ${e?.message || e}`,
|
|
681
|
+
rawError: { customInference: String(e?.message || e) }
|
|
682
|
+
});
|
|
683
|
+
}
|
|
684
|
+
}
|
|
659
685
|
const formattedMessages = [
|
|
660
686
|
{ role: "system", content: systemInstruction },
|
|
661
687
|
...messages.map((m) => ({
|