setupSubgraphWithTask

fun <Input, Output, OutputTransformed> AIAgentSubgraphBuilderBase<Input, OutputTransformed>.setupSubgraphWithTask(finishTool: Tool<Output, OutputTransformed>, inputType: TypeToken, outputTransformedType: TypeToken, parallelTools: Boolean, assistantResponseRepeatMax: Int? = null, defineTask: suspend AIAgentGraphContextBase.(Input) -> String)(source)
inline fun <Input, Output, OutputTransformed> AIAgentSubgraphBuilderBase<Input, OutputTransformed>.setupSubgraphWithTask(finishTool: Tool<Output, OutputTransformed>, parallelTools: Boolean, assistantResponseRepeatMax: Int? = null, noinline defineTask: suspend AIAgentGraphContextBase.(Input) -> String)(source)

Configures and sets up a subgraph with task handling, including tool execution operations, assistant response management, and task finalization logic.

Parameters

finishTool

the tool used to signify task completion and process task finalization.

parallelTools

the mode in which tools are executed, e.g., parallel or sequential execution.

assistantResponseRepeatMax

the maximum number of assistant responses allowed before determining that the task cannot be completed. If not provided, a default is used.

defineTask

a suspend function defining the task description, executed within the context of an AI agent graph and based on the given input data.

Type Parameters

Input

the type of input data for the subgraph.

Output

the type of output data from the finish tool.

OutputTransformed

the transformed type of the output data after processing by the finish tool.