Package-level declarations

Types

Link copied to clipboard
class ToolFromCallable(callable: KCallable<*>, thisRef: Any? = null, val descriptor: ToolDescriptor, json: Json = Json) : Tool<ToolFromCallable.VarArgs, ToolFromCallable.Result>

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 ai.koog.agents.core.tools.Tools via reflection using asTools.

Functions

Link copied to clipboard
fun KFunction<*>.asTool(json: Json = Json, thisRef: Any? = null, name: String? = null, description: String? = null): ToolFromCallable

Converts a KFunction into a code-engine tool that works by reflection.

Link copied to clipboard
fun KFunction<*>.asToolDescriptor(name: String? = null, description: String? = null): ToolDescriptor

Converts a KFunction into a ToolDescriptor that provides detailed metadata about the tool's name, description, and parameter requirements. This can be used to programmatically describe and interact with a tool function.

Link copied to clipboard
fun ToolSet.asTools(json: Json = Json): List<ToolFromCallable>

Converts all instance methods of this class marked as Tool to a list of tools.

fun <T : ToolSet> KClass<out T>.asTools(json: Json = Json, thisRef: T? = null): List<ToolFromCallable>

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

Link copied to clipboard
inline fun <T : ToolSet> T.asToolsByInterface(json: Json = Json): 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.

Link copied to clipboard

Converts a Kotlin reflection type (KType) to a corresponding ToolParameterType.

Link copied to clipboard
fun ToolRegistry.Builder.tool(toolFunction: KFunction<*>, json: Json = Json, thisRef: Any? = null, name: String? = null, description: String? = null)