Class: MistralModels::EmbeddingResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/mistral_rb/response_models.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response_hash) ⇒ EmbeddingResponse

Returns a new instance of EmbeddingResponse.



36
37
38
39
40
41
42
# File 'lib/mistral_rb/response_models.rb', line 36

def initialize(response_hash)
  @id = response_hash["id"]
  @object = response_hash["object"]
  @data = response_hash["data"].map { |embedding_data| Embedding.new(embedding_data) }
  @model = response_hash["model"]
  @usage = response_hash["usage"]
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



34
35
36
# File 'lib/mistral_rb/response_models.rb', line 34

def data
  @data
end

#idObject (readonly)

Returns the value of attribute id.



34
35
36
# File 'lib/mistral_rb/response_models.rb', line 34

def id
  @id
end

#modelObject (readonly)

Returns the value of attribute model.



34
35
36
# File 'lib/mistral_rb/response_models.rb', line 34

def model
  @model
end

#objectObject (readonly)

Returns the value of attribute object.



34
35
36
# File 'lib/mistral_rb/response_models.rb', line 34

def object
  @object
end

#usageObject (readonly)

Returns the value of attribute usage.



34
35
36
# File 'lib/mistral_rb/response_models.rb', line 34

def usage
  @usage
end