agentv 3.6.0 → 3.7.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.
@@ -14036,12 +14036,10 @@ function computeTraceSummary(messages) {
14036
14036
  }
14037
14037
  }
14038
14038
  }
14039
- const toolNames = Object.keys(toolCallCounts).sort();
14040
14039
  return {
14041
14040
  trace: {
14042
14041
  eventCount: totalToolCalls,
14043
- toolNames,
14044
- toolCallsByName: toolCallCounts,
14042
+ toolCalls: toolCallCounts,
14045
14043
  errorCount: 0,
14046
14044
  llmCallCount,
14047
14045
  ...hasAnyDuration ? { toolDurations } : {}
@@ -14065,7 +14063,7 @@ var DEFAULT_EXPLORATION_TOOLS = [
14065
14063
  function explorationRatio(summary, explorationTools = DEFAULT_EXPLORATION_TOOLS) {
14066
14064
  if (summary.eventCount === 0) return void 0;
14067
14065
  const explorationCalls = explorationTools.reduce(
14068
- (sum, tool2) => sum + (summary.toolCallsByName[tool2] ?? 0),
14066
+ (sum, tool2) => sum + (summary.toolCalls[tool2] ?? 0),
14069
14067
  0
14070
14068
  );
14071
14069
  return explorationCalls / summary.eventCount;
@@ -26435,11 +26433,9 @@ var ToolTrajectoryEvaluator = class {
26435
26433
  for (const call of toolCalls) {
26436
26434
  toolCallsByName[call.name] = (toolCallsByName[call.name] ?? 0) + 1;
26437
26435
  }
26438
- const toolNames = Object.keys(toolCallsByName).sort();
26439
26436
  return {
26440
26437
  eventCount: toolCalls.length,
26441
- toolNames,
26442
- toolCallsByName,
26438
+ toolCalls: toolCallsByName,
26443
26439
  errorCount: 0
26444
26440
  };
26445
26441
  }
@@ -26457,7 +26453,7 @@ var ToolTrajectoryEvaluator = class {
26457
26453
  const assertions = [];
26458
26454
  for (const toolName of toolNames) {
26459
26455
  const required = minimums[toolName];
26460
- const actual = summary.toolCallsByName[toolName] ?? 0;
26456
+ const actual = summary.toolCalls[toolName] ?? 0;
26461
26457
  if (actual >= required) {
26462
26458
  assertions.push({
26463
26459
  text: `${toolName}: called ${actual} times (required >=${required})`,
@@ -29075,7 +29071,7 @@ async function runBatchEvaluation(options) {
29075
29071
  const providerResponse = batchResponse[i];
29076
29072
  const output = providerResponse.output;
29077
29073
  const hasExecutionMetrics = providerResponse.tokenUsage !== void 0 || providerResponse.costUsd !== void 0 || providerResponse.durationMs !== void 0;
29078
- const computed = output ? computeTraceSummary(output) : hasExecutionMetrics ? { trace: { eventCount: 0, toolNames: [], toolCallsByName: {}, errorCount: 0 } } : void 0;
29074
+ const computed = output ? computeTraceSummary(output) : hasExecutionMetrics ? { trace: { eventCount: 0, toolCalls: {}, errorCount: 0 } } : void 0;
29079
29075
  const merged = computed ? mergeExecutionMetrics(computed, {
29080
29076
  tokenUsage: providerResponse.tokenUsage,
29081
29077
  costUsd: providerResponse.costUsd,
@@ -29472,7 +29468,7 @@ async function runEvalCase(options) {
29472
29468
  }
29473
29469
  const output = providerResponse.output;
29474
29470
  const hasExecutionMetrics = providerResponse.tokenUsage !== void 0 || providerResponse.costUsd !== void 0 || providerResponse.durationMs !== void 0;
29475
- const computed = output ? computeTraceSummary(output) : hasExecutionMetrics ? { trace: { eventCount: 0, toolNames: [], toolCallsByName: {}, errorCount: 0 } } : void 0;
29471
+ const computed = output ? computeTraceSummary(output) : hasExecutionMetrics ? { trace: { eventCount: 0, toolCalls: {}, errorCount: 0 } } : void 0;
29476
29472
  const merged = computed ? mergeExecutionMetrics(computed, {
29477
29473
  tokenUsage: providerResponse.tokenUsage,
29478
29474
  costUsd: providerResponse.costUsd,
@@ -30829,7 +30825,10 @@ var OtelTraceExporter = class {
30829
30825
  if (result.trace) {
30830
30826
  const t = result.trace;
30831
30827
  rootSpan.setAttribute("agentv.trace.event_count", t.eventCount);
30832
- rootSpan.setAttribute("agentv.trace.tool_names", t.toolNames.join(","));
30828
+ rootSpan.setAttribute(
30829
+ "agentv.trace.tool_names",
30830
+ Object.keys(t.toolCalls).sort().join(",")
30831
+ );
30833
30832
  if (t.llmCallCount != null)
30834
30833
  rootSpan.setAttribute("agentv.trace.llm_call_count", t.llmCallCount);
30835
30834
  }
@@ -31249,4 +31248,4 @@ export {
31249
31248
  OtelStreamingObserver,
31250
31249
  createAgentKernel
31251
31250
  };
31252
- //# sourceMappingURL=chunk-K4RXLQWV.js.map
31251
+ //# sourceMappingURL=chunk-XGG64VIY.js.map