-
Notifications
You must be signed in to change notification settings - Fork 30
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
feature: tune description on monitor and anomaly detection #120
feature: tune description on monitor and anomaly detection #120
Conversation
Signed-off-by: yuye-aws <[email protected]>
Signed-off-by: yuye-aws <[email protected]>
Have you checked the performance of new version description? |
Good point! I am planning to check the performance of different descriptions later. As parameter description and returned result is missing now, can we include these information and replace the current description with the new description following hugging face format? |
integration test depends on k-NN PR to merged opensearch-project/k-NN#1383 |
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.
Few nits, overall LGTM as a starting point that we can tune later. Can you also include a similar description style for the search alerts tool? That will cover all of the AD and alerting tools.
@@ -48,7 +48,8 @@ | |||
@ToolAnnotation(SearchAnomalyDetectorsTool.TYPE) | |||
public class SearchAnomalyDetectorsTool implements Tool { | |||
public static final String TYPE = "SearchAnomalyDetectorsTool"; | |||
private static final String DEFAULT_DESCRIPTION = "Use this tool to search anomaly detectors."; | |||
private static final String DEFAULT_DESCRIPTION = | |||
"This is a tool that searches anomaly detectors. It takes 12 optional arguments named detectorName which is the explicit name of the monitor (default is null), and detectorNamePattern which is a wildcard query to match detector name (default is null), and indices which defines the index being detected (default is null), and highCardinality which defines whether the anomaly detector is high cardinality (default is null), and lastUpdateTime which defines the latest update time of the anomaly detector (default is null), and sortOrder which defines the order of the results (options are asc or desc, and default is asc), and sortString which defines how to sort the results (default is name.keyword), and size which defines the size of the request to be returned (default is 20), and startIndex which defines the index to start from (default is 0), and running which defines whether the anomaly detector is running (default is null, indicating both), and disabled which defines whether the anomaly detector is disabled (default is null, indicating both), and failed which defines whether the anomaly detector has failed (default is null, indicating both). The tool returns the a list of anomaly detectors."; |
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.
nit: Should be "returns the list of anomaly detectors, and the total number of anomaly detectors" for the last sentence
@@ -39,7 +39,8 @@ | |||
@ToolAnnotation(SearchAnomalyResultsTool.TYPE) | |||
public class SearchAnomalyResultsTool implements Tool { | |||
public static final String TYPE = "SearchAnomalyResultsTool"; | |||
private static final String DEFAULT_DESCRIPTION = "Use this tool to search anomaly results."; | |||
private static final String DEFAULT_DESCRIPTION = | |||
"This is a tool that searches anomaly results. It takes 9 arguments named detectorId which defines the detector ID to filter for (default is null), and realtime which defines whether the anomaly is real time, and anomalyGradeThreshold which defines the threshold for anomaly grade (a number between 0 and 1 that indicates how anomalous a data point is) (default is 0), and dataStartTime which defines the start time of the anomaly query (default is null), and dataEndTime which defines the end time of the anomaly query (default is null), and sortOrder which defines the order of the results (options are asc or desc, and default is desc), and sortString which which defines how to sort the results (default is data_start_time), and size which defines the size of the request to be returned (default is 20), and startIndex which defines the index to start from (default is 0).The tool returns a list of anomaly results."; |
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.
Same thing as previous comment - maybe something like "The tool returns a list of anomaly results, and the total number of anomaly results"
@@ -44,7 +44,8 @@ | |||
@ToolAnnotation(SearchMonitorsTool.TYPE) | |||
public class SearchMonitorsTool implements Tool { | |||
public static final String TYPE = "SearchMonitorsTool"; | |||
private static final String DEFAULT_DESCRIPTION = "Use this tool to search alerting monitors."; | |||
private static final String DEFAULT_DESCRIPTION = | |||
"This is a tool that searches alerting monitors. It takes 10 optional arguments named monitorId which defines the monitor ID to filter for (default is null), and monitorName which defines explicit name of the monitor (default is null), and monitorNamePattern which is a wildcard query to match detector name (default is null), and enabled which defines whether the monitor is enabled (default is null, indicating both), and hasTriggers which defines whether the monitor has triggers enabled (default is null, indicating both), and indices which defines the index being monitored (default is null), and sortOrder which defines the order of the results (options are asc or desc, and default is asc), and sortString which defines how to sort the results (default is name.keyword), and size which defines the size of the request to be returned (default is 20), and startIndex which defines the index to start from (default is 0). The tool returns a list of monitors."; |
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.
Same thing as previous comment - maybe something like "The tool returns a list of monitors, and the total number of monitors"
Thanks for the review comment. I will
I will include the change on search alerts tool in this PR. Please help review, thanks! |
Thanks for supplementing description on tool return results. I will apply your change. |
Signed-off-by: yuye-aws <[email protected]>
Signed-off-by: yuye-aws <[email protected]>
Signed-off-by: yuye-aws <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #120 +/- ##
============================================
- Coverage 81.23% 80.82% -0.42%
Complexity 193 193
============================================
Files 13 13
Lines 975 975
Branches 130 130
============================================
- Hits 792 788 -4
- Misses 133 137 +4
Partials 50 50 ☔ View full report in Codecov by Sentry. |
@ohltyler I have included description on search alert tool and updated description on returned results from tools. This PR is ready for review now. |
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.
LGTM! Thanks again for helping out on this!
Signed-off-by: yuye-aws <[email protected]> (cherry picked from commit c8b6898) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
(cherry picked from commit c8b6898) Signed-off-by: yuye-aws <[email protected]> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
…h-project#120) (opensearch-project#126) (cherry picked from commit c8b6898) Signed-off-by: yuye-aws <[email protected]> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Signed-off-by: yuye-aws <[email protected]>
Description
This PR tunes description on monitor, anomaly detection, and alert. The description follows the hugging face template: https://huggingface.co/docs/transformers/custom_tools#custom-tools-and-prompts
Issues Resolved
This PR tunes description on monitor and anomaly detection.
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.