MockToolReceiver

Receiver class for configuring tool behavior during testing.

This class is part of the fluent API for configuring how tools should behave when they are called during testing.

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>, builder: MockLLMBuilder)

Types

Link copied to clipboard
class MockToolResponseBuilder<Args : Tool.Args, Result : ToolResult>(tool: Tool<Args, Result>, action: suspend () -> Result, builder: MockLLMBuilder)

Builder class for configuring conditional tool responses.

Functions

Link copied to clipboard
infix fun alwaysDoes(action: suspend () -> Result)

Configures the tool to always execute the specified action, regardless of the arguments it receives.

Link copied to clipboard
infix fun alwaysReturns(response: Result)

Configures the tool to always return the specified result, regardless of the arguments it receives.

Link copied to clipboard

Configures the tool to execute the specified action when it receives matching arguments.

Link copied to clipboard

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