Class: RubyLLM::SemanticCache::CacheStores::Base
- Inherits:
-
Object
- Object
- RubyLLM::SemanticCache::CacheStores::Base
- Defined in:
- lib/ruby_llm/semantic_cache/cache_stores/base.rb
Instance Method Summary collapse
-
#clear! ⇒ Object
Clear all entries.
-
#delete(id) ⇒ Object
Delete an entry by ID.
-
#empty? ⇒ Boolean
Check if the store is empty.
-
#get(id) ⇒ Hash?
Get a cached entry by ID.
-
#initialize(config) ⇒ Base
constructor
A new instance of Base.
-
#set(id, data, ttl: nil) ⇒ Object
Store an entry.
-
#size ⇒ Object
Get the number of entries stored.
Constructor Details
#initialize(config) ⇒ Base
Returns a new instance of Base.
7 8 9 |
# File 'lib/ruby_llm/semantic_cache/cache_stores/base.rb', line 7 def initialize(config) @config = config end |
Instance Method Details
#clear! ⇒ Object
Clear all entries
33 34 35 |
# File 'lib/ruby_llm/semantic_cache/cache_stores/base.rb', line 33 def clear! raise NotImplementedError end |
#delete(id) ⇒ Object
Delete an entry by ID
28 29 30 |
# File 'lib/ruby_llm/semantic_cache/cache_stores/base.rb', line 28 def delete(id) raise NotImplementedError end |
#empty? ⇒ Boolean
Check if the store is empty
38 39 40 |
# File 'lib/ruby_llm/semantic_cache/cache_stores/base.rb', line 38 def empty? raise NotImplementedError end |
#get(id) ⇒ Hash?
Get a cached entry by ID
14 15 16 |
# File 'lib/ruby_llm/semantic_cache/cache_stores/base.rb', line 14 def get(id) raise NotImplementedError end |
#set(id, data, ttl: nil) ⇒ Object
Store an entry
22 23 24 |
# File 'lib/ruby_llm/semantic_cache/cache_stores/base.rb', line 22 def set(id, data, ttl: nil) raise NotImplementedError end |
#size ⇒ Object
Get the number of entries stored
43 44 45 |
# File 'lib/ruby_llm/semantic_cache/cache_stores/base.rb', line 43 def size raise NotImplementedError end |