-
Notifications
You must be signed in to change notification settings - Fork 549
fix(logging): add "Tool" type to message sender labeling #1412
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
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Pull Request Overview
This PR fixes a logging issue where tool messages were incorrectly labeled as "System" messages in the LoggingCallbackHandler output. The change adds explicit handling for "tool" type messages to improve debugging clarity.
- Adds "Tool" label for messages with type "tool" in the logging callback handler
- Includes comprehensive test coverage to verify the new tool message labeling functionality
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
File | Description |
---|---|
nemoguardrails/logging/callbacks.py | Adds conditional logic to label tool messages as "Tool" instead of defaulting to "System" |
tests/test_callbacks.py | Adds test case with mock verification to ensure tool messages are properly labeled in logging output |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
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.
Looks good, just a couple of cleanups and suggestion on using caplog instead of patching logging ourselves before merging.
Previously, messages of type "tool" were not distinctly labeled in the LoggingCallbackHandler output, causing them to be grouped under "System". This change adds explicit handling for "tool" messages, labeling them as "Tool" in the logs for improved clarity and debugging.
27318b6
to
08629b5
Compare
Previously, messages of type "tool" were not distinctly labeled in the LoggingCallbackHandler output, causing them to be grouped under "System". This change adds explicit handling for "tool" messages, labeling them as "Tool" in the logs for improved clarity and debugging.
Previously, messages of type "tool" were not distinctly labeled in the LoggingCallbackHandler output, causing them to be grouped under "System". This change adds explicit handling for "tool" messages, labeling them as "Tool" in the logs for improved clarity and debugging.
Description
Previously, messages of type "tool" were not distinctly labeled in the LoggingCallbackHandler output, causing them to be grouped under "System".
This change adds explicit handling for "tool" messages, labeling them as "Tool" in the logs for improved clarity and debugging.