SubtaskBuilderWithOutput

class SubtaskBuilderWithOutput<Output : Any>(val context: AIAgentFunctionalContextBase<*>, val taskDescription: String, val output: OutputOption<Output>, var tools: List<ERROR CLASS: Symbol not found for ToolBase<*, *>>? = null, var llmModel: ERROR CLASS: Symbol not found for LLModel?? = null, var llmParams: ERROR CLASS: Symbol not found for LLMParams?? = null, var responseProcessor: ERROR CLASS: Symbol not found for ResponseProcessor?? = null, var parallelTools: Boolean = false, var assistantResponseRepeatMax: Int? = null)(source)

Builder class to create and configure a subtask with specified input and output types.

Parameters

context

The functional context associated with the AI agent.

taskDescription

The description of the task that this subtask represents.

output

Specifies the output of the subtask either by its class or through a finish tool.

tools

Optional list of tools that can be used during the subtask execution.

llmModel

Optional language model to be used for the subtask.

llmParams

Optional parameters for the language model configuration.

responseProcessor

Optional processor for post-processing LLM responses.

parallelTools

Specifies the mode in which tools should be called (e.g., sequentially).

assistantResponseRepeatMax

Optional maximum number of response repetitions allowed for the assistant.

Type Parameters

Output

The type of the output produced by the subtask.

Constructors

Link copied to clipboard
constructor(context: AIAgentFunctionalContextBase<*>, taskDescription: String, output: OutputOption<Output>, tools: List<ERROR CLASS: Symbol not found for ToolBase<*, *>>? = null, llmModel: ERROR CLASS: Symbol not found for LLModel?? = null, llmParams: ERROR CLASS: Symbol not found for LLMParams?? = null, responseProcessor: ERROR CLASS: Symbol not found for ResponseProcessor?? = null, parallelTools: Boolean = false, assistantResponseRepeatMax: Int? = null)
constructor(context: AIAgentFunctionalContextBase<*>, taskDescription: String, outputClass: Class<Output>)

Constructs a new instance of SubtaskBuilderWithInputAndOutput. This constructor allows specifying the context, task description, input, and the output class type, which will be used to configure the subtask builder for tasks requiring both input and output processing.

constructor(context: AIAgentFunctionalContextBase<*>, taskDescription: String, finishTool: ERROR CLASS: Symbol not found for Tool<*, Output>)

Secondary constructor for initializing an instance of SubtaskBuilderWithInputAndOutput with a specific context, task description, input, and a finalizing tool for output processing.

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
var llmModel: ERROR CLASS: Symbol not found for LLModel??
Link copied to clipboard
var llmParams: ERROR CLASS: Symbol not found for LLMParams??
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
var responseProcessor: ERROR CLASS: Symbol not found for ResponseProcessor??
Link copied to clipboard
Link copied to clipboard
var tools: List<ERROR CLASS: Symbol not found for ToolBase<*, *>>?

Functions

Link copied to clipboard

Sets the maximum number of times the assistant's response can be repeated.

Link copied to clipboard

Sets the execution mode for the AI agent's task execution.

Link copied to clipboard
fun run(): Output

Executes the defined task within the configured context and returns the output. The method handles different output options (OutputOption.ByClass and OutputOption.ByFinishTool) and executes subtasks using the provided input, tools, and configuration parameters.

Link copied to clipboard
fun useLLM(llmModel: ERROR CLASS: Symbol not found for LLModel): SubtaskBuilderWithOutput<Output>

Configures the builder to use the specified Large Language Model (LLM) for subsequent tasks.

Link copied to clipboard
fun withParams(llmParams: ERROR CLASS: Symbol not found for LLMParams): SubtaskBuilderWithOutput<Output>

Sets the parameters for the language model (LLM) to be used in the subtask.

Link copied to clipboard
fun withResponseProcessor(responseProcessor: ERROR CLASS: Symbol not found for ResponseProcessor): SubtaskBuilderWithOutput<Output>

Sets the response processor to be used for post-processing LLM responses during task execution.

Link copied to clipboard
fun withTools(tools: List<ERROR CLASS: Symbol not found for ToolBase<*, *>>): SubtaskBuilderWithOutput<Output>

Sets the tools to be used for the subtask configuration.

fun withTools(vararg toolSets: ERROR CLASS: Symbol not found for ToolSet): SubtaskBuilderWithOutput<Output>

Adds the specified sets of tools to the subtask configuration.