MockToolFromCallableReceiver

A class that facilitates mocking of callable tools by defining their behavior based on the received arguments.

Parameters

Result

The type of result produced by the callable

Constructors

Link copied to clipboard
constructor(callable: KFunction<Result>, builder: MockLLMBuilder)

Types

Link copied to clipboard
class MockToolFromCallableResponseBuilder<Result>(callable: KFunction<Result>, action: suspend () -> Result, builder: MockLLMBuilder)

A builder class for setting up mock tool responses based on a callable's behavior.

Functions

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

Configures a tool to always execute the provided action whenever it is invoked.

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

Configures the tool to always return the specified result when called.

Link copied to clipboard

Configures a tool to execute the provided suspendable action whenever it is invoked.

Link copied to clipboard

Configures the tool to return the specified result when it is invoked.