addLLMAnswerConditionalMatches

fun <Args> addLLMAnswerConditionalMatches(condition: (String) -> Boolean, tool: Tool<Args, *>, args: Args)(source)

Adds a conditional match for a tool call to the LLM answer processing system. This method associates a condition with a tool and its arguments, allowing conditional execution of the tool when the specified condition matches.

Parameters

condition

A predicate function that takes a string input and returns a Boolean, indicating whether the condition is met.

tool

The tool object to be called if the condition is satisfied.

args

The arguments to be passed to the tool, which will be encoded to a string for the tool call.


fun <Args> addLLMAnswerConditionalMatches(condition: (String) -> Boolean, toolCalls: List<Pair<Tool<Args, *>, Args>>, responses: List<String>)(source)

Registers conditional matches linking logical conditions to tool calls and corresponding responses.

Parameters

condition

A predicate function that takes a String and returns a Boolean indicating whether the condition is satisfied.

toolCalls

A list of tool calls represented as pairs where the first element is the tool reference and the second is its arguments.

responses

A list of response strings to be associated with the condition.