Class: RubyLLM::SemanticCache::ScopedMiddleware

Inherits:
Middleware
  • Object
show all
Defined in:
lib/ruby_llm/semantic_cache/scoped.rb

Overview

Middleware that uses a scoped cache instance

Constant Summary

Constants inherited from Middleware

Middleware::DELEGATED_METHODS

Instance Attribute Summary

Attributes inherited from Middleware

#chat

Instance Method Summary collapse

Methods inherited from Middleware

#ask

Constructor Details

#initialize(scoped, chat, threshold: nil, ttl: nil, on_cache_hit: nil, max_messages: nil) ⇒ ScopedMiddleware

Returns a new instance of ScopedMiddleware.



224
225
226
227
# File 'lib/ruby_llm/semantic_cache/scoped.rb', line 224

def initialize(scoped, chat, threshold: nil, ttl: nil, on_cache_hit: nil, max_messages: nil)
  super(chat, threshold: threshold, ttl: ttl, on_cache_hit: on_cache_hit, max_messages: max_messages)
  @scoped = scoped
end