Class: Durable::Llm::Providers::OpenAI::OpenAIEmbeddingResponse

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ OpenAIEmbeddingResponse

Returns a new instance of OpenAIEmbeddingResponse.



209
210
211
# File 'lib/durable/llm/providers/openai.rb', line 209

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

Instance Attribute Details

#embeddingObject (readonly)

Returns the value of attribute embedding.



207
208
209
# File 'lib/durable/llm/providers/openai.rb', line 207

def embedding
  @embedding
end

Instance Method Details

#to_aObject



213
214
215
# File 'lib/durable/llm/providers/openai.rb', line 213

def to_a
  @embedding
end