Class: Legion::Extensions::Agentic::Executive::Chunking::Helpers::InformationItem
- Inherits:
-
Object
- Object
- Legion::Extensions::Agentic::Executive::Chunking::Helpers::InformationItem
- Defined in:
- lib/legion/extensions/agentic/executive/chunking/helpers/information_item.rb
Instance Attribute Summary collapse
-
#chunk_id ⇒ Object
readonly
Returns the value of attribute chunk_id.
-
#content ⇒ Object
readonly
Returns the value of attribute content.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#domain ⇒ Object
readonly
Returns the value of attribute domain.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Instance Method Summary collapse
- #assign_to_chunk!(chunk_id:) ⇒ Object
- #chunked? ⇒ Boolean
-
#initialize(content:, domain: :general) ⇒ InformationItem
constructor
A new instance of InformationItem.
- #to_h ⇒ Object
- #unchunk! ⇒ Object
Constructor Details
#initialize(content:, domain: :general) ⇒ InformationItem
Returns a new instance of InformationItem.
12 13 14 15 16 17 18 19 |
# File 'lib/legion/extensions/agentic/executive/chunking/helpers/information_item.rb', line 12 def initialize(content:, domain: :general) @id = ::SecureRandom.uuid @content = content @domain = domain @chunked = false @chunk_id = nil @created_at = Time.now.utc end |
Instance Attribute Details
#chunk_id ⇒ Object (readonly)
Returns the value of attribute chunk_id.
10 11 12 |
# File 'lib/legion/extensions/agentic/executive/chunking/helpers/information_item.rb', line 10 def chunk_id @chunk_id end |
#content ⇒ Object (readonly)
Returns the value of attribute content.
10 11 12 |
# File 'lib/legion/extensions/agentic/executive/chunking/helpers/information_item.rb', line 10 def content @content end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
10 11 12 |
# File 'lib/legion/extensions/agentic/executive/chunking/helpers/information_item.rb', line 10 def created_at @created_at end |
#domain ⇒ Object (readonly)
Returns the value of attribute domain.
10 11 12 |
# File 'lib/legion/extensions/agentic/executive/chunking/helpers/information_item.rb', line 10 def domain @domain end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
10 11 12 |
# File 'lib/legion/extensions/agentic/executive/chunking/helpers/information_item.rb', line 10 def id @id end |
Instance Method Details
#assign_to_chunk!(chunk_id:) ⇒ Object
25 26 27 28 |
# File 'lib/legion/extensions/agentic/executive/chunking/helpers/information_item.rb', line 25 def assign_to_chunk!(chunk_id:) @chunked = true @chunk_id = chunk_id end |
#chunked? ⇒ Boolean
21 22 23 |
# File 'lib/legion/extensions/agentic/executive/chunking/helpers/information_item.rb', line 21 def chunked? @chunked end |
#to_h ⇒ Object
35 36 37 38 39 40 41 42 43 44 |
# File 'lib/legion/extensions/agentic/executive/chunking/helpers/information_item.rb', line 35 def to_h { id: @id, content: @content, domain: @domain, chunked: @chunked, chunk_id: @chunk_id, created_at: @created_at } end |
#unchunk! ⇒ Object
30 31 32 33 |
# File 'lib/legion/extensions/agentic/executive/chunking/helpers/information_item.rb', line 30 def unchunk! @chunked = false @chunk_id = nil end |