Class: Cadenya::Types::ObjectiveToolCallResult_ContentBlock_Text

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, text: nil) ⇒ ObjectiveToolCallResult_ContentBlock_Text

Returns a new instance of ObjectiveToolCallResult_ContentBlock_Text.



7809
7810
7811
7812
# File 'lib/cadenya/types.rb', line 7809

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

Instance Attribute Details

#textObject (readonly)

Returns the value of attribute text.



7807
7808
7809
# File 'lib/cadenya/types.rb', line 7807

def text
  @text
end

#typeObject (readonly)

Returns the value of attribute type.



7807
7808
7809
# File 'lib/cadenya/types.rb', line 7807

def type
  @type
end

Class Method Details

.from_json(data) ⇒ Object



7814
7815
7816
7817
7818
7819
# File 'lib/cadenya/types.rb', line 7814

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

Instance Method Details

#to_hObject



7821
7822
7823
7824
7825
7826
# File 'lib/cadenya/types.rb', line 7821

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