subgraphWithVerification

inline fun <Input> AIAgentSubgraphBuilderBase<*, *>.subgraphWithVerification(toolSelectionStrategy: ToolSelectionStrategy, llmModel: LLModel? = null, llmParams: LLMParams? = null, noinline defineTask: suspend AIAgentContextBase.(input: Input) -> String): AIAgentSubgraphDelegate<Input, VerifiedSubgraphResult>(source)

subgraphWithTask with VerifiedSubgraphResult result. It verifies if the task was performed correctly or not, and describes the problems if any.


inline fun <Input> AIAgentSubgraphBuilderBase<*, *>.subgraphWithVerification(tools: List<Tool<*, *>>, llmModel: LLModel? = null, llmParams: LLMParams? = null, noinline defineTask: suspend AIAgentContextBase.(input: Input) -> String): AIAgentSubgraphDelegate<Input, VerifiedSubgraphResult>(source)

Constructs a subgraph within an AI agent's strategy graph with additional verification capabilities.

This method defines a subgraph using a given list of tools, an optional language model, and optional language model parameters. It also allows specifying whether to summarize the interaction history and defines the task to be executed in the subgraph.

Return

A delegate representing the constructed subgraph with input type Input and output type as a verified subgraph result VerifiedSubgraphResult.

Parameters

Input

The input type accepted by the subgraph.

tools

A list of tools available to the subgraph.

llmModel

Optional language model to be used within the subgraph.

llmParams

Optional parameters to configure the language model's behavior.

defineTask

A suspendable function defining the task that the subgraph will execute, which takes an input and produces a string-based task description.