fromInstance

open fun fromInstance(instance: Any, objectMapper: <Error class: unknown class> = jacksonObjectMapper()): List<Tool>

Create Tools from all methods annotated with LlmTool on an instance.

If the instance's class is annotated with @UnfoldingTools or @MatryoshkaTools, returns a single UnfoldingTool containing all the inner tools. Otherwise, returns individual tools for each annotated method.

Return

List of Tools, one for each annotated method (or single UnfoldingTool if @UnfoldingTools/@MatryoshkaTools present)

Parameters

instance

The object instance to scan for annotated methods

objectMapper

ObjectMapper for JSON parsing (optional)

Throws

if no methods are annotated with @LlmTool