Package com.embabel.agent.core.hitl
Class SimpleAwaitableTypedTool
-
- All Implemented Interfaces:
-
com.embabel.agent.api.tool.Tool,com.embabel.agent.api.tool.ToolInfo
public final class SimpleAwaitableTypedTool<I extends Object, O extends Object, P extends Object> extends TypedTool<I, O>
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) } )
-
-
Field Summary
Fields Modifier and Type Field Description private final Tool.Definitiondefinitionprivate final Tool.Metadatametadata
-
Constructor Summary
Constructors Constructor Description SimpleAwaitableTypedTool(String name, String description, Class<I> inputType, Class<O> outputType, AwaitableFactory<I, P> awaitableFactory, Function1<I, O> executor, Tool.Metadata metadata, ObjectMapper objectMapper)SimpleAwaitableTypedTool(String name, String description, Class<I> inputType, Class<O> outputType, AwaitableFactory<I, P> awaitableFactory, Function1<I, O> executor, Tool.Metadata metadata)SimpleAwaitableTypedTool(String name, String description, Class<I> inputType, Class<O> outputType, AwaitableFactory<I, P> awaitableFactory, Function1<I, O> executor)
-
Method Summary
Modifier and Type Method Description -
Methods inherited from class com.embabel.agent.api.tool.TypedTool
call, getDefinition, getMetadata, typedCall -
Methods inherited from class com.embabel.agent.api.tool.Tool
withDescription, withName, withNote -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
SimpleAwaitableTypedTool
SimpleAwaitableTypedTool(String name, String description, Class<I> inputType, Class<O> outputType, AwaitableFactory<I, P> awaitableFactory, Function1<I, O> executor, Tool.Metadata metadata, ObjectMapper objectMapper)
-
SimpleAwaitableTypedTool
SimpleAwaitableTypedTool(String name, String description, Class<I> inputType, Class<O> outputType, AwaitableFactory<I, P> awaitableFactory, Function1<I, O> executor, Tool.Metadata metadata)
-
-
-
-