@wix/evalforge-evaluator 0.133.0 → 0.134.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.mjs CHANGED
@@ -3474,9 +3474,10 @@ function buildConversation3(triggerPrompt, steps, executionStartMs, stepTimestam
3474
3474
  });
3475
3475
  for (let i = 0; i < steps.length; i++) {
3476
3476
  const step = steps[i];
3477
- const stepTimestamp = new Date(
3478
- stepTimestamps[i] ?? executionStartMs
3479
- ).toISOString();
3477
+ const stepStartedAt = i === 0 ? executionStartMs : stepTimestamps[i - 1] ?? executionStartMs;
3478
+ const stepFinishedAt = stepTimestamps[i] ?? executionStartMs;
3479
+ const assistantTimestamp = new Date(stepStartedAt).toISOString();
3480
+ const toolResultTimestamp = new Date(stepFinishedAt).toISOString();
3480
3481
  const assistantContent = [];
3481
3482
  if (step.reasoningText) {
3482
3483
  assistantContent.push({ type: "thinking", thinking: step.reasoningText });
@@ -3496,7 +3497,7 @@ function buildConversation3(triggerPrompt, steps, executionStartMs, stepTimestam
3496
3497
  messages.push({
3497
3498
  role: "assistant",
3498
3499
  content: assistantContent,
3499
- timestamp: stepTimestamp
3500
+ timestamp: assistantTimestamp
3500
3501
  });
3501
3502
  }
3502
3503
  if (step.toolResults.length > 0) {
@@ -3513,7 +3514,7 @@ function buildConversation3(triggerPrompt, steps, executionStartMs, stepTimestam
3513
3514
  messages.push({
3514
3515
  role: "user",
3515
3516
  content: resultBlocks,
3516
- timestamp: stepTimestamp
3517
+ timestamp: toolResultTimestamp
3517
3518
  });
3518
3519
  }
3519
3520
  }