Class: RubyLLM::SemanticCache::ScopedMiddleware
- Inherits:
-
Middleware
- Object
- Middleware
- RubyLLM::SemanticCache::ScopedMiddleware
- Defined in:
- lib/ruby_llm/semantic_cache/scoped.rb
Overview
Middleware that uses a scoped cache instance
Constant Summary
Constants inherited from Middleware
Instance Attribute Summary
Attributes inherited from Middleware
Instance Method Summary collapse
-
#initialize(scoped, chat, threshold: nil, ttl: nil, on_cache_hit: nil, max_messages: nil) ⇒ ScopedMiddleware
constructor
A new instance of ScopedMiddleware.
Methods inherited from Middleware
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: ) @scoped = scoped end |