Class: Rafflesia::FoundryEmbeddingRequest

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

Constant Summary collapse

HASH_ATTRS =
{
  inputs: :inputs,
  layer: :layer,
  output_format: :output_format,
  pooling: :pooling
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ FoundryEmbeddingRequest

Returns a new instance of FoundryEmbeddingRequest.



21
22
23
24
25
26
27
28
# File 'lib/rafflesia/foundry/foundry_embedding_request.rb', line 21

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @inputs = (hash[:inputs] || []).map { |item| item ? Rafflesia::FoundryEmbeddingInput.new(item) : nil }
  @layer = hash[:layer]
  @output_format = hash[:output_format]
  @pooling = hash[:pooling]
end

Instance Attribute Details

#inputsObject

Returns the value of attribute inputs.



15
16
17
# File 'lib/rafflesia/foundry/foundry_embedding_request.rb', line 15

def inputs
  @inputs
end

#layerObject

Returns the value of attribute layer.



15
16
17
# File 'lib/rafflesia/foundry/foundry_embedding_request.rb', line 15

def layer
  @layer
end

#output_formatObject

Returns the value of attribute output_format.



15
16
17
# File 'lib/rafflesia/foundry/foundry_embedding_request.rb', line 15

def output_format
  @output_format
end

#poolingObject

Returns the value of attribute pooling.



15
16
17
# File 'lib/rafflesia/foundry/foundry_embedding_request.rb', line 15

def pooling
  @pooling
end