@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.mjs
CHANGED
|
@@ -3404,8 +3404,8 @@ defaultRegistry.register(openCodeAdapter);
|
|
|
3404
3404
|
// src/run-scenario/agents/simple-agent/execute.ts
|
|
3405
3405
|
import {
|
|
3406
3406
|
APICallError,
|
|
3407
|
-
|
|
3408
|
-
|
|
3407
|
+
stepCountIs,
|
|
3408
|
+
streamText
|
|
3409
3409
|
} from "ai";
|
|
3410
3410
|
import { createAnthropic } from "@ai-sdk/anthropic";
|
|
3411
3411
|
import { createGoogleGenerativeAI } from "@ai-sdk/google";
|
|
@@ -3742,7 +3742,7 @@ async function executeWithAiSdk(context) {
|
|
|
3742
3742
|
const timeoutHandle = setTimeout(() => {
|
|
3743
3743
|
abortController.abort(
|
|
3744
3744
|
new Error(
|
|
3745
|
-
`Simple Agent
|
|
3745
|
+
`Simple Agent streamText timed out after ${SDK_TIMEOUT_MS}ms (model=${modelId}, scenario=${scenario.name})`
|
|
3746
3746
|
)
|
|
3747
3747
|
);
|
|
3748
3748
|
}, SDK_TIMEOUT_MS);
|
|
@@ -3788,7 +3788,7 @@ async function executeWithAiSdk(context) {
|
|
|
3788
3788
|
const stepTimestamps = [];
|
|
3789
3789
|
const { triggerPromptImages } = context;
|
|
3790
3790
|
const hasImages = triggerPromptImages && triggerPromptImages.length > 0;
|
|
3791
|
-
const result =
|
|
3791
|
+
const result = streamText({
|
|
3792
3792
|
...topLevelExtras,
|
|
3793
3793
|
model,
|
|
3794
3794
|
abortSignal: abortController.signal,
|
|
@@ -3846,14 +3846,19 @@ async function executeWithAiSdk(context) {
|
|
|
3846
3846
|
}
|
|
3847
3847
|
}
|
|
3848
3848
|
});
|
|
3849
|
+
const [resolvedText, resolvedSteps, resolvedUsage] = await Promise.all([
|
|
3850
|
+
result.text,
|
|
3851
|
+
result.steps,
|
|
3852
|
+
result.usage
|
|
3853
|
+
]);
|
|
3849
3854
|
const durationMs = Date.now() - startTime;
|
|
3850
3855
|
const usage = {
|
|
3851
|
-
inputTokens:
|
|
3852
|
-
outputTokens:
|
|
3853
|
-
totalTokens:
|
|
3856
|
+
inputTokens: resolvedUsage.inputTokens ?? 0,
|
|
3857
|
+
outputTokens: resolvedUsage.outputTokens ?? 0,
|
|
3858
|
+
totalTokens: resolvedUsage.totalTokens ?? 0
|
|
3854
3859
|
};
|
|
3855
3860
|
const llmTrace = buildLLMTrace2(
|
|
3856
|
-
|
|
3861
|
+
resolvedSteps,
|
|
3857
3862
|
durationMs,
|
|
3858
3863
|
usage,
|
|
3859
3864
|
modelId,
|
|
@@ -3866,12 +3871,12 @@ async function executeWithAiSdk(context) {
|
|
|
3866
3871
|
}
|
|
3867
3872
|
const conversation = buildConversation3(
|
|
3868
3873
|
scenario.triggerPrompt,
|
|
3869
|
-
|
|
3874
|
+
resolvedSteps,
|
|
3870
3875
|
startTime,
|
|
3871
3876
|
stepTimestamps
|
|
3872
3877
|
);
|
|
3873
3878
|
return {
|
|
3874
|
-
outputText:
|
|
3879
|
+
outputText: resolvedText,
|
|
3875
3880
|
durationMs,
|
|
3876
3881
|
usage,
|
|
3877
3882
|
llmTrace,
|