Class: Cadenya::Types::ObjectiveToolCallResult_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) ⇒ ObjectiveToolCallResult_ContentBlock_Audio

Returns a new instance of ObjectiveToolCallResult_ContentBlock_Audio.



7855
7856
7857
7858
# File 'lib/cadenya/types.rb', line 7855

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

Instance Attribute Details

#audioObject (readonly)

Returns the value of attribute audio.



7853
7854
7855
# File 'lib/cadenya/types.rb', line 7853

def audio
  @audio
end

#typeObject (readonly)

Returns the value of attribute type.



7853
7854
7855
# File 'lib/cadenya/types.rb', line 7853

def type
  @type
end

Class Method Details

.from_json(data) ⇒ Object



7860
7861
7862
7863
7864
7865
# File 'lib/cadenya/types.rb', line 7860

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

Instance Method Details

#to_hObject



7867
7868
7869
7870
7871
7872
# File 'lib/cadenya/types.rb', line 7867

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