subgraphWithTask
Creates a subgraph, which performs one specific task, defined by defineTask, using the tools defined by toolSelectionStrategy.
Use this function if you need the agent to perform a single task which outputs a structured result.
Return
A delegate that represents the created subgraph, allowing input and output operations.
Parameters
The input type for the task to be defined in the subgraph.
The output type for the subgraph's finalized result.
The strategy used to select tools for the subgraph operations.
An optional name for the subgraph. Defaults to null if not provided.
Optional language model to be used within the subgraph. Defaults to null.
Optional parameters for configuring the language model behavior. Defaults to null.
The mode in which tools are executed. Defaults to sequential execution.
A suspending lambda function that defines the task for the subgraph, taking the input as a parameter.
Creates a subgraph with a task definition and specified tools. The subgraph uses the provided tools to process input and execute the defined task, eventually producing a result through the provided finish tool.
Return
A delegate representing the subgraph that processes the input and produces a result through the finish tool.
Parameters
The list of tools that are available for use within the subgraph.
An optional name for the subgraph. Defaults to null if not provided.
An optional language model to be used in the subgraph. If not specified, a default model may be used.
Optional parameters to customize the behavior of the language model in the subgraph.
The mode in which tools are executed. Defaults to sequential execution.
A suspend function that defines the task to be executed by the subgraph based on the given input.
Defines a subgraph with a specific task to be performed by an AI agent.
Return
A delegate object representing the constructed subgraph for the specified task.
Parameters
The input type provided to the subgraph.
The output type returned by the subgraph.
The transformed output type after finishing the task.
The strategy to be used for selecting tools within the subgraph.
The tool responsible for finalizing the task and producing the transformed output.
An optional name for the subgraph. Defaults to null if not provided.
The optional language model to be used in the subgraph for processing requests.
The optional parameters to customize the behavior of the language model.
The mode in which tools are executed. Defaults to sequential execution.
The maximum number of assistant responses allowed before determining that the task cannot be completed.
A lambda function to define the task logic, which accepts the input and returns a task description.
Creates a subgraph with a specified task definition, a list of tools, and a finish tool to transform output.
Return
A subgraph delegate that handles the input and produces the transformed output for the defined task.
Parameters
The type of the input for the subgraph task.
The type of the raw output produced by the finish tool.
The transformed type of the output after applying the finish tool.
A list of tools to be used within the subgraph.
The tool responsible for transforming the output of the subgraph.
An optional name for the subgraph. Defaults to null if not provided.
The language model to be used within the subgraph. Defaults to null if not provided.
Optional parameters to customize the behavior of the language model. Defaults to null if not provided.
The mode in which tools are executed. Defaults to sequential execution.
The maximum number of assistant responses allowed before determining that the task cannot be completed.
A suspend function that defines the task to be executed in the subgraph, based on the provided input.
Creates a subgraph within an AI agent graph using a defined task, a tool selection strategy, and a finish tool function. This method provides the capability to integrate task-specific logic and tool selection into the AI agent's subgraph.
Return
An AIAgentSubgraphDelegate representing the constructed subgraph with the specified configuration.
Parameters
The input type to the task defined in the subgraph.
The output type produced by the task and the finish tool.
The strategy to be used for selecting tools within the subgraph.
The function to finalize the task execution, providing the result as Output.
The language model to be used within the subgraph, if specified.
Parameters to configure the language model's behavior, if specified.
A suspend function defining the task logic for the subgraph.
Defines a subgraph with a specific task in an AI agent graph, enabling the coordination of tools, task definitions, and execution logic.
Return
An instance of AIAgentSubgraphDelegate that represents the defined subgraph with input and output types.
Parameters
The input type expected for the subgraph task.
The output type expected from the subgraph task.
A list of tools available for the subgraph task to utilize.
The function that represents the tool used to finish the task, producing the output.
An optional LLModel to use within the subgraph for task execution. Defaults to null.
Optional parameters for configuring the behavior of the LLModel. Defaults to null.
A suspend lambda function that defines the task, taking an input of type Input and returning a task description as a String.