setupSubgraphWithTask

inline fun <Input, Output, OutputTransformed> AIAgentSubgraphBuilderBase<Input, OutputTransformed>.setupSubgraphWithTask(finishTool: Tool<Output, OutputTransformed>, runMode: ToolCalls, 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

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.

finishTool

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

runMode

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.


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

Deprecated

Use setupSubgraphWithTask API that receive a runMode parameter instead.

Replace with

setupSubgraphWithTask(finishTool, assistantResponseRepeatMax, runMode, defineTask)

Configures a subgraph within the AI agent framework, associating it with required tasks and operations.

FOR INTERNAL USAGE ONLY!

Parameters

finishTool

A descriptor for the tool that determines the condition to finalize the subgraph's operation.

defineTask

A suspending lambda that defines the main task of the subgraph, producing a task description based on the input.