-
Notifications
You must be signed in to change notification settings - Fork 19.6k
feat(core): automatically count and store meta for tool call count #33756
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
CodSpeed Performance ReportMerging #33756 will not alter performanceComparing
|
| def _store_tool_call_metadata(self, run: Run) -> None: | ||
| """Store tool call count in run metadata automatically.""" | ||
| try: | ||
| # Avoid circular imports |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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 {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unnecessarily defensive right?
proof of concept