Class: Cadenya::Types::SetToolCallContentRequest_ContentBlock_Audio

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, audio: nil) ⇒ SetToolCallContentRequest_ContentBlock_Audio

Returns a new instance of SetToolCallContentRequest_ContentBlock_Audio.



9137
9138
9139
9140
# File 'lib/cadenya/types.rb', line 9137

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

Instance Attribute Details

#audioObject (readonly)

Returns the value of attribute audio.



9135
9136
9137
# File 'lib/cadenya/types.rb', line 9135

def audio
  @audio
end

#typeObject (readonly)

Returns the value of attribute type.



9135
9136
9137
# File 'lib/cadenya/types.rb', line 9135

def type
  @type
end

Class Method Details

.from_json(data) ⇒ Object



9142
9143
9144
9145
9146
9147
# File 'lib/cadenya/types.rb', line 9142

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

Instance Method Details

#to_hObject



9149
9150
9151
9152
9153
9154
# File 'lib/cadenya/types.rb', line 9149

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