fromInstance

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

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

Return

List of Tools, one for each annotated method

Parameters

instance

The object instance to scan for annotated methods

objectMapper

ObjectMapper for JSON parsing (optional)

Throws

if no methods are annotated with @Tool.Method