diff --git a/keep-ui/app/alerts/alert-create-incident-ai-modal.tsx b/keep-ui/app/alerts/alert-create-incident-ai-modal.tsx index e236413e2..c3027cca6 100644 --- a/keep-ui/app/alerts/alert-create-incident-ai-modal.tsx +++ b/keep-ui/app/alerts/alert-create-incident-ai-modal.tsx @@ -92,6 +92,7 @@ const CreateIncidentWithAIModal = ({ // If timeout error (which happens after 30s with NextJS), wait 10s and retry // This handles cases where the request goes through the NextJS server which has a 30s timeout + // TODO: https://github.com/keephq/keep/issues/2374 if (!response.ok && response.status === 500) { await new Promise((resolve) => setTimeout(resolve, 10000)); response = await fetch(`${apiUrl}/incidents/ai/suggest`, { diff --git a/keep/api/bl/ai_suggestion_bl.py b/keep/api/bl/ai_suggestion_bl.py index 911b7309a..58725991d 100644 --- a/keep/api/bl/ai_suggestion_bl.py +++ b/keep/api/bl/ai_suggestion_bl.py @@ -29,8 +29,11 @@ def __init__(self, tenant_id: str, session: Session | None = None) -> None: self.session = session if session else get_session_sync() # Todo: interface it with any model + # https://github.com/keephq/keep/issues/2373 # Todo: per-tenant keys + # https://github.com/keephq/keep/issues/2365 # Todo: also goes with settings page + # https://github.com/keephq/keep/issues/2365 try: self._client = OpenAI() except OpenAIError as e: diff --git a/keep/api/models/db/ai_suggestion.py b/keep/api/models/db/ai_suggestion.py index 3fca7060e..72f326d73 100644 --- a/keep/api/models/db/ai_suggestion.py +++ b/keep/api/models/db/ai_suggestion.py @@ -51,31 +51,3 @@ class AIFeedback(SQLModel, table=True): class Config: arbitrary_types_allowed = True - - -""" -SQL commands to create the tables in SQLite: - -CREATE TABLE aisuggestion ( - id TEXT PRIMARY KEY, - tenant_id TEXT, - user_id TEXT, - suggestion_input TEXT, - suggestion_input_hash TEXT, - suggestion_type TEXT, - suggestion_content TEXT, - model TEXT, - created_at TIMESTAMP -); -CREATE TABLE aifeedback ( - id TEXT PRIMARY KEY, - suggestion_id TEXT, - user_id TEXT, - feedback_content TEXT, - rating INTEGER, - comment TEXT, - created_at TIMESTAMP, - updated_at TIMESTAMP, - FOREIGN KEY(suggestion_id) REFERENCES aisuggestion(id) -); -"""