Class: Durable::Llm::Providers::Cohere::CohereEmbeddingResponse
- Inherits:
-
Object
- Object
- Durable::Llm::Providers::Cohere::CohereEmbeddingResponse
- Defined in:
- lib/durable/llm/providers/cohere.rb
Overview
Response object for Cohere embedding API responses.
Wraps embedding data and provides array access to the vector representation.
Instance Attribute Summary collapse
-
#embedding ⇒ Object
readonly
Returns the value of attribute embedding.
Instance Method Summary collapse
-
#initialize(data) ⇒ CohereEmbeddingResponse
constructor
A new instance of CohereEmbeddingResponse.
- #to_a ⇒ Object
Constructor Details
#initialize(data) ⇒ CohereEmbeddingResponse
Returns a new instance of CohereEmbeddingResponse.
188 189 190 |
# File 'lib/durable/llm/providers/cohere.rb', line 188 def initialize(data) @embedding = data.dig('embeddings', 'float', 0) end |
Instance Attribute Details
#embedding ⇒ Object (readonly)
Returns the value of attribute embedding.
186 187 188 |
# File 'lib/durable/llm/providers/cohere.rb', line 186 def @embedding end |
Instance Method Details
#to_a ⇒ Object
192 193 194 |
# File 'lib/durable/llm/providers/cohere.rb', line 192 def to_a @embedding end |