diff --git a/keep-ui/app/ai/ai.tsx b/keep-ui/app/ai/ai.tsx index efce6223e..2cf17ce85 100644 --- a/keep-ui/app/ai/ai.tsx +++ b/keep-ui/app/ai/ai.tsx @@ -81,32 +81,38 @@ export default function Ai() { refetchAIStats(); }} /> - {/*
Value: {setting.value}
- { - // const newValue = parseFloat(e.target.value); - // setting.value = newValue; - // updateAISettings(algorithm_config.algorithm_id, algorithm_config); - // refetchAIStats(); - // }} - className="mt-2 w-full" - /> */} + + ) : null} + {setting.type === "int" ? ( +Value: {setting.value}
+ { + const newValue = parseFloat(e.target.value); + setting.value = newValue; + updateAISettings( + algorithm_config.algorithm_id, + algorithm_config + ); + refetchAIStats(); + }} + />- {algorithm_config.feedback_log - ? algorithm_config.feedback_log +))} diff --git a/keep-ui/app/ai/model.ts b/keep-ui/app/ai/model.ts index b08e850e0..9f4788436 100644 --- a/keep-ui/app/ai/model.ts +++ b/keep-ui/app/ai/model.ts @@ -1,7 +1,7 @@ export interface AIConfig { algorithm_id: string; settings: any; - feedback_log: string; + feedback_logs: string; algorithm: { name: string; description: string; diff --git a/keep/api/core/db.py b/keep/api/core/db.py index ae820e1b1..b06a40813 100644 --- a/keep/api/core/db.py +++ b/keep/api/core/db.py @@ -4390,6 +4390,7 @@ def update_extrnal_ai_settings(tenant_id: str, ai_settings: ExternalAIConfigAndM ExternalAIConfigAndMetadata.id == ai_settings.id, ).first() setting.settings = json.dumps(ai_settings.settings) + setting.feedback_logs = ai_settings.feedback_logs session.add(setting) session.commit() return setting diff --git a/keep/api/models/db/ai_external.py b/keep/api/models/db/ai_external.py index c5552fd38..1acbdac13 100644 --- a/keep/api/models/db/ai_external.py +++ b/keep/api/models/db/ai_external.py @@ -52,6 +52,8 @@ def unique_id(self): config_default=json.dumps( [ {"min": 0.3, "max": 0.99, "value": 0.8, "type": "float", "name": "Correlation Threshold", "description": "The minimum correlation value to consider two alerts belonging to an ancident."}, + {"min": 0.3, "max": 0.99, "value": 0.8, "type": "float", "name": "Model Accuracy Threshold", "description": "The trained model accuracy will be evaluated using cross-validation. If the accuracy is below this threshold, the model will be retrained."}, + {"min": 2, "max": 20, "value": 10, "type": "int", "name": "Train Epochs", "description": "The amount of epochs to train the model for. The less the better to avoid over-fitting."}, {"value": True, "type": "bool", "name": "Enabled", "description": "Enable or disable the algorithm."}, ] )+ {algorithm_config.feedback_logs + ? algorithm_config.feedback_logs : "Algorithm not executed yet."} -+