AssetAddingTool

class AssetAddingTool<T>(val delegate: Tool, val assetTracker: AssetTracker, val converter: (T) -> Asset, val clazz: Class<T>) : DelegatingTool

Add the result of calling this tool as an asset to the given AssetTracker if it is of the expected type. Also unwraps Iterables of the expected type.

Parameters

T

The type of artifact to convert to an Asset

delegate

The tool to delegate to

assetTracker

The asset tracker to add assets to

converter

Function to convert from T to Asset

clazz

The class of T

Constructors

Link copied to clipboard
constructor(delegate: Tool, assetTracker: AssetTracker, converter: (T) -> Asset, clazz: Class<T>)

Properties

Link copied to clipboard
Link copied to clipboard
val clazz: Class<T>
Link copied to clipboard
val converter: (T) -> Asset
Link copied to clipboard
open override val definition: Tool.Definition

Tool definition for LLM

Link copied to clipboard
open override val delegate: Tool
Link copied to clipboard

Optional metadata

Functions

Link copied to clipboard
open override fun call(input: String): Tool.Result

Execute the tool with JSON input.

Link copied to clipboard
fun Tool.toSpringToolCallback(): <Error class: unknown class>

Extension function to convert an Embabel Tool to a Spring AI ToolCallback.

Link copied to clipboard

Unwrap a tool to find the innermost implementation. Recursively unwraps DelegatingTool wrappers.

Link copied to clipboard
inline fun <T : Tool> Tool.unwrapAs(): T?

Unwrap a tool to find a specific type, or return null if not found.

Link copied to clipboard
fun Tool.withEventPublication(agentProcess: AgentProcess, action: Action?, llmOptions: <Error class: unknown class>): Tool

Extension function to wrap a Tool with event publication.