opensearch-project / skills

Apache License 2.0
6 stars 29 forks source link

[FEATURE] Create Anomaly Detector Tool #337

Open ylwu-amzn opened 3 months ago

ylwu-amzn commented 3 months ago

We have get anomaly detector tool now. We can create some tool to create anomaly detector.

dblock commented 3 months ago

[Catch All Triage, attendees 1, 2, 3, 4, 5, 6, 7]

gaobinlong commented 3 months ago

I'm working on implementing this tool, the main purpose of this tool is that we give some prompt to LLM and let it give the suggested required parameters for creating anomaly detector, then we pop up a input form filling with the suggested parameters in OSD, users can modify the parameters if they want, after they confirmed they can click the create button to create an anomaly detector based on the suggestions.

So for this CreateAnomalyDetectorTool, we only accept an index name or an index pattern as the input parameter, and we fetch the index mappings and then construct a prompt containing the index mappings and an example of the create anomaly detector API, finally, we let LLM to give a formatted result which contains some key information like:

{
    "index": "",
    "categoryField": "",
    "aggregationField": "",
    "aggregationMethod": "",
    "dateFields": ""
}
gaobinlong commented 3 months ago

A demo video about let LLM help to create an anomaly detector:

https://github.com/opensearch-project/skills/assets/15811131/a8cb6dc0-2a25-4b4a-9939-07349cbdacbf