Class: Rafflesia::FoundryEmbeddingVector

Inherits:
Types::BaseModel
  • Object
show all
Defined in:
lib/rafflesia/foundry/foundry_embedding_vector.rb

Constant Summary collapse

HASH_ATTRS =
{
  id: :id,
  index: :index,
  object: :object,
  shape: :shape,
  values: :values
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ FoundryEmbeddingVector

Returns a new instance of FoundryEmbeddingVector.



23
24
25
26
27
28
29
30
31
# File 'lib/rafflesia/foundry/foundry_embedding_vector.rb', line 23

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @id = hash[:id]
  @index = hash[:index]
  @object = hash[:object]
  @shape = (hash[:shape] || [])
  @values = (hash[:values] || [])
end

Instance Attribute Details

#idObject

Returns the value of attribute id.



16
17
18
# File 'lib/rafflesia/foundry/foundry_embedding_vector.rb', line 16

def id
  @id
end

#indexObject

Returns the value of attribute index.



16
17
18
# File 'lib/rafflesia/foundry/foundry_embedding_vector.rb', line 16

def index
  @index
end

#objectObject

Returns the value of attribute object.



16
17
18
# File 'lib/rafflesia/foundry/foundry_embedding_vector.rb', line 16

def object
  @object
end

#shapeObject

Returns the value of attribute shape.



16
17
18
# File 'lib/rafflesia/foundry/foundry_embedding_vector.rb', line 16

def shape
  @shape
end

#valuesObject

Returns the value of attribute values.



16
17
18
# File 'lib/rafflesia/foundry/foundry_embedding_vector.rb', line 16

def values
  @values
end