Class: Durable::Llm::Providers::Xai::XaiEmbeddingResponse
- Inherits:
-
Object
- Object
- Durable::Llm::Providers::Xai::XaiEmbeddingResponse
- Defined in:
- lib/durable/llm/providers/xai.rb
Overview
Represents an embedding response from xAI’s API.
Instance Attribute Summary collapse
-
#embedding ⇒ Object
readonly
Returns the value of attribute embedding.
Instance Method Summary collapse
-
#initialize(data) ⇒ XaiEmbeddingResponse
constructor
Initializes the embedding response with the embedding data.
-
#to_a ⇒ Array<Float>
Returns the embedding as an array.
Constructor Details
#initialize(data) ⇒ XaiEmbeddingResponse
Initializes the embedding response with the embedding data.
298 299 300 |
# File 'lib/durable/llm/providers/xai.rb', line 298 def initialize(data) = data.dig('data', 0, 'embedding') end |
Instance Attribute Details
#embedding ⇒ Object (readonly)
Returns the value of attribute embedding.
293 294 295 |
# File 'lib/durable/llm/providers/xai.rb', line 293 def end |
Instance Method Details
#to_a ⇒ Array<Float>
Returns the embedding as an array.
305 306 307 |
# File 'lib/durable/llm/providers/xai.rb', line 305 def to_a end |