Class: Insika::ContextFragment

Inherits:
Data
  • Object
show all
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

Class Method Summary collapse

Instance Attribute Details

#contentObject (readonly)

Returns the value of attribute content

Returns:

  • (Object)

    the current value of content



11
12
13
# File 'lib/insika/context/fragment.rb', line 11

def content
  @content
end

#pinnedObject (readonly)

Returns the value of attribute pinned

Returns:

  • (Object)

    the current value of pinned



11
12
13
# File 'lib/insika/context/fragment.rb', line 11

def pinned
  @pinned
end

#placementObject (readonly)

Returns the value of attribute placement

Returns:

  • (Object)

    the current value of placement



11
12
13
# File 'lib/insika/context/fragment.rb', line 11

def placement
  @placement
end

#priorityObject (readonly)

Returns the value of attribute priority

Returns:

  • (Object)

    the current value of priority



11
12
13
# File 'lib/insika/context/fragment.rb', line 11

def priority
  @priority
end

#sourceObject (readonly)

Returns the value of attribute source

Returns:

  • (Object)

    the current value of source



11
12
13
# File 'lib/insika/context/fragment.rb', line 11

def source
  @source
end

#tokensObject (readonly)

Returns the value of attribute tokens

Returns:

  • (Object)

    the current value of 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