Class: Cadenya::Types::ObjectiveEventData_ToolCalled

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, tool_called: nil) ⇒ ObjectiveEventData_ToolCalled

Returns a new instance of ObjectiveEventData_ToolCalled.



8642
8643
8644
8645
# File 'lib/cadenya/types.rb', line 8642

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

Instance Attribute Details

#tool_calledObject (readonly)

Returns the value of attribute tool_called.



8640
8641
8642
# File 'lib/cadenya/types.rb', line 8640

def tool_called
  @tool_called
end

#typeObject (readonly)

Returns the value of attribute type.



8640
8641
8642
# File 'lib/cadenya/types.rb', line 8640

def type
  @type
end

Class Method Details

.from_json(data) ⇒ Object



8647
8648
8649
8650
8651
8652
# File 'lib/cadenya/types.rb', line 8647

def self.from_json(data)
  new(
    type: data["type"],
    tool_called: data["toolCalled"].nil? ? nil : Types::ToolCalled.from_json(data["toolCalled"]),
  )
end

Instance Method Details

#to_hObject



8654
8655
8656
8657
8658
8659
# File 'lib/cadenya/types.rb', line 8654

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