LLMService constructor

LLMService({
  1. bool enableCaching = true,
})

Creates a new LLM service.

enableCaching - Whether to enable response caching (default: true).

Implementation

LLMService({bool enableCaching = true}) : _cachingEnabled = enableCaching {
  if (_cachingEnabled) {
    final home =
        Platform.environment['HOME'] ?? Platform.environment['USERPROFILE'];
    _cache = LLMCache(
      maxEntries: 100,
      ttl: const Duration(hours: 24),
      persistPath: '$home/.spectra/cache.json',
    );
  }
}