Package com.embabel.agent.api.tool
Interface ArtifactSinkFactory
-
- All Implemented Interfaces:
public interface ArtifactSinkFactoryFactory interface for creating artifact-sinking tool decorators. Extended by Tool.Companion to provide Tool.sinkArtifacts, Tool.publishToBlackboard, etc.
-
-
Method Summary
Modifier and Type Method Description <T extends Any> ToolsinkArtifacts(Tool tool, Class<T> clazz, ArtifactSink sink)Wrap a tool to sink artifacts of the specified type to the given sink. <T extends Any> ToolsinkArtifacts(Tool tool, Class<T> clazz, ArtifactSink sink, Function1<T, Boolean> filter, Function1<T, Object> transform)Wrap a tool to sink artifacts of the specified type to the given sink, with optional filtering and transformation. ToolpublishToBlackboard(Tool tool)Wrap a tool to publish all artifacts to the blackboard. <T extends Any> ToolpublishToBlackboard(Tool tool, Class<T> clazz)Wrap a tool to publish artifacts of the specified type to the blackboard. <T extends Any> ToolpublishToBlackboard(Tool tool, Class<T> clazz, Function1<T, Boolean> filter, Function1<T, Object> transform)Wrap a tool to publish artifacts of the specified type to the blackboard, with optional filtering and transformation. -
-
Method Detail
-
sinkArtifacts
<T extends Any> Tool sinkArtifacts(Tool tool, Class<T> clazz, ArtifactSink sink)
Wrap a tool to sink artifacts of the specified type to the given sink. Handles both single artifacts and Iterables.
- Parameters:
tool- The tool to wrapclazz- The class of artifacts to capturesink- Where to send captured artifacts
-
sinkArtifacts
<T extends Any> Tool sinkArtifacts(Tool tool, Class<T> clazz, ArtifactSink sink, Function1<T, Boolean> filter, Function1<T, Object> transform)
Wrap a tool to sink artifacts of the specified type to the given sink, with optional filtering and transformation.
- Parameters:
tool- The tool to wrapclazz- The class of artifacts to capturesink- Where to send captured artifactsfilter- Predicate to filter which artifacts to capturetransform- Function to transform artifacts before sinking
-
publishToBlackboard
Tool publishToBlackboard(Tool tool)
Wrap a tool to publish all artifacts to the blackboard.
- Parameters:
tool- The tool to wrap
-
publishToBlackboard
<T extends Any> Tool publishToBlackboard(Tool tool, Class<T> clazz)
Wrap a tool to publish artifacts of the specified type to the blackboard.
- Parameters:
tool- The tool to wrapclazz- The class of artifacts to publish
-
publishToBlackboard
<T extends Any> Tool publishToBlackboard(Tool tool, Class<T> clazz, Function1<T, Boolean> filter, Function1<T, Object> transform)
Wrap a tool to publish artifacts of the specified type to the blackboard, with optional filtering and transformation.
- Parameters:
tool- The tool to wrapclazz- The class of artifacts to publishfilter- Predicate to filter which artifacts to publishtransform- Function to transform artifacts before publishing
-
-
-
-