@thanh01.pmt/curriculum-kit 1.4.34 → 1.4.35

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.mjs CHANGED
@@ -29691,26 +29691,40 @@ Return concise JSON matching:
29691
29691
  "technicalGotchas": ["Important safety or compatibility note 1", "Note 2"]
29692
29692
  }`;
29693
29693
  let rawContent = "";
29694
- await streamLLMWithFallback(
29695
- "You are an authoritative STEM & CS curriculum researcher. Output valid JSON only.",
29696
- researchPrompt,
29697
- apiKeys,
29698
- (chunk, type) => {
29699
- if (type === "content") rawContent += chunk;
29700
- onChunk?.(chunk, type);
29701
- },
29702
- options.model,
29703
- options.provider,
29704
- // Research may run live web grounding — generous budget, still idle-guarded.
29705
- resolveStreamBudget(void 0, {
29706
- idleMs: options.idleTimeoutMs,
29707
- totalMs: options.timeoutMs,
29708
- model: options.model,
29709
- provider: options.provider
29710
- }),
29711
- options.signal,
29712
- options.onProviderEvent
29713
- );
29694
+ if (options.customInference) {
29695
+ rawContent = await options.customInference({
29696
+ systemInstruction: "You are an authoritative STEM & CS curriculum researcher. Output valid JSON only.",
29697
+ userPrompt: researchPrompt,
29698
+ messages: [{ role: "user", content: researchPrompt }],
29699
+ temperature: 0.2,
29700
+ maxTokens: 32768,
29701
+ onChunk: (token, type) => {
29702
+ if (type === "content") rawContent += token;
29703
+ if (type === "content" || type === "thought") onChunk?.(token, type);
29704
+ }
29705
+ }) || "";
29706
+ } else {
29707
+ await streamLLMWithFallback(
29708
+ "You are an authoritative STEM & CS curriculum researcher. Output valid JSON only.",
29709
+ researchPrompt,
29710
+ apiKeys,
29711
+ (chunk, type) => {
29712
+ if (type === "content") rawContent += chunk;
29713
+ onChunk?.(chunk, type);
29714
+ },
29715
+ options.model,
29716
+ options.provider,
29717
+ // Research may run live web grounding — generous budget, still idle-guarded.
29718
+ resolveStreamBudget(void 0, {
29719
+ idleMs: options.idleTimeoutMs,
29720
+ totalMs: options.timeoutMs,
29721
+ model: options.model,
29722
+ provider: options.provider
29723
+ }),
29724
+ options.signal,
29725
+ options.onProviderEvent
29726
+ );
29727
+ }
29714
29728
  let parsedResearch = {
29715
29729
  groundTruthSummary: `Verified ecosystem standards for ${projectName}`,
29716
29730
  hardwareVersion: "Standard Environment",