Class: Maglev::VectorStores::Document
- Inherits:
-
Object
- Object
- Maglev::VectorStores::Document
- Defined in:
- lib/maglev/vector_stores/document.rb
Instance Attribute Summary collapse
-
#chunk_index ⇒ Object
readonly
Returns the value of attribute chunk_index.
-
#content ⇒ Object
readonly
Returns the value of attribute content.
-
#content_checksum ⇒ Object
readonly
Returns the value of attribute content_checksum.
-
#distance ⇒ Object
readonly
Returns the value of attribute distance.
-
#embedding ⇒ Object
readonly
Returns the value of attribute embedding.
-
#embedding_model ⇒ Object
readonly
Returns the value of attribute embedding_model.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#owner ⇒ Object
readonly
Returns the value of attribute owner.
-
#owner_id ⇒ Object
readonly
Returns the value of attribute owner_id.
-
#owner_model_name ⇒ Object
readonly
Returns the value of attribute owner_model_name.
-
#owner_type ⇒ Object
readonly
Returns the value of attribute owner_type.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
Instance Method Summary collapse
-
#initialize(owner_type:, owner_id:, owner_model_name:, source:, chunk_index:, content:, content_checksum:, embedding_model:, embedding:, id: nil, owner: nil, distance: nil) ⇒ Document
constructor
A new instance of Document.
- #metadata ⇒ Object
Constructor Details
#initialize(owner_type:, owner_id:, owner_model_name:, source:, chunk_index:, content:, content_checksum:, embedding_model:, embedding:, id: nil, owner: nil, distance: nil) ⇒ Document
Returns a new instance of Document.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/maglev/vector_stores/document.rb', line 10 def initialize(owner_type:, owner_id:, owner_model_name:, source:, chunk_index:, content:, content_checksum:, embedding_model:, embedding:, id: nil, owner: nil, distance: nil) @owner_type = owner_type @owner_id = owner_id @owner_model_name = owner_model_name @source = source @chunk_index = chunk_index @content = content @content_checksum = content_checksum @embedding_model = @embedding = @id = id || "#{owner_type}:#{owner_id}:#{source}:#{chunk_index}" @owner = owner @distance = distance freeze end |
Instance Attribute Details
#chunk_index ⇒ Object (readonly)
Returns the value of attribute chunk_index.
6 7 8 |
# File 'lib/maglev/vector_stores/document.rb', line 6 def chunk_index @chunk_index end |
#content ⇒ Object (readonly)
Returns the value of attribute content.
6 7 8 |
# File 'lib/maglev/vector_stores/document.rb', line 6 def content @content end |
#content_checksum ⇒ Object (readonly)
Returns the value of attribute content_checksum.
6 7 8 |
# File 'lib/maglev/vector_stores/document.rb', line 6 def content_checksum @content_checksum end |
#distance ⇒ Object (readonly)
Returns the value of attribute distance.
6 7 8 |
# File 'lib/maglev/vector_stores/document.rb', line 6 def distance @distance end |
#embedding ⇒ Object (readonly)
Returns the value of attribute embedding.
6 7 8 |
# File 'lib/maglev/vector_stores/document.rb', line 6 def @embedding end |
#embedding_model ⇒ Object (readonly)
Returns the value of attribute embedding_model.
6 7 8 |
# File 'lib/maglev/vector_stores/document.rb', line 6 def @embedding_model end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
6 7 8 |
# File 'lib/maglev/vector_stores/document.rb', line 6 def id @id end |
#owner ⇒ Object (readonly)
Returns the value of attribute owner.
6 7 8 |
# File 'lib/maglev/vector_stores/document.rb', line 6 def owner @owner end |
#owner_id ⇒ Object (readonly)
Returns the value of attribute owner_id.
6 7 8 |
# File 'lib/maglev/vector_stores/document.rb', line 6 def owner_id @owner_id end |
#owner_model_name ⇒ Object (readonly)
Returns the value of attribute owner_model_name.
6 7 8 |
# File 'lib/maglev/vector_stores/document.rb', line 6 def owner_model_name @owner_model_name end |
#owner_type ⇒ Object (readonly)
Returns the value of attribute owner_type.
6 7 8 |
# File 'lib/maglev/vector_stores/document.rb', line 6 def owner_type @owner_type end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
6 7 8 |
# File 'lib/maglev/vector_stores/document.rb', line 6 def source @source end |
Instance Method Details
#metadata ⇒ Object
28 29 30 31 32 33 34 35 36 |
# File 'lib/maglev/vector_stores/document.rb', line 28 def { owner_type: owner_type, owner_id: owner_id, owner_model_name: owner_model_name, source: source, chunk_index: chunk_index } end |