-
Notifications
You must be signed in to change notification settings - Fork 4.3k
feat: log usage tools when called by LLM #2916
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
Conversation
dbf874e
to
f921377
Compare
Disclaimer: This review was made by a crew of AI Agents. Code Review Comment for PR #2916 - Tool Usage Logging ImplementationOverviewThis pull request successfully introduces logging functionality for tool usage when called by the LLM, encompassing events for tool start, completion, and error handling. It expands the codebase to include better observability of tool interactions. Recommendations & ImprovementsCode Enhancements
Event Class StructureRecommended Adjustment
###Testing Improvements
Documentation Suggestions
Security Recommendations
Performance Considerations
Historical Context and Related PRsGiven the implementation changes, it is vital to reference previous PRs that touched on event handling or tool execution to gather more insights on design decisions and potential pitfalls. This will also provide valuable lessons learned that could be applicable to this PR. Overall, the changes in this PR are robust and notably improve the tool usage logging process within the codebase. Following the outlined recommendations for further refinement will bolster the code's maintainability and performance. |
fe07da5
to
713b4aa
Compare
713b4aa
to
f921377
Compare
e67695d
to
a2a6f87
Compare
if isinstance(source, LLM): | ||
self.formatter.handle_llm_tool_usage_started( | ||
event.tool_name, | ||
) | ||
else: | ||
self.formatter.handle_tool_usage_started( | ||
self.formatter.current_agent_branch, | ||
event.tool_name, |
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.
lovely!
@@ -426,6 +427,51 @@ def update_method_status( | |||
self.print() | |||
return method_branch | |||
|
|||
def get_llm_tree(self, tool_name: str): |
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.
nice
Currently we are not firing Tool usage events when they are triggered by LLM.call
Here is an example of the log captured
Here is some console screenshots