safelyFromInstance

fun safelyFromInstance(instance: Any, objectMapper: <Error class: unknown class> = jacksonObjectMapper()): MatryoshkaTool?

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

Return

A MatryoshkaTool if the instance is properly annotated, null otherwise

Parameters

instance

The object instance to check

objectMapper

ObjectMapper for JSON parsing (optional)