AILogStrategy constructor

AILogStrategy({
  1. required String apiKey,
  2. String baseUrl = 'https://api.openai.com/v1',
  3. bool enableAnalysis = true,
  4. bool enableInsights = true,
  5. bool enableAnomalyDetection = true,
  6. Duration analysisInterval = const Duration(minutes: 5),
  7. int batchSize = 100,
})

Implementation

AILogStrategy({
  required String apiKey,
  String baseUrl = 'https://api.openai.com/v1',
  bool enableAnalysis = true,
  bool enableInsights = true,
  bool enableAnomalyDetection = true,
  Duration analysisInterval = const Duration(minutes: 5),
  int batchSize = 100,
}) : _apiKey = apiKey,
     _baseUrl = baseUrl,
     _httpClient = HttpClient(),
     _enableAnalysis = enableAnalysis,
     _enableInsights = enableInsights,
     _enableAnomalyDetection = enableAnomalyDetection,
     _analysisInterval = analysisInterval,
     _batchSize = batchSize {
  logLevel = LogLevel.info;
  loggerLogLevel = LogLevel.info;
  supportedEvents = [
    LogEvent(
      eventName: 'ai_analysis',
      eventMessage: 'AI analysis of log patterns',
    ),
    LogEvent(eventName: 'ai_insight', eventMessage: 'AI-generated insight'),
    LogEvent(eventName: 'ai_anomaly', eventMessage: 'AI-detected anomaly'),
  ];
}