Package-level declarations

Types

Link copied to clipboard
class ToolFromCallable<TResult>(val callable: KCallable<TResult>, val thisRef: Any? = null, name: String? = null, description: String? = null) : Tool<ToolFromCallable.Args, TResult>

A tool implementation that wraps a Kotlin callable (function, method, etc.).

Link copied to clipboard
interface ToolSet

A marker interface for a set of tools that can be converted to a list of tools via reflection.

Functions

Link copied to clipboard
fun <R> KFunction<R>.asTool(thisRef: Any? = null, name: String? = null, description: String? = null): ToolFromCallable<R>
Link copied to clipboard
fun <T : Any> KClass<out T>.asTools(thisRef: T? = null): List<ToolFromCallable<*>>

Converts all functions of this class marked with Tool annotation to a list of tools.

Link copied to clipboard
inline fun <T : Any> T.asToolsByClass(): List<ToolFromCallable<*>>

Converts all instance methods of class/interface T marked as Tool to a list of tools that will be called on object this.