Class: Cadenya::Types::SetToolCallContentRequest_ImageBlock

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(data: nil, mime_type: nil) ⇒ SetToolCallContentRequest_ImageBlock

Returns a new instance of SetToolCallContentRequest_ImageBlock.



5153
5154
5155
5156
# File 'lib/cadenya/types.rb', line 5153

def initialize(data: nil, mime_type: nil)
  @data = data
  @mime_type = mime_type
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



5151
5152
5153
# File 'lib/cadenya/types.rb', line 5151

def data
  @data
end

#mime_typeObject (readonly)

Returns the value of attribute mime_type.



5151
5152
5153
# File 'lib/cadenya/types.rb', line 5151

def mime_type
  @mime_type
end

Class Method Details

.from_json(data) ⇒ Object



5158
5159
5160
5161
5162
5163
# File 'lib/cadenya/types.rb', line 5158

def self.from_json(data)
  new(
    data: data["data"],
    mime_type: data["mimeType"],
  )
end

Instance Method Details

#to_hObject



5165
5166
5167
5168
5169
5170
# File 'lib/cadenya/types.rb', line 5165

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