Package com.embabel.chat.support
Class AssetAddingTool
-
- All Implemented Interfaces:
-
com.embabel.agent.api.tool.Tool,com.embabel.agent.api.tool.ToolInfo,com.embabel.agent.spi.support.DelegatingTool
public final class AssetAddingTool<T extends Object> implements 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.
-
-
Field Summary
Fields Modifier and Type Field Description private final Tool.Definitiondefinitionprivate final Tooldelegateprivate final AssetTrackerassetTrackerprivate final Function1<T, Asset>converterprivate final Class<T>clazzprivate final Tool.Metadatametadata
-
Constructor Summary
Constructors Constructor Description AssetAddingTool(Tool delegate, AssetTracker assetTracker, Function1<T, Asset> converter, Class<T> clazz)
-
Method Summary
Modifier and Type Method Description Tool.DefinitiongetDefinition()Tool definition for LLM ToolgetDelegate()final AssetTrackergetAssetTracker()final Function1<T, Asset>getConverter()final Class<T>getClazz()Tool.Resultcall(String input)Execute the tool with JSON input. -
-
Method Detail
-
getDefinition
Tool.Definition getDefinition()
Tool definition for LLM
-
getDelegate
Tool getDelegate()
-
getAssetTracker
final AssetTracker getAssetTracker()
-
getConverter
final Function1<T, Asset> getConverter()
-
call
Tool.Result call(String input)
Execute the tool with JSON input.
- Parameters:
input- JSON string matching inputSchema- Returns:
Result to send back to LLM
-
-
-
-