@stackfactor/agent-utils 1.0.4 → 1.0.5
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"langChain.d.ts","sourceRoot":"","sources":["../../src/langChain.ts"],"names":[],"mappings":";wBAoaQ,MAAM,aACD,MAAM,gBACH,MAAM,SACb,GAAG,EAAE,kBACI,GAAG,UACX,GAAG,qBACO,QAAQ,GAAG,IAAI,eACrB,MAAM,eACN,MAAM,KACjB,GAAG;sBAyCG,GAAG,UACF,MAAM,UACN,GAAG,eACC,QAAQ,GAAG,IAAI,KAC1B,OAAO,CAAC,GAAG,CAAC;
|
|
1
|
+
{"version":3,"file":"langChain.d.ts","sourceRoot":"","sources":["../../src/langChain.ts"],"names":[],"mappings":";wBAoaQ,MAAM,aACD,MAAM,gBACH,MAAM,SACb,GAAG,EAAE,kBACI,GAAG,UACX,GAAG,qBACO,QAAQ,GAAG,IAAI,eACrB,MAAM,eACN,MAAM,KACjB,GAAG;sBAyCG,GAAG,UACF,MAAM,UACN,GAAG,eACC,QAAQ,GAAG,IAAI,KAC1B,OAAO,CAAC,GAAG,CAAC;wCAiqBF,MAAM,UACT,GAAG,UACH,GAAG,oBACO,GAAG,KACpB,GAAG;oCAphBO,MAAM,UACT,GAAG,UACH,GAAG,oBACO,GAAG,eACT,MAAM,eACN,MAAM,wBACG,OAAO,WACpB,GAAG,cACA,MAAM,UACV,GAAG,EAAE,KACX,OAAO,CAAC,GAAG,CAAC;sDAy0BF,MAAM,UACT,GAAG,UACH,MAAM,YACL,GAAG,KACX,OAAO,CAAC,GAAG,CAAC;0CAz4B8B,GAAG,KAAG,MAAM;;AAo8BzD,wBAOE"}
|
package/dist/cjs/langChain.js
CHANGED
|
@@ -577,24 +577,21 @@ const runPromptWithModel = async (modelName, config, prompt, onProgressReport, m
|
|
|
577
577
|
? `${JSON_ESCAPE_INSTRUCTION}\n\n---\n\n${systemPrompt}`
|
|
578
578
|
: JSON_ESCAPE_INSTRUCTION;
|
|
579
579
|
}
|
|
580
|
-
// Build tools array
|
|
581
|
-
// Create a shared progress tracker for both tool and callbacks
|
|
580
|
+
// Build tools array and progress callback for agentic mode
|
|
582
581
|
const progressTracker = { current: minPercent };
|
|
583
582
|
const agentTools = [...tools];
|
|
583
|
+
let trackingProgressCallback = null;
|
|
584
584
|
if (onProgressReport) {
|
|
585
|
-
|
|
586
|
-
const trackingProgressCallback = (data) => {
|
|
585
|
+
trackingProgressCallback = (data) => {
|
|
587
586
|
if (typeof data.progress === "number") {
|
|
588
587
|
progressTracker.current = data.progress;
|
|
589
588
|
}
|
|
590
589
|
onProgressReport(data);
|
|
591
590
|
};
|
|
592
|
-
agentTools.push(getAIProgressTool(trackingProgressCallback, minPercent, maxPercent));
|
|
593
591
|
}
|
|
594
|
-
// Create the agent with tools
|
|
592
|
+
// Create the agent with tools and progress callback
|
|
595
593
|
const agent = createAgent(agentName, modelName, systemPrompt, agentTools, null, // responseFormat
|
|
596
|
-
config,
|
|
597
|
-
minPercent, maxPercent);
|
|
594
|
+
config, trackingProgressCallback, minPercent, maxPercent);
|
|
598
595
|
// Run the agent with callback that includes current progress
|
|
599
596
|
const callbackWithProgress = onProgressReport
|
|
600
597
|
? (data) => onProgressReport({ ...data, progress: progressTracker.current })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"langChain.d.ts","sourceRoot":"","sources":["../../src/langChain.ts"],"names":[],"mappings":";wBAoaQ,MAAM,aACD,MAAM,gBACH,MAAM,SACb,GAAG,EAAE,kBACI,GAAG,UACX,GAAG,qBACO,QAAQ,GAAG,IAAI,eACrB,MAAM,eACN,MAAM,KACjB,GAAG;sBAyCG,GAAG,UACF,MAAM,UACN,GAAG,eACC,QAAQ,GAAG,IAAI,KAC1B,OAAO,CAAC,GAAG,CAAC;
|
|
1
|
+
{"version":3,"file":"langChain.d.ts","sourceRoot":"","sources":["../../src/langChain.ts"],"names":[],"mappings":";wBAoaQ,MAAM,aACD,MAAM,gBACH,MAAM,SACb,GAAG,EAAE,kBACI,GAAG,UACX,GAAG,qBACO,QAAQ,GAAG,IAAI,eACrB,MAAM,eACN,MAAM,KACjB,GAAG;sBAyCG,GAAG,UACF,MAAM,UACN,GAAG,eACC,QAAQ,GAAG,IAAI,KAC1B,OAAO,CAAC,GAAG,CAAC;wCAiqBF,MAAM,UACT,GAAG,UACH,GAAG,oBACO,GAAG,KACpB,GAAG;oCAphBO,MAAM,UACT,GAAG,UACH,GAAG,oBACO,GAAG,eACT,MAAM,eACN,MAAM,wBACG,OAAO,WACpB,GAAG,cACA,MAAM,UACV,GAAG,EAAE,KACX,OAAO,CAAC,GAAG,CAAC;sDAy0BF,MAAM,UACT,GAAG,UACH,MAAM,YACL,GAAG,KACX,OAAO,CAAC,GAAG,CAAC;0CAz4B8B,GAAG,KAAG,MAAM;;AAo8BzD,wBAOE"}
|
package/dist/esm/langChain.js
CHANGED
|
@@ -572,24 +572,21 @@ const runPromptWithModel = async (modelName, config, prompt, onProgressReport, m
|
|
|
572
572
|
? `${JSON_ESCAPE_INSTRUCTION}\n\n---\n\n${systemPrompt}`
|
|
573
573
|
: JSON_ESCAPE_INSTRUCTION;
|
|
574
574
|
}
|
|
575
|
-
// Build tools array
|
|
576
|
-
// Create a shared progress tracker for both tool and callbacks
|
|
575
|
+
// Build tools array and progress callback for agentic mode
|
|
577
576
|
const progressTracker = { current: minPercent };
|
|
578
577
|
const agentTools = [...tools];
|
|
578
|
+
let trackingProgressCallback = null;
|
|
579
579
|
if (onProgressReport) {
|
|
580
|
-
|
|
581
|
-
const trackingProgressCallback = (data) => {
|
|
580
|
+
trackingProgressCallback = (data) => {
|
|
582
581
|
if (typeof data.progress === "number") {
|
|
583
582
|
progressTracker.current = data.progress;
|
|
584
583
|
}
|
|
585
584
|
onProgressReport(data);
|
|
586
585
|
};
|
|
587
|
-
agentTools.push(getAIProgressTool(trackingProgressCallback, minPercent, maxPercent));
|
|
588
586
|
}
|
|
589
|
-
// Create the agent with tools
|
|
587
|
+
// Create the agent with tools and progress callback
|
|
590
588
|
const agent = createAgent(agentName, modelName, systemPrompt, agentTools, null, // responseFormat
|
|
591
|
-
config,
|
|
592
|
-
minPercent, maxPercent);
|
|
589
|
+
config, trackingProgressCallback, minPercent, maxPercent);
|
|
593
590
|
// Run the agent with callback that includes current progress
|
|
594
591
|
const callbackWithProgress = onProgressReport
|
|
595
592
|
? (data) => onProgressReport({ ...data, progress: progressTracker.current })
|