Package ai.djl.serving.workflow.function
Class WorkflowFunction
java.lang.Object
ai.djl.serving.workflow.function.WorkflowFunction
- All Implemented Interfaces:
AutoCloseable
- Direct Known Subclasses:
AdapterWorkflowFunction
,EnsembleMerge
,FunctionsApply
,IdentityWF
,WlmWorkflowFunction
A lambda function that can be run within a
Workflow
.- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
protected CompletableFuture<List<WorkflowExpression.Item>>
A helper to evaluate all function arguments.void
Prepares thisWorkflowFunction
.abstract CompletableFuture<WorkflowExpression.Item>
run
(Workflow.WorkflowExecutor executor, List<Workflow.WorkflowArgument> args) The lambda function that is run.
-
Constructor Details
-
WorkflowFunction
public WorkflowFunction()
-
-
Method Details
-
run
public abstract CompletableFuture<WorkflowExpression.Item> run(Workflow.WorkflowExecutor executor, List<Workflow.WorkflowArgument> args) The lambda function that is run.- Parameters:
executor
- an executor that can be used to run expressions or modelsargs
- the list of function arguments- Returns:
- a future containing the input
-
evaluateArgs
protected CompletableFuture<List<WorkflowExpression.Item>> evaluateArgs(List<Workflow.WorkflowArgument> args) A helper to evaluate all function arguments.- Parameters:
args
- the arguments to evaluate- Returns:
- a future with the list of evaluated arguments
-
prepare
Prepares thisWorkflowFunction
.- Parameters:
wlm
- the wlmconfigs
- the workflow configs
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-