-
Notifications
You must be signed in to change notification settings - Fork 133
Improve Strands Tool Error Capturing #1623
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: main
Are you sure you want to change the base?
Conversation
✅MegaLinter analysis: Success
See detailed reports in MegaLinter artifacts |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1623 +/- ##
=======================================
Coverage 81.65% 81.66%
=======================================
Files 209 209
Lines 24392 24416 +24
Branches 3870 3873 +3
=======================================
+ Hits 19918 19939 +21
- Misses 3162 3164 +2
- Partials 1312 1313 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
newrelic/hooks/mlmodel_strands.py
Outdated
| transaction = current_transaction() | ||
| if transaction: | ||
| # notice_error will handle pulling from sys.exc_info() if there's an active exception. | ||
| transaction.notice_error() |
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.
Do we have a handle to the tool_id here (stored in the strands_attrs? We typically pass the tool_id/ agent_id in as an attribute to the notice_error call.
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 was able to add tool_id, no handle to agent_id though.

Overview
@tool.stream()instead of relying on the_tool_funcattribute for better coverage.