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