From c8b68984b5ec576f3d214cf5f732c05a2809ab95 Mon Sep 17 00:00:00 2001 From: Yuye Zhu Date: Sat, 13 Jan 2024 00:59:37 +0800 Subject: [PATCH] feature: tune description on monitor and anomaly detection (#120) Signed-off-by: yuye-aws --- src/main/java/org/opensearch/agent/tools/SearchAlertsTool.java | 3 ++- .../org/opensearch/agent/tools/SearchAnomalyDetectorsTool.java | 3 ++- .../org/opensearch/agent/tools/SearchAnomalyResultsTool.java | 3 ++- .../java/org/opensearch/agent/tools/SearchMonitorsTool.java | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/opensearch/agent/tools/SearchAlertsTool.java b/src/main/java/org/opensearch/agent/tools/SearchAlertsTool.java index 88797278..0997198f 100644 --- a/src/main/java/org/opensearch/agent/tools/SearchAlertsTool.java +++ b/src/main/java/org/opensearch/agent/tools/SearchAlertsTool.java @@ -32,7 +32,8 @@ @ToolAnnotation(SearchAlertsTool.TYPE) public class SearchAlertsTool implements Tool { public static final String TYPE = "SearchAlertsTool"; - private static final String DEFAULT_DESCRIPTION = "Use this tool to search alerts."; + private static final String DEFAULT_DESCRIPTION = + "This is a tool that finds alert trigger information. It takes 12 optional argument named 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 monitor_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 searchString which defines the search string to use for searching a specific alert (default is an empty String), and severityLevel which defines the severity level to filter for (default is ALL), and alertState which defines the alert state to filter for (default is ALL), and monitorId which defines the monitor ID to filter for, and alertIndex which defines the alert index to search from (default is null), and monitorIds which defines the list of monitor IDs to filter for, and workflowIds which defines the list of workflow IDs to filter for(default is null), and alertIds which defines the list of alert IDs to filter for (default is null). The tool returns a list of alerts, and the total number of alerts."; @Setter @Getter diff --git a/src/main/java/org/opensearch/agent/tools/SearchAnomalyDetectorsTool.java b/src/main/java/org/opensearch/agent/tools/SearchAnomalyDetectorsTool.java index 95c80966..100b9b36 100644 --- a/src/main/java/org/opensearch/agent/tools/SearchAnomalyDetectorsTool.java +++ b/src/main/java/org/opensearch/agent/tools/SearchAnomalyDetectorsTool.java @@ -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 list of anomaly detectors, and the total number of anomaly detectors."; @Setter @Getter diff --git a/src/main/java/org/opensearch/agent/tools/SearchAnomalyResultsTool.java b/src/main/java/org/opensearch/agent/tools/SearchAnomalyResultsTool.java index ef6a3a04..86c62918 100644 --- a/src/main/java/org/opensearch/agent/tools/SearchAnomalyResultsTool.java +++ b/src/main/java/org/opensearch/agent/tools/SearchAnomalyResultsTool.java @@ -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, and the total number of anomaly result."; @Setter @Getter diff --git a/src/main/java/org/opensearch/agent/tools/SearchMonitorsTool.java b/src/main/java/org/opensearch/agent/tools/SearchMonitorsTool.java index a737bab2..91f25182 100644 --- a/src/main/java/org/opensearch/agent/tools/SearchMonitorsTool.java +++ b/src/main/java/org/opensearch/agent/tools/SearchMonitorsTool.java @@ -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, and the total number of monitors."; @Setter @Getter