@wix/evalforge-evaluator 0.156.0 → 0.157.0
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/build/index.js +13 -8
- package/build/index.js.map +2 -2
- package/build/index.mjs +15 -10
- package/build/index.mjs.map +2 -2
- package/package.json +2 -2
package/build/index.js
CHANGED
|
@@ -3723,7 +3723,7 @@ async function executeWithAiSdk(context) {
|
|
|
3723
3723
|
const timeoutHandle = setTimeout(() => {
|
|
3724
3724
|
abortController.abort(
|
|
3725
3725
|
new Error(
|
|
3726
|
-
`Simple Agent
|
|
3726
|
+
`Simple Agent streamText timed out after ${SDK_TIMEOUT_MS}ms (model=${modelId}, scenario=${scenario.name})`
|
|
3727
3727
|
)
|
|
3728
3728
|
);
|
|
3729
3729
|
}, SDK_TIMEOUT_MS);
|
|
@@ -3769,7 +3769,7 @@ async function executeWithAiSdk(context) {
|
|
|
3769
3769
|
const stepTimestamps = [];
|
|
3770
3770
|
const { triggerPromptImages } = context;
|
|
3771
3771
|
const hasImages = triggerPromptImages && triggerPromptImages.length > 0;
|
|
3772
|
-
const result =
|
|
3772
|
+
const result = (0, import_ai.streamText)({
|
|
3773
3773
|
...topLevelExtras,
|
|
3774
3774
|
model,
|
|
3775
3775
|
abortSignal: abortController.signal,
|
|
@@ -3827,14 +3827,19 @@ async function executeWithAiSdk(context) {
|
|
|
3827
3827
|
}
|
|
3828
3828
|
}
|
|
3829
3829
|
});
|
|
3830
|
+
const [resolvedText, resolvedSteps, resolvedUsage] = await Promise.all([
|
|
3831
|
+
result.text,
|
|
3832
|
+
result.steps,
|
|
3833
|
+
result.usage
|
|
3834
|
+
]);
|
|
3830
3835
|
const durationMs = Date.now() - startTime;
|
|
3831
3836
|
const usage = {
|
|
3832
|
-
inputTokens:
|
|
3833
|
-
outputTokens:
|
|
3834
|
-
totalTokens:
|
|
3837
|
+
inputTokens: resolvedUsage.inputTokens ?? 0,
|
|
3838
|
+
outputTokens: resolvedUsage.outputTokens ?? 0,
|
|
3839
|
+
totalTokens: resolvedUsage.totalTokens ?? 0
|
|
3835
3840
|
};
|
|
3836
3841
|
const llmTrace = buildLLMTrace2(
|
|
3837
|
-
|
|
3842
|
+
resolvedSteps,
|
|
3838
3843
|
durationMs,
|
|
3839
3844
|
usage,
|
|
3840
3845
|
modelId,
|
|
@@ -3847,12 +3852,12 @@ async function executeWithAiSdk(context) {
|
|
|
3847
3852
|
}
|
|
3848
3853
|
const conversation = buildConversation3(
|
|
3849
3854
|
scenario.triggerPrompt,
|
|
3850
|
-
|
|
3855
|
+
resolvedSteps,
|
|
3851
3856
|
startTime,
|
|
3852
3857
|
stepTimestamps
|
|
3853
3858
|
);
|
|
3854
3859
|
return {
|
|
3855
|
-
outputText:
|
|
3860
|
+
outputText: resolvedText,
|
|
3856
3861
|
durationMs,
|
|
3857
3862
|
usage,
|
|
3858
3863
|
llmTrace,
|