ToolFromCallable
A tool implementation that wraps a Kotlin callable (function, method, etc.).
Parameters
The Kotlin callable (KFunction or KProperty) to be wrapped and executed by this tool.
An optional instance reference required if the callable is non-static.
The name of the tool. If not provided, the name of the callable will be used.
The description of the tool. If not provided, the description from the ai.koog.agents.core.tools.annotations.LLMDescription annotation on the callable will be used.
Constructors
Types
Arguments for ToolFromCallable.
Properties
A ToolDescriptor representing the tool's schema, including its name, description, and parameters.
The name of the tool from the descriptor
Type token representing result type TResult.
Functions
Decodes the provided raw JSON arguments into an instance of the specified arguments type.
Decodes the provided raw JSON element into an instance of the specified result type.
Encodes the given arguments into a JSON representation.
Encodes the provided arguments into a JSON string representation.
Encodes the provided arguments into a JSON string representation without type safety checks.
Encodes the given arguments into a JSON representation without type safety checks.
Encodes the given result into a JSON representation.
Encodes the given result of type TResult to its string representation. This is used to provide the LLM with the result of the tool execution. It can be overridden to customize the string representation the LLM will see.
Encodes the provided result object into a JSON string representation without type safety checks.
Encodes the given result object into a JSON representation without type safety checks.
Executes the tool's logic with the provided arguments.
Executes the tool with the provided arguments without type safety checks.