ToolFilter

sealed interface ToolFilter

Selects which tools a Toolset exposes to the LLM.

A filter is one of a fixed set of variants:

Apply a (possibly null) filter with isToolSelected: a null filter performs no filtering and selects every tool.

Inheritors

Types

Link copied to clipboard
data class AllowList(val toolNames: Set<String>) : ToolFilter

Selects the tools whose BaseTool.name is contained in toolNames.

Link copied to clipboard
object Companion
Link copied to clipboard
data class Predicate(val predicate: ToolPredicate) : ToolFilter

Selects the tools accepted by predicate.

Functions

Link copied to clipboard
fun ToolFilter?.isToolSelected(tool: BaseTool, readonlyContext: ReadonlyContext? = null): Boolean

Returns whether tool is selected by this filter under readonlyContext.