Class: Cadenya::Types::ModelSpec_Capability_TopP

Inherits:
Object
  • Object
show all
Defined in:
lib/cadenya/types.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type: nil, top_p: nil) ⇒ ModelSpec_Capability_TopP

Returns a new instance of ModelSpec_Capability_TopP.



9394
9395
9396
9397
# File 'lib/cadenya/types.rb', line 9394

def initialize(type: nil, top_p: nil)
  @type = type
  @top_p = top_p
end

Instance Attribute Details

#top_pObject (readonly)

Returns the value of attribute top_p.



9392
9393
9394
# File 'lib/cadenya/types.rb', line 9392

def top_p
  @top_p
end

#typeObject (readonly)

Returns the value of attribute type.



9392
9393
9394
# File 'lib/cadenya/types.rb', line 9392

def type
  @type
end

Class Method Details

.from_json(data) ⇒ Object



9399
9400
9401
9402
9403
9404
# File 'lib/cadenya/types.rb', line 9399

def self.from_json(data)
  new(
    type: data["type"],
    top_p: data["topP"].nil? ? nil : Types::Capability_TopP.from_json(data["topP"]),
  )
end

Instance Method Details

#to_hObject



9406
9407
9408
9409
9410
9411
# File 'lib/cadenya/types.rb', line 9406

def to_h
  {
    type: Util.plain(@type),
    top_p: Util.plain(@top_p),
  }.reject { |_k, v| v.nil? }
end