Class: Cadenya::Types::ObjectiveToolCallResult

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(content: nil) ⇒ ObjectiveToolCallResult

Returns a new instance of ObjectiveToolCallResult.



4193
4194
4195
# File 'lib/cadenya/types.rb', line 4193

def initialize(content: nil)
  @content = content
end

Instance Attribute Details

#contentObject (readonly)

Returns the value of attribute content.



4191
4192
4193
# File 'lib/cadenya/types.rb', line 4191

def content
  @content
end

Class Method Details

.from_json(data) ⇒ Object



4197
4198
4199
4200
4201
# File 'lib/cadenya/types.rb', line 4197

def self.from_json(data)
  new(
    content: data["content"].nil? ? nil : (data["content"]).map { |item| Types.decode_ObjectiveToolCallResult_ContentBlock(item) },
  )
end

Instance Method Details

#to_hObject



4203
4204
4205
4206
4207
# File 'lib/cadenya/types.rb', line 4203

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