Class: Cadenya::Types::SetToolCallContentRequest_ContentBlock_Image

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, image: nil) ⇒ SetToolCallContentRequest_ContentBlock_Image

Returns a new instance of SetToolCallContentRequest_ContentBlock_Image.



9114
9115
9116
9117
# File 'lib/cadenya/types.rb', line 9114

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

Instance Attribute Details

#imageObject (readonly)

Returns the value of attribute image.



9112
9113
9114
# File 'lib/cadenya/types.rb', line 9112

def image
  @image
end

#typeObject (readonly)

Returns the value of attribute type.



9112
9113
9114
# File 'lib/cadenya/types.rb', line 9112

def type
  @type
end

Class Method Details

.from_json(data) ⇒ Object



9119
9120
9121
9122
9123
9124
# File 'lib/cadenya/types.rb', line 9119

def self.from_json(data)
  new(
    type: data["type"],
    image: data["image"].nil? ? nil : Types::SetToolCallContentRequest_ImageBlock.from_json(data["image"]),
  )
end

Instance Method Details

#to_hObject



9126
9127
9128
9129
9130
9131
# File 'lib/cadenya/types.rb', line 9126

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