Module: OllamaChat::DocumentCache

Included in:
Chat
Defined in:
lib/ollama_chat/document_cache.rb

Instance Method Summary collapse

Instance Method Details

#configure_cacheObject



6
7
8
9
10
11
12
13
14
15
# File 'lib/ollama_chat/document_cache.rb', line 6

def configure_cache
  if @opts[?M]
    Documentrix::Documents::MemoryCache
  else
    document_cache_class
  end
rescue => e
  STDERR.puts "Caught #{e.class}: #{e} => Falling back to MemoryCache."
  Documentrix::Documents::MemoryCache
end

#document_cache_classObject



2
3
4
# File 'lib/ollama_chat/document_cache.rb', line 2

def document_cache_class
  Object.const_get(config.cache)
end