MockToolResponseBuilder

class MockToolResponseBuilder<Args : Tool.Args, Result : ToolResult>(tool: Tool<Args, Result>, action: suspend () -> Result, builder: MockLLMBuilder)(source)

Builder class for configuring conditional tool responses.

This class allows you to specify when a tool should return a particular result based on the arguments it receives.

Parameters

Args

The type of arguments the tool accepts

Result

The type of result the tool produces

Constructors

Link copied to clipboard
constructor(tool: Tool<Args, Result>, action: suspend () -> Result, builder: MockLLMBuilder)

Functions

Link copied to clipboard
infix fun onArguments(args: Args)

Configures the tool to return the specified result when it receives exactly the specified arguments.

Link copied to clipboard
infix fun onArgumentsMatching(condition: suspend (Args) -> Boolean)

Configures the tool to return the specified result when it receives arguments that satisfy the specified condition.