toolCallMessage
Creates a Message.Tool.Call
instance for the given tool and its arguments.
This utility function simplifies the creation of tool call messages for testing purposes. It automatically handles the encoding of arguments into the appropriate string format.
Return
A Message.Tool.Call
object representing a call to the specified tool with the encoded arguments.
Example usage:
// Create a tool call message for testing
val message = toolCallMessage(CreateTool, CreateTool.Args("solve"))
// Use in node output assertions
assertNodes {
askLLM withInput "Solve task" outputs toolCallMessage(CreateTool, CreateTool.Args("solve"))
}
Content copied to clipboard
Parameters
tool
The tool to be represented in the call message. The Tool
instance contains metadata such as the tool's name and utility methods for encoding/decoding arguments.
args
The arguments to be passed to the tool. Must match the type Args
defined by the tool.