AIAgentFunctionalStrategy

A strategy for implementing AI agent behavior that operates in a loop-based manner.

The AIAgentFunctionalStrategy class allows for the definition of a custom looping logic that processes input and produces output by utilizing an AIAgentFunctionalContext. This strategy can be used to define iterative decision-making or execution processes for AI agents.

Parameters

TInput

The type of input data processed by the strategy.

TOutput

The type of output data produced by the strategy.

Constructors

Link copied to clipboard
constructor(name: String, func: suspend AIAgentFunctionalContext.(TInput) -> TOutput)

Properties

Link copied to clipboard

A suspending function representing the loop logic for the strategy. It accepts input data of type TInput and an AIAgentFunctionalContext to execute the loop and produce the output.

Link copied to clipboard
open override val name: String

The name of the strategy, providing a way to identify and describe the strategy.

Functions

Link copied to clipboard
open suspend override fun execute(context: AIAgentFunctionalContext, input: TInput): TOutput

Executes the AI agent's strategy using the provided context and input.