Class: Insika::ContextFragment
- Inherits:
-
Data
- Object
- Data
- Insika::ContextFragment
- Defined in:
- lib/insika/context/fragment.rb
Overview
Unit of context produced by a provider. SHARED type (Insika::, not Insika::Context::). placement: :system | :history | :tool_context priority: Integer; higher = more important (survives cuts) tokens: Integer | nil; estimated by the Builder when nil source: String — provider id (audit) pinned: true -> uncuttable in the budget (e.g. identity)
Instance Attribute Summary collapse
-
#content ⇒ Object
readonly
Returns the value of attribute content.
-
#pinned ⇒ Object
readonly
Returns the value of attribute pinned.
-
#placement ⇒ Object
readonly
Returns the value of attribute placement.
-
#priority ⇒ Object
readonly
Returns the value of attribute priority.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
-
#tokens ⇒ Object
readonly
Returns the value of attribute tokens.
Class Method Summary collapse
Instance Attribute Details
#content ⇒ Object (readonly)
Returns the value of attribute content
11 12 13 |
# File 'lib/insika/context/fragment.rb', line 11 def content @content end |
#pinned ⇒ Object (readonly)
Returns the value of attribute pinned
11 12 13 |
# File 'lib/insika/context/fragment.rb', line 11 def pinned @pinned end |
#placement ⇒ Object (readonly)
Returns the value of attribute placement
11 12 13 |
# File 'lib/insika/context/fragment.rb', line 11 def placement @placement end |
#priority ⇒ Object (readonly)
Returns the value of attribute priority
11 12 13 |
# File 'lib/insika/context/fragment.rb', line 11 def priority @priority end |
#source ⇒ Object (readonly)
Returns the value of attribute source
11 12 13 |
# File 'lib/insika/context/fragment.rb', line 11 def source @source end |
#tokens ⇒ Object (readonly)
Returns the value of attribute tokens
11 12 13 |
# File 'lib/insika/context/fragment.rb', line 11 def tokens @tokens end |
Class Method Details
.build(content:, placement:, source:, priority: 50, tokens: nil, pinned: false) ⇒ Object
13 14 15 16 17 |
# File 'lib/insika/context/fragment.rb', line 13 def self.build(content:, placement:, source:, priority: 50, tokens: nil, pinned: false) new(content: content, placement: placement, priority: priority, tokens: tokens, source: source, pinned: pinned) end |