executeStrategy

abstract fun executeStrategy(context: TContext, input: TInput): TOutput(source)

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

The strategy is executed on the main dispatcher that is either: a) ai.koog.agents.core.agent.config.AIAgentConfig.strategyExecutorService from AIAgentContext.config of the provided context b) kotlinx.coroutines.Dispatchers.Default

Return

Result of the agent of TOutput type.

Parameters

context

The execution context in which the AI agent operates. It provides access to the agent's environment, configuration, lifecycle state, and other components required for processing.

input

The input data to be processed by the AI agent's strategy. The type of the input is determined by the implementation of the strategy and is used to derive an appropriate output.