Class: Durable::Llm::Providers::Cohere::CohereEmbeddingResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/durable/llm/providers/cohere.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ CohereEmbeddingResponse

Returns a new instance of CohereEmbeddingResponse.



178
179
180
# File 'lib/durable/llm/providers/cohere.rb', line 178

def initialize(data)
  @embedding = data.dig('embeddings', 'float', 0)
end

Instance Attribute Details

#embeddingObject (readonly)

Returns the value of attribute embedding.



176
177
178
# File 'lib/durable/llm/providers/cohere.rb', line 176

def embedding
  @embedding
end

Instance Method Details

#to_aObject



182
183
184
# File 'lib/durable/llm/providers/cohere.rb', line 182

def to_a
  @embedding
end