class RubyLLM::ToolCall
A ToolCall is a request from an AI model to invoke a Tool with specific arguments. Instances appear in Message#tool_calls and are yielded to tool callbacks such as Chat#before_tool_call.
chat.before_tool_call do |tool_call| puts "Calling tool: #{tool_call.name}" puts "Arguments: #{tool_call.arguments}" end
Attributes
The arguments the model supplied for the invocation, as a Hash.
The unique identifier for this call. The tool result message answering this call carries the same id.
The name of the tool the model wants to invoke.
The Gemini thought signature attached to this call, or nil. RubyLLM replays it to the provider on later requests.
Public Instance Methods
Source
# File lib/ruby_llm/tool_call.rb, line 37 def to_h { id: @id, name: @name, arguments: @arguments, thought_signature: @thought_signature }.compact end
Returns a Hash with the keys :id, :name, :arguments, and :thought_signature. Keys with nil values are omitted.