Factory

open class Factory

Factory methods for creating UnfoldingTool instances. This is an open class so that subinterface companions can extend it.

Inheritors

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
open fun byCategory(name: String, description: String, toolsByCategory: Map<String, List<Tool>>, categoryParameter: String = "category", removeOnInvoke: Boolean = true, childToolUsageNotes: String? = null): UnfoldingTool

Create an UnfoldingTool with category-based selection.

Link copied to clipboard
open fun fromInstance(instance: Any, objectMapper: <Error class: unknown class> = jacksonObjectMapper()): UnfoldingTool

Create an UnfoldingTool from an instance annotated with @MatryoshkaTools.

Link copied to clipboard
open fun of(name: String, description: String, innerTools: List<Tool>, removeOnInvoke: Boolean = true, childToolUsageNotes: String? = null): UnfoldingTool

Create an UnfoldingTool that exposes all inner tools when invoked.

Link copied to clipboard
open fun safelyFromInstance(instance: Any, objectMapper: <Error class: unknown class> = jacksonObjectMapper()): UnfoldingTool?

Safely create an UnfoldingTool from an instance. Returns null if the class is not annotated with @MatryoshkaTools or has no @LlmTool methods.

Link copied to clipboard
open fun selectable(name: String, description: String, innerTools: List<Tool>, inputSchema: Tool.InputSchema, removeOnInvoke: Boolean = true, childToolUsageNotes: String? = null, selector: (String) -> List<Tool>): UnfoldingTool

Create an UnfoldingTool with a custom tool selector.