loadHistory method

Future<void> loadHistory()

Load chat history from storage if available

Implementation

Future<void> loadHistory() async {
  if (storageManager != null && id.isNotEmpty) {
    try {
      final historyData = await storageManager!.loadObject('chat_session_$id');
      if (historyData != null) {
        _history.fromJson(historyData);
        _logger.debug('Loaded chat session history from storage');
      }
    } catch (e) {
      _logger.error('Failed to load chat session history: $e');
    }
  }
}