Class: RubyLLM::Voyage::ContextualizedChunk
- Inherits:
-
Struct
- Object
- Struct
- RubyLLM::Voyage::ContextualizedChunk
- Defined in:
- lib/ruby_llm/voyage/results.rb
Overview
One contextualized chunk and its vector.
Instance Attribute Summary collapse
-
#embedding ⇒ Object
Returns the value of attribute embedding.
-
#index ⇒ Object
Returns the value of attribute index.
-
#text ⇒ Object
Returns the value of attribute text.
Instance Method Summary collapse
-
#inspect ⇒ String
Summarizes the vector so console output stays readable.
Instance Attribute Details
#embedding ⇒ Object
Returns the value of attribute embedding
33 34 35 |
# File 'lib/ruby_llm/voyage/results.rb', line 33 def @embedding end |
#index ⇒ Object
Returns the value of attribute index
33 34 35 |
# File 'lib/ruby_llm/voyage/results.rb', line 33 def index @index end |
#text ⇒ Object
Returns the value of attribute text
33 34 35 |
# File 'lib/ruby_llm/voyage/results.rb', line 33 def text @text end |
Instance Method Details
#inspect ⇒ String
Summarizes the vector so console output stays readable.
36 37 38 39 40 |
# File 'lib/ruby_llm/voyage/results.rb', line 36 def inspect dimensions = .respond_to?(:length) ? "[#{.length} values]" : .inspect "#<RubyLLM::Voyage::ContextualizedChunk index=#{index} embedding=#{dimensions} " \ "text=#{text&.slice(0, 60).inspect}>" end |