Class: Truffle::ToolCall

Inherits:
Struct
  • Object
show all
Defined in:
lib/truffle/message.rb

Overview

A single tool invocation requested by the model.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#argumentsObject

Returns the value of attribute arguments

Returns:

  • (Object)

    the current value of arguments



67
68
69
# File 'lib/truffle/message.rb', line 67

def arguments
  @arguments
end

#idObject

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



67
68
69
# File 'lib/truffle/message.rb', line 67

def id
  @id
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



67
68
69
# File 'lib/truffle/message.rb', line 67

def name
  @name
end

Instance Method Details

#to_hObject

arguments is always a parsed Hash with string keys, mirroring the JSON the model emitted. The agent symbolizes keys before handing them to the tool.



70
71
72
# File 'lib/truffle/message.rb', line 70

def to_h
  { id: id, name: name, arguments: arguments }
end