Companion
object Companion
Functions
Link copied to clipboard
Create a tool with no parameters (Java-friendly). This method is easier to call from Java as it uses the Handler interface.
fun create(name: String, description: String, inputSchema: Tool.InputSchema, handler: Tool.Handler): Tool
Create a tool with input schema (Java-friendly).
Create a tool with custom metadata (Java-friendly).
fun create(name: String, description: String, inputSchema: Tool.InputSchema, metadata: Tool.Metadata, handler: Tool.Handler): Tool
Create a fully configured tool (Java-friendly).
Link copied to clipboard
fun fromInstance(instance: Any, objectMapper: <Error class: unknown class> = jacksonObjectMapper()): List<Tool>
Create Tools from all methods annotated with LlmTool on an instance.
Link copied to clipboard
fun fromMethod(instance: Any, method: KFunction<*>, objectMapper: <Error class: unknown class> = jacksonObjectMapper()): Tool
Create a Tool from a method annotated with com.embabel.agent.api.annotation.LlmTool.
Link copied to clipboard
fun of(name: String, description: String, metadata: Tool.Metadata = Metadata.DEFAULT, function: Tool.Function): Tool
Create a tool with no parameters.
fun of(name: String, description: String, inputSchema: Tool.InputSchema, metadata: Tool.Metadata = Metadata.DEFAULT, function: Tool.Function): Tool
Create a tool from a function.
Link copied to clipboard
fun safelyFromInstance(instance: Any, objectMapper: <Error class: unknown class> = jacksonObjectMapper()): List<Tool>
Safely create Tools from an instance, returning empty list if no annotated methods found. This is useful when you want to scan an object that may or may not have tool methods.