Skip to content

feat: Wire LDAIMetrics tool_calls and duration_ms into tracker#152

Draft
jsonbailey wants to merge 1 commit intojb/aic-2388/managed-graph-resultfrom
jb/aic-2388/enrich-metrics
Draft

feat: Wire LDAIMetrics tool_calls and duration_ms into tracker#152
jsonbailey wants to merge 1 commit intojb/aic-2388/managed-graph-resultfrom
jb/aic-2388/enrich-metrics

Conversation

@jsonbailey
Copy link
Copy Markdown
Contributor

Summary

Pins down the contract for the new tool_calls and duration_ms fields on LDAIMetrics. The integration was introduced incrementally as the OpenAI and LangChain runners migrated; this PR adds test coverage that will guard the contract going forward.

  • LDAIMetrics.to_dict() exposes toolCalls and durationMs
  • track_metrics_of / track_metrics_of_async use a runner-supplied duration_ms directly when present, otherwise measure elapsed wall-clock time
  • track_metrics_of calls track_tool_calls() when metrics.tool_calls is present, emitting one $ld:ai:tool_call event per key and recording the list on LDAIMetricSummary

Stack

PR 7 → PR 8 → PR 8-openai → PR 8-langchain → PR 9 → PR 10 (this) → PR 11 → PR 11-openai → PR 11-langchain → PR 12

Test plan

  • make test — 267 tests pass
  • make lint — mypy clean

🤖 Generated with Claude Code

@jsonbailey jsonbailey force-pushed the jb/aic-2388/enrich-metrics branch from 98e3ccc to cbe2eda Compare April 28, 2026 23:24
@jsonbailey jsonbailey changed the title feat(ldai): Wire LDAIMetrics tool_calls and duration_ms into tracker feat: Wire LDAIMetrics tool_calls and duration_ms into tracker Apr 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant