ReflectiveTools

Builds a BaseTool from a Tool-annotated Java method, the reflective counterpart of the engine's KSP @Tool path (which needs the Kotlin compiler and so is closed to a javac-only build). It reads the same Tool/Param annotations, relying on Param.name/Param.required because Java retains neither parameter names nor nullability. JVM-only and intended for javac-only modules; prefer the KSP @Tool path whenever the code is built with the Kotlin compiler, which processes .java sources too.

Functions

Link copied to clipboard
fun fromMethod(instance: Any, method: Method): BaseTool

Builds a BaseTool from an explicit method on instance.

fun fromMethod(instance: Any, methodName: String): BaseTool

Builds a BaseTool from the uniquely-named Tool method methodName on instance.