Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@mdrxy
Copy link
Collaborator

@mdrxy mdrxy commented Oct 31, 2025

proof of concept

@github-actions github-actions bot added core Related to the package `langchain-core` feature labels Oct 31, 2025
@codspeed-hq
Copy link

codspeed-hq bot commented Oct 31, 2025

CodSpeed Performance Report

Merging #33756 will not alter performance

Comparing mdrxy/count-tool-calls (886a4b4) with master (7aaaa37)1

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

Summary

✅ 13 untouched
⏩ 21 skipped2

Footnotes

  1. No successful run was found on master (106c6ac) during the generation of this report, so 7aaaa37 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

  2. 21 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

def _store_tool_call_metadata(self, run: Run) -> None:
"""Store tool call count in run metadata automatically."""
try:
# Avoid circular imports
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Utils doesn't import from base, so this shouldn't be needed right?

def _persist_run(self, run: Run) -> None:
"""Persist a run."""

def _store_tool_call_metadata(self, run: Run) -> None:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd put this all in _complete_llm_run in tracers/core. We don't need to do this on all runs IMO

Returns:
The tool call count if stored in metadata, otherwise `None`.
"""
extra = getattr(run, "extra", {}) or {}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unnecessarily defensive right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Related to the package `langchain-core` feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants