Class: Insika::ContextProvider
- Inherits:
-
Object
- Object
- Insika::ContextProvider
- Defined in:
- lib/insika/context/provider.rb
Overview
Base class for a context provider. Concrete
subclasses live in Insika::Context::Providers. The base is
deliberately minimal: required? lives on the provider, not the wiring.
Direct Known Subclasses
Insika::Context::CatalogProvider, Insika::Context::Providers::Briefing, Insika::Context::Providers::Memory, Insika::Context::Providers::Prompt, Insika::Context::Providers::Request, Insika::Context::Providers::Session, Insika::Context::Providers::SkillTrigger
Instance Method Summary collapse
-
#call(_request) ⇒ Object
-> [ContextFragment]; may do IO.
- #enabled_for?(_profile) ⇒ Boolean
-
#id ⇒ Object
override for a stable name.
-
#layer ⇒ Object
which cache layer the output belongs to.
-
#required? ⇒ Boolean
true -> failure aborts the turn.
Instance Method Details
#call(_request) ⇒ Object
-> [ContextFragment]; may do IO
11 12 13 14 15 |
# File 'lib/insika/context/provider.rb', line 11 def call(_request) = [] # -> [ContextFragment]; may do IO # which cache layer the output belongs to. # :identity -> changes only on deploy/config edit (the cacheable prefix); # :volatile -> may change per turn (the Builder renders identity first). # :volatile is the conservative default — nothing gets pinned by accident. |
#enabled_for?(_profile) ⇒ Boolean
10 |
# File 'lib/insika/context/provider.rb', line 10 def enabled_for?(_profile) = true |
#id ⇒ Object
override for a stable name
8 |
# File 'lib/insika/context/provider.rb', line 8 def id = self.class.name # override for a stable name |
#layer ⇒ Object
which cache layer the output belongs to. :identity -> changes only on deploy/config edit (the cacheable prefix); :volatile -> may change per turn (the Builder renders identity first). :volatile is the conservative default — nothing gets pinned by accident.
16 |
# File 'lib/insika/context/provider.rb', line 16 def layer = :volatile |
#required? ⇒ Boolean
true -> failure aborts the turn
9 |
# File 'lib/insika/context/provider.rb', line 9 def required? = false # true -> failure aborts the turn |