Simple Awaitable Typed Tool
Simple implementation of AwaitableTypedTool using functional factories.
Example:
val tool = SimpleAwaitableTypedTool(
name = "delete_file",
description = "Delete a file",
inputType = DeleteRequest::class.java,
outputType = DeleteResult::class.java,
awaitableFactory = { input ->
ConfirmationRequest(input, "Delete ${input.path}?")
},
executor = { input ->
DeleteResult(deleted = true, path = input.path)
}
)Functions
Execute the tool with JSON input and out-of-band context.
Executes the tool by deserializing input JSON, calling typedCall, and serializing the result.
Extension function to convert an Embabel Tool to a Spring AI ToolCallback.
Wrap this tool to conditionally await before execution.
Wrap this tool to always require confirmation before execution.
Create a new tool with additional definition metadata entries merged in. Existing keys are overwritten by the new values.
Create a new tool with a single definition metadata entry added.
Create a new tool with a different description. Useful for providing context-specific descriptions while keeping the same functionality.
Extension function to wrap a Tool with event publication.