Class: Cadenya::Types::ToolError

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(tool_call_id: nil, message: nil) ⇒ ToolError

Returns a new instance of ToolError.



5731
5732
5733
5734
# File 'lib/cadenya/types.rb', line 5731

def initialize(tool_call_id: nil, message: nil)
  @tool_call_id = tool_call_id
  @message = message
end

Instance Attribute Details

#messageObject (readonly)

Returns the value of attribute message.



5729
5730
5731
# File 'lib/cadenya/types.rb', line 5729

def message
  @message
end

#tool_call_idObject (readonly)

Returns the value of attribute tool_call_id.



5729
5730
5731
# File 'lib/cadenya/types.rb', line 5729

def tool_call_id
  @tool_call_id
end

Class Method Details

.from_json(data) ⇒ Object



5736
5737
5738
5739
5740
5741
# File 'lib/cadenya/types.rb', line 5736

def self.from_json(data)
  new(
    tool_call_id: data["toolCallId"],
    message: data["message"],
  )
end

Instance Method Details

#to_hObject



5743
5744
5745
5746
5747
5748
# File 'lib/cadenya/types.rb', line 5743

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