Class: Cadenya::Types::SetToolCallContentRequest_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) ⇒ SetToolCallContentRequest_ContentBlock_Text

Returns a new instance of SetToolCallContentRequest_ContentBlock_Text.



9091
9092
9093
9094
# File 'lib/cadenya/types.rb', line 9091

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

Instance Attribute Details

#textObject (readonly)

Returns the value of attribute text.



9089
9090
9091
# File 'lib/cadenya/types.rb', line 9089

def text
  @text
end

#typeObject (readonly)

Returns the value of attribute type.



9089
9090
9091
# File 'lib/cadenya/types.rb', line 9089

def type
  @type
end

Class Method Details

.from_json(data) ⇒ Object



9096
9097
9098
9099
9100
9101
# File 'lib/cadenya/types.rb', line 9096

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

Instance Method Details

#to_hObject



9103
9104
9105
9106
9107
9108
# File 'lib/cadenya/types.rb', line 9103

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