Class: Langfuse::PromptCache::Entry
- Inherits:
-
Struct
- Object
- Struct
- Langfuse::PromptCache::Entry
- Defined in:
- lib/langfuse/prompt_cache.rb
Instance Attribute Summary collapse
-
#cached_at ⇒ Object
Returns the value of attribute cached_at.
-
#prompt ⇒ Object
Returns the value of attribute prompt.
Instance Method Summary collapse
Instance Attribute Details
#cached_at ⇒ Object
Returns the value of attribute cached_at
15 16 17 |
# File 'lib/langfuse/prompt_cache.rb', line 15 def cached_at @cached_at end |
#prompt ⇒ Object
Returns the value of attribute prompt
15 16 17 |
# File 'lib/langfuse/prompt_cache.rb', line 15 def prompt @prompt end |
Instance Method Details
#fresh?(ttl_seconds, now) ⇒ Boolean
16 17 18 19 20 |
# File 'lib/langfuse/prompt_cache.rb', line 16 def fresh?(ttl_seconds, now) return false if ttl_seconds.nil? now - cached_at < ttl_seconds end |