Class: VoyageAI::Embed
- Inherits:
-
Object
- Object
- VoyageAI::Embed
- Defined in:
- lib/voyageai/embed.rb
Overview
The response for an embeddings request that wraps the model / usage / embeddings.
Instance Attribute Summary collapse
Class Method Summary collapse
Instance Method Summary collapse
- #embedding(index: 0) ⇒ Array<Float>
-
#initialize(model:, usage:, embeddings:) ⇒ Embed
constructor
A new instance of Embed.
- #inspect ⇒ String
Constructor Details
#initialize(model:, usage:, embeddings:) ⇒ Embed
Returns a new instance of Embed.
34 35 36 37 38 |
# File 'lib/voyageai/embed.rb', line 34 def initialize(model:, usage:, embeddings:) @model = model @usage = usage @embeddings = end |
Instance Attribute Details
#embeddings ⇒ Array<Array<Float>>
19 20 21 |
# File 'lib/voyageai/embed.rb', line 19 def @embeddings end |
#model ⇒ String
11 12 13 |
# File 'lib/voyageai/embed.rb', line 11 def model @model end |
Class Method Details
Instance Method Details
#embedding(index: 0) ⇒ Array<Float>
48 49 50 |
# File 'lib/voyageai/embed.rb', line 48 def (index: 0) @embeddings[index] end |
#inspect ⇒ String
41 42 43 |
# File 'lib/voyageai/embed.rb', line 41 def inspect "#<#{self.class.name} model=#{@model.inspect} embeddings=#{@embeddings.inspect} usage=#{@usage.inspect}>" end |