Class: VoyageAI::Reranking
- Inherits:
-
Object
- Object
- VoyageAI::Reranking
- Defined in:
- lib/voyageai/reranking.rb
Overview
The response of an individual re-ranking.
Instance Attribute Summary collapse
- #document ⇒ String
-
#index ⇒ Object
Returns the value of attribute index.
- #model ⇒ Integer
- #relevance_score ⇒ Float
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(index:, document:, relevance_score:) ⇒ Reranking
constructor
A new instance of Reranking.
- #inspect ⇒ String
Constructor Details
#initialize(index:, document:, relevance_score:) ⇒ Reranking
Returns a new instance of Reranking.
24 25 26 27 28 |
# File 'lib/voyageai/reranking.rb', line 24 def initialize(index:, document:, relevance_score:) @index = index @document = document @relevance_score = relevance_score end |
Instance Attribute Details
#document ⇒ String
15 16 17 |
# File 'lib/voyageai/reranking.rb', line 15 def document @document end |
#index ⇒ Object
Returns the value of attribute index.
11 12 13 |
# File 'lib/voyageai/reranking.rb', line 11 def index @index end |
#model ⇒ Integer
11 |
# File 'lib/voyageai/reranking.rb', line 11 attr_accessor :index |
#relevance_score ⇒ Float
19 20 21 |
# File 'lib/voyageai/reranking.rb', line 19 def relevance_score @relevance_score end |
Class Method Details
.parse(data:) ⇒ Reranking
38 39 40 41 42 43 44 |
# File 'lib/voyageai/reranking.rb', line 38 def self.parse(data:) index = data["index"] document = data["document"] relevance_score = data["relevance_score"] new(index: index, document: document, relevance_score: relevance_score) end |
Instance Method Details
#inspect ⇒ String
31 32 33 |
# File 'lib/voyageai/reranking.rb', line 31 def inspect "#<#{self.class.name} index=#{@index} relevance_score=#{@relevance_score}>" end |