invoke

expect inline operator fun <Input, Output> invoke(promptExecutor: PromptExecutor, agentConfig: AIAgentConfig, strategy: AIAgentGraphStrategy<Input, Output>, toolRegistry: ToolRegistry = ToolRegistry.EMPTY, id: String? = null, clock: Clock = Clock.System, noinline installFeatures: GraphAIAgent.FeatureContext.() -> Unit = {}): AIAgent<Input, Output>(source)

Creates an instance of an AI agent based on the provided configuration, input/output types, and execution strategy.

Return

An instance of an AI agent configured with the specified parameters and capable of executing its logic.

Parameters

promptExecutor

The executor responsible for processing prompts and interacting with the language model.

agentConfig

The configuration for the AI agent, including the prompt, model, and other parameters.

strategy

The strategy for executing the AI agent's graph logic, including workflows and decision-making.

toolRegistry

The registry of tools available for use by the agent. Defaults to an empty registry.

id

Unique identifier for the agent. Random UUID will be generated if set to null.

clock

The clock to be used for time-related operations. Defaults to the system clock.

installFeatures

A lambda expression to install additional features in the agent's feature context. Defaults to an empty implementation.

Type Parameters

Input

The type of the input the AI agent will process.

Output

The type of the output the AI agent will produce.


expect operator fun invoke(promptExecutor: PromptExecutor, agentConfig: AIAgentConfig, strategy: AIAgentGraphStrategy<String, String> = singleRunStrategy(), toolRegistry: ToolRegistry = ToolRegistry.EMPTY, id: String? = null, installFeatures: GraphAIAgent.FeatureContext.() -> Unit = {}): GraphAIAgent<String, String>(source)

Operator function to create and invoke an AI agent with the given parameters.

Return

An instance of AIAgent configured with the graph strategy.

Parameters

promptExecutor

The executor responsible for running the prompt and generating outputs.

agentConfig

Configuration settings for the AI agent.

strategy

The strategy to be used for the AI agent's execution graph. Defaults to a single-run strategy.

toolRegistry

Registry of tools available for the AI agent to use. Defaults to an empty registry.

id

Unique identifier for the agent. Random UUID will be generated if set to null.

installFeatures

Lambda function for installing additional features into the feature context. Defaults to an empty lambda.


expect operator fun <Input, Output> invoke(promptExecutor: PromptExecutor, agentConfig: AIAgentConfig, strategy: AIAgentFunctionalStrategy<Input, Output>, toolRegistry: ToolRegistry = ToolRegistry.EMPTY, id: String? = null, clock: Clock = Clock.System, installFeatures: FunctionalAIAgent.FeatureContext.() -> Unit = {}): FunctionalAIAgent<Input, Output>(source)

Creates a functional AI agent with the provided configurations and execution strategy.

Return

A FunctionalAIAgent instance configured with the provided parameters and execution strategy.

Parameters

promptExecutor

The executor responsible for running prompts against the language model.

agentConfig

The configuration for the AI agent, including prompt setup, language model, and iteration limits.

strategy

The strategy for executing the agent's logic, including workflows and decision-making.

toolRegistry

The registry containing available tools for the AI agent. Defaults to an empty registry.

id

Unique identifier for the agent. Random UUID will be generated if set to null.

clock

The clock instance used for time-related operations. Defaults to the system clock.

installFeatures

A lambda expression to install additional features in the agent's feature context. Defaults to an empty implementation.

Type Parameters

Input

The type of the input the AI agent will process.

Output

The type of the output the AI agent will produce.


expect operator fun invoke(promptExecutor: PromptExecutor, llmModel: LLModel, responseProcessor: ResponseProcessor? = null, strategy: AIAgentGraphStrategy<String, String> = singleRunStrategy(), toolRegistry: ToolRegistry = ToolRegistry.EMPTY, id: String? = null, systemPrompt: String? = null, temperature: Double? = null, numberOfChoices: Int = 1, maxIterations: Int = 50, installFeatures: GraphAIAgent.FeatureContext.() -> Unit = {}): AIAgent<String, String>(source)

Construction of an AI agent with the specified configurations and parameters.

Return

An instance of AIAgent configured with the provided parameters.

Parameters

promptExecutor

The executor responsible for processing language model prompts.

llmModel

The specific large language model to be used for the agent.

responseProcessor

The processor responsible for processing the model's responses.

strategy

The strategy that defines the agent's workflow, defaulting to the singleRunStrategy.

toolRegistry

The set of tools available for the agent, defaulting to an empty registry.

id

Unique identifier for the agent. Random UUID will be generated if set to null.

systemPrompt

Optional system prompt for the agent.

temperature

Optional model temperature, with valid values ranging typically from 0.0 to 1.0.

numberOfChoices

The number of response choices to be generated, defaulting to 1.

maxIterations

The maximum number of iterations the agent is allowed to perform, defaulting to 50.

installFeatures

A function to configure additional features into the agent during initialization. Defaults to an empty configuration.


expect inline operator fun <Input, Output> invoke(promptExecutor: PromptExecutor, llmModel: LLModel, strategy: AIAgentGraphStrategy<Input, Output>, responseProcessor: ResponseProcessor? = null, toolRegistry: ToolRegistry = ToolRegistry.EMPTY, id: String? = null, clock: Clock = Clock.System, systemPrompt: String? = null, temperature: Double? = null, numberOfChoices: Int = 1, maxIterations: Int = 50, noinline installFeatures: GraphAIAgent.FeatureContext.() -> Unit = {}): AIAgent<Input, Output>(source)

Creates and configures an AI agent using the provided parameters.

Return

A configured AIAgent instance that can process inputs and generate outputs using the specified strategy and model.

Parameters

promptExecutor

An instance of PromptExecutor responsible for executing prompts with the language model.

llmModel

The language model LLModel to be used by the agent.

strategy

The agent strategy AIAgentGraphStrategy defining how the agent processes inputs and outputs.

responseProcessor

The processor responsible for processing the model's responses.

toolRegistry

An optional ToolRegistry specifying the tools available to the agent for execution. Defaults to [ToolRegistry.EMPTY].

id

Unique identifier for the agent. Random UUID will be generated if set to null.

clock

A Clock instance used for time-related operations. Defaults to Clock.System.

systemPrompt

Optional system prompt for the agent.

temperature

Optional model temperature, with valid values ranging typically from 0.0 to 1.0.

numberOfChoices

The number of choices the model should generate per invocation. Defaults to 1.

maxIterations

The maximum number of iterations the agent can perform. Defaults to 50.

installFeatures

An extension function on FeatureContext to install custom features for the agent. Defaults to an empty lambda.

Type Parameters

Input

The input type for the AI agent.

Output

The output type for the AI agent.


expect operator fun <Input, Output> invoke(promptExecutor: PromptExecutor, llmModel: LLModel, responseProcessor: ResponseProcessor? = null, toolRegistry: ToolRegistry = ToolRegistry.EMPTY, strategy: AIAgentFunctionalStrategy<Input, Output>, id: String? = null, systemPrompt: String? = null, temperature: Double? = null, numberOfChoices: Int = 1, maxIterations: Int = 50, installFeatures: FunctionalAIAgent.FeatureContext.() -> Unit = {}): AIAgent<Input, Output>(source)

Creates an FunctionalAIAgent with the specified parameters to execute a strategy with the assistance of a tool registry, configured language model, and associated features.

Return

An AI agent instance configured with the provided parameters and ready to execute the specified strategy.

Parameters

promptExecutor

The executor used to process prompts for the language model.

llmModel

The language model configuration defining the underlying LLM instance and its behavior.

responseProcessor

The processor responsible for processing the model's responses.

toolRegistry

Registry containing tools available to the agent for use during execution. Default is an empty registry.

strategy

The strategy to be executed by the agent. Default is a single-run strategy.

id

Unique identifier for the agent. Random UUID will be generated if set to null.

systemPrompt

Optional system prompt for the agent.

temperature

Optional model temperature, with valid values ranging typically from 0.0 to 1.0.

numberOfChoices

The number of response choices to generate when querying the language model. Default is 1.

maxIterations

The maximum number of iterations the agent is allowed to perform during execution. Default is 50.

installFeatures

A lambda to configure and install features in the agent's context.

Type Parameters

Input

The type of input accepted by the agent.

Output

The type of output produced by the agent.


expect operator fun <Input, Output> invoke(promptExecutor: PromptExecutor, llmModel: LLModel, responseProcessor: ResponseProcessor? = null, toolRegistry: ToolRegistry = ToolRegistry.EMPTY, strategy: AIAgentPlannerStrategy<Input, Output, *>, id: String? = null, systemPrompt: String? = null, temperature: Double? = null, numberOfChoices: Int = 1, maxIterations: Int = 50, installFeatures: PlannerAIAgent.FeatureContext.() -> Unit = {}): AIAgent<Input, Output>(source)

Invokes the AI agent with the provided configuration and parameters.

Return

An AI agent instance configured with the provided parameters.

Parameters

promptExecutor

The executor responsible for running prompts.

llmModel

The large language model to be used by the agent.

responseProcessor

An optional processor for handling responses from the language model.

toolRegistry

The registry of tools available to the agent, defaulting to an empty registry.

strategy

The planning strategy used by the AI agent.

id

An optional unique identifier for the agent.

systemPrompt

An optional system-level prompt to initialize the agent.

temperature

An optional parameter to control the randomness of the language model's output.

numberOfChoices

The number of response choices to generate, defaulting to 1.

maxIterations

The maximum number of iterations allowed for the agent, defaulting to 50.

installFeatures

A lambda for configuring additional features in the agent.


expect operator fun <Input, Output> invoke(promptExecutor: PromptExecutor, agentConfig: AIAgentConfig, strategy: AIAgentPlannerStrategy<Input, Output, *>, toolRegistry: ToolRegistry = ToolRegistry.EMPTY, id: String? = null, clock: Clock = Clock.System, installFeatures: PlannerAIAgent.FeatureContext.() -> Unit = {}): AIAgent<Input, Output>(source)

Invokes the creation of an AI agent using the provided configuration, strategy, and optional parameters.

Return

An instance of an AI agent configured with the provided parameters that maps a world state to another world state.

Parameters

promptExecutor

The executor responsible for handling prompts and responses.

agentConfig

The configuration object for the AI agent, including its behavior and properties.

strategy

The planning strategy used to determine the agent's actions, tailored to the given world state and plan.

toolRegistry

An optional registry of tools available for the agent, defaults to an empty registry.

id

An optional unique identifier for the agent, defaults to null if not provided.

clock

The clock instance used for time-based operations, defaults to the system clock.

installFeatures

A lambda function used to install additional features into the agent's feature context.

actual inline operator fun <Input, Output> invoke(promptExecutor: ERROR CLASS: Symbol not found for PromptExecutor, agentConfig: AIAgentConfig, strategy: AIAgentGraphStrategy<Input, Output>, toolRegistry: ERROR CLASS: Symbol not found for ToolRegistry, id: String?, clock: ERROR CLASS: Symbol not found for Clock, noinline installFeatures: GraphAIAgent.FeatureContext.() -> Unit): AIAgent<Input, Output>(source)
actual operator fun invoke(promptExecutor: ERROR CLASS: Symbol not found for PromptExecutor, agentConfig: AIAgentConfig, strategy: AIAgentGraphStrategy<String, String>, toolRegistry: ERROR CLASS: Symbol not found for ToolRegistry, id: String?, installFeatures: GraphAIAgent.FeatureContext.() -> Unit): GraphAIAgent<String, String>(source)
actual operator fun <Input, Output> invoke(promptExecutor: ERROR CLASS: Symbol not found for PromptExecutor, agentConfig: AIAgentConfig, strategy: AIAgentFunctionalStrategy<Input, Output>, toolRegistry: ERROR CLASS: Symbol not found for ToolRegistry, id: String?, clock: ERROR CLASS: Symbol not found for Clock, installFeatures: FunctionalAIAgent.FeatureContext.() -> Unit): FunctionalAIAgent<Input, Output>(source)
actual operator fun invoke(promptExecutor: ERROR CLASS: Symbol not found for PromptExecutor, llmModel: ERROR CLASS: Symbol not found for LLModel, responseProcessor: ERROR CLASS: Symbol not found for ResponseProcessor??, strategy: AIAgentGraphStrategy<String, String>, toolRegistry: ERROR CLASS: Symbol not found for ToolRegistry, id: String?, systemPrompt: String?, temperature: Double?, numberOfChoices: Int, maxIterations: Int, installFeatures: GraphAIAgent.FeatureContext.() -> Unit): AIAgent<String, String>(source)
actual inline operator fun <Input, Output> invoke(promptExecutor: ERROR CLASS: Symbol not found for PromptExecutor, llmModel: ERROR CLASS: Symbol not found for LLModel, strategy: AIAgentGraphStrategy<Input, Output>, responseProcessor: ERROR CLASS: Symbol not found for ResponseProcessor??, toolRegistry: ERROR CLASS: Symbol not found for ToolRegistry, id: String?, clock: ERROR CLASS: Symbol not found for Clock, systemPrompt: String?, temperature: Double?, numberOfChoices: Int, maxIterations: Int, noinline installFeatures: GraphAIAgent.FeatureContext.() -> Unit): AIAgent<Input, Output>(source)
actual operator fun <Input, Output> invoke(promptExecutor: ERROR CLASS: Symbol not found for PromptExecutor, llmModel: ERROR CLASS: Symbol not found for LLModel, responseProcessor: ERROR CLASS: Symbol not found for ResponseProcessor??, toolRegistry: ERROR CLASS: Symbol not found for ToolRegistry, strategy: AIAgentFunctionalStrategy<Input, Output>, id: String?, systemPrompt: String?, temperature: Double?, numberOfChoices: Int, maxIterations: Int, installFeatures: FunctionalAIAgent.FeatureContext.() -> Unit): AIAgent<Input, Output>(source)
actual operator fun <Input, Output> invoke(promptExecutor: ERROR CLASS: Symbol not found for PromptExecutor, llmModel: ERROR CLASS: Symbol not found for LLModel, responseProcessor: ERROR CLASS: Symbol not found for ResponseProcessor??, toolRegistry: ERROR CLASS: Symbol not found for ToolRegistry, strategy: AIAgentPlannerStrategy<Input, Output, *>, id: String?, systemPrompt: String?, temperature: Double?, numberOfChoices: Int, maxIterations: Int, installFeatures: PlannerAIAgent.FeatureContext.() -> Unit): AIAgent<Input, Output>(source)
actual operator fun <Input, Output> invoke(promptExecutor: ERROR CLASS: Symbol not found for PromptExecutor, agentConfig: AIAgentConfig, strategy: AIAgentPlannerStrategy<Input, Output, *>, toolRegistry: ERROR CLASS: Symbol not found for ToolRegistry, id: String?, clock: ERROR CLASS: Symbol not found for Clock, installFeatures: PlannerAIAgent.FeatureContext.() -> Unit): AIAgent<Input, Output>(source)
actual inline operator fun <Input, Output> invoke(promptExecutor: PromptExecutor, agentConfig: AIAgentConfig, strategy: AIAgentGraphStrategy<Input, Output>, toolRegistry: ToolRegistry, id: String?, clock: Clock, noinline installFeatures: GraphAIAgent.FeatureContext.() -> Unit): AIAgent<Input, Output>(source)

Creates an instance of an AI agent based on the provided configuration, input/output types, and execution strategy.

Return

An instance of an AI agent configured with the specified parameters and capable of executing its logic.

Parameters

promptExecutor

The executor responsible for processing prompts and interacting with the language model.

agentConfig

The configuration for the AI agent, including the prompt, model, and other parameters.

strategy

The strategy for executing the AI agent's graph logic, including workflows and decision-making.

toolRegistry

The registry of tools available for use by the agent. Defaults to an empty registry.

id

Unique identifier for the agent. Random UUID will be generated if set to null.

clock

The clock to be used for time-related operations. Defaults to the system clock.

installFeatures

A lambda expression to install additional features in the agent's feature context. Defaults to an empty implementation.

Type Parameters

Input

The type of the input the AI agent will process.

Output

The type of the output the AI agent will produce.


actual operator fun invoke(promptExecutor: PromptExecutor, agentConfig: AIAgentConfig, strategy: AIAgentGraphStrategy<String, String>, toolRegistry: ToolRegistry, id: String?, installFeatures: GraphAIAgent.FeatureContext.() -> Unit): GraphAIAgent<String, String>(source)

Operator function to create and invoke an AI agent with the given parameters.

Return

An instance of AIAgent configured with the graph strategy.

Parameters

promptExecutor

The executor responsible for running the prompt and generating outputs.

agentConfig

Configuration settings for the AI agent.

strategy

The strategy to be used for the AI agent's execution graph. Defaults to a single-run strategy.

toolRegistry

Registry of tools available for the AI agent to use. Defaults to an empty registry.

id

Unique identifier for the agent. Random UUID will be generated if set to null.

installFeatures

Lambda function for installing additional features into the feature context. Defaults to an empty lambda.


actual operator fun <Input, Output> invoke(promptExecutor: PromptExecutor, agentConfig: AIAgentConfig, strategy: AIAgentFunctionalStrategy<Input, Output>, toolRegistry: ToolRegistry, id: String?, clock: Clock, installFeatures: FunctionalAIAgent.FeatureContext.() -> Unit): FunctionalAIAgent<Input, Output>(source)

Creates a functional AI agent with the provided configurations and execution strategy.

Return

A FunctionalAIAgent instance configured with the provided parameters and execution strategy.

Parameters

promptExecutor

The executor responsible for running prompts against the language model.

agentConfig

The configuration for the AI agent, including prompt setup, language model, and iteration limits.

strategy

The strategy for executing the agent's logic, including workflows and decision-making.

toolRegistry

The registry containing available tools for the AI agent. Defaults to an empty registry.

id

Unique identifier for the agent. Random UUID will be generated if set to null.

clock

The clock instance used for time-related operations. Defaults to the system clock.

installFeatures

A lambda expression to install additional features in the agent's feature context. Defaults to an empty implementation.

Type Parameters

Input

The type of the input the AI agent will process.

Output

The type of the output the AI agent will produce.


actual operator fun invoke(promptExecutor: PromptExecutor, llmModel: LLModel, responseProcessor: ResponseProcessor?, strategy: AIAgentGraphStrategy<String, String>, toolRegistry: ToolRegistry, id: String?, systemPrompt: String?, temperature: Double?, numberOfChoices: Int, maxIterations: Int, installFeatures: GraphAIAgent.FeatureContext.() -> Unit): AIAgent<String, String>(source)

Construction of an AI agent with the specified configurations and parameters.

Return

An instance of AIAgent configured with the provided parameters.

Parameters

promptExecutor

The executor responsible for processing language model prompts.

llmModel

The specific large language model to be used for the agent.

responseProcessor

The processor responsible for processing the model's responses.

strategy

The strategy that defines the agent's workflow, defaulting to the singleRunStrategy.

toolRegistry

The set of tools available for the agent, defaulting to an empty registry.

id

Unique identifier for the agent. Random UUID will be generated if set to null.

systemPrompt

Optional system prompt for the agent.

temperature

Optional model temperature, with valid values ranging typically from 0.0 to 1.0.

numberOfChoices

The number of response choices to be generated, defaulting to 1.

maxIterations

The maximum number of iterations the agent is allowed to perform, defaulting to 50.

installFeatures

A function to configure additional features into the agent during initialization. Defaults to an empty configuration.


actual inline operator fun <Input, Output> invoke(promptExecutor: PromptExecutor, llmModel: LLModel, strategy: AIAgentGraphStrategy<Input, Output>, responseProcessor: ResponseProcessor?, toolRegistry: ToolRegistry, id: String?, clock: Clock, systemPrompt: String?, temperature: Double?, numberOfChoices: Int, maxIterations: Int, noinline installFeatures: GraphAIAgent.FeatureContext.() -> Unit): AIAgent<Input, Output>(source)

Creates and configures an AI agent using the provided parameters.

Return

A configured AIAgent instance that can process inputs and generate outputs using the specified strategy and model.

Parameters

promptExecutor

An instance of PromptExecutor responsible for executing prompts with the language model.

llmModel

The language model LLModel to be used by the agent.

strategy

The agent strategy AIAgentGraphStrategy defining how the agent processes inputs and outputs.

responseProcessor

The processor responsible for processing the model's responses.

toolRegistry

An optional ToolRegistry specifying the tools available to the agent for execution. Defaults to [ToolRegistry.EMPTY].

id

Unique identifier for the agent. Random UUID will be generated if set to null.

clock

A Clock instance used for time-related operations. Defaults to Clock.System.

systemPrompt

Optional system prompt for the agent.

temperature

Optional model temperature, with valid values ranging typically from 0.0 to 1.0.

numberOfChoices

The number of choices the model should generate per invocation. Defaults to 1.

maxIterations

The maximum number of iterations the agent can perform. Defaults to 50.

installFeatures

An extension function on FeatureContext to install custom features for the agent. Defaults to an empty lambda.

Type Parameters

Input

The input type for the AI agent.

Output

The output type for the AI agent.


actual operator fun <Input, Output> invoke(promptExecutor: PromptExecutor, llmModel: LLModel, responseProcessor: ResponseProcessor?, toolRegistry: ToolRegistry, strategy: AIAgentFunctionalStrategy<Input, Output>, id: String?, systemPrompt: String?, temperature: Double?, numberOfChoices: Int, maxIterations: Int, installFeatures: FunctionalAIAgent.FeatureContext.() -> Unit): AIAgent<Input, Output>(source)

Creates an FunctionalAIAgent with the specified parameters to execute a strategy with the assistance of a tool registry, configured language model, and associated features.

Return

An AI agent instance configured with the provided parameters and ready to execute the specified strategy.

Parameters

promptExecutor

The executor used to process prompts for the language model.

llmModel

The language model configuration defining the underlying LLM instance and its behavior.

responseProcessor

The processor responsible for processing the model's responses.

toolRegistry

Registry containing tools available to the agent for use during execution. Default is an empty registry.

strategy

The strategy to be executed by the agent. Default is a single-run strategy.

id

Unique identifier for the agent. Random UUID will be generated if set to null.

systemPrompt

Optional system prompt for the agent.

temperature

Optional model temperature, with valid values ranging typically from 0.0 to 1.0.

numberOfChoices

The number of response choices to generate when querying the language model. Default is 1.

maxIterations

The maximum number of iterations the agent is allowed to perform during execution. Default is 50.

installFeatures

A lambda to configure and install features in the agent's context.

Type Parameters

Input

The type of input accepted by the agent.

Output

The type of output produced by the agent.


actual operator fun <Input, Output> invoke(promptExecutor: PromptExecutor, llmModel: LLModel, responseProcessor: ResponseProcessor?, toolRegistry: ToolRegistry, strategy: AIAgentPlannerStrategy<Input, Output, *>, id: String?, systemPrompt: String?, temperature: Double?, numberOfChoices: Int, maxIterations: Int, installFeatures: PlannerAIAgent.FeatureContext.() -> Unit): AIAgent<Input, Output>(source)

Invokes the AI agent with the provided configuration and parameters.

Return

An AI agent instance configured with the provided parameters.

Parameters

promptExecutor

The executor responsible for running prompts.

llmModel

The large language model to be used by the agent.

responseProcessor

An optional processor for handling responses from the language model.

toolRegistry

The registry of tools available to the agent, defaulting to an empty registry.

strategy

The planning strategy used by the AI agent.

id

An optional unique identifier for the agent.

systemPrompt

An optional system-level prompt to initialize the agent.

temperature

An optional parameter to control the randomness of the language model's output.

numberOfChoices

The number of response choices to generate, defaulting to 1.

maxIterations

The maximum number of iterations allowed for the agent, defaulting to 50.

installFeatures

A lambda for configuring additional features in the agent.


actual operator fun <Input, Output> invoke(promptExecutor: PromptExecutor, agentConfig: AIAgentConfig, strategy: AIAgentPlannerStrategy<Input, Output, *>, toolRegistry: ToolRegistry, id: String?, clock: Clock, installFeatures: PlannerAIAgent.FeatureContext.() -> Unit): AIAgent<Input, Output>(source)

Invokes the creation of an AI agent using the provided configuration, strategy, and optional parameters.

Return

An instance of an AI agent configured with the provided parameters that maps a world state to another world state.

Parameters

promptExecutor

The executor responsible for handling prompts and responses.

agentConfig

The configuration object for the AI agent, including its behavior and properties.

strategy

The planning strategy used to determine the agent's actions, tailored to the given world state and plan.

toolRegistry

An optional registry of tools available for the agent, defaults to an empty registry.

id

An optional unique identifier for the agent, defaults to null if not provided.

clock

The clock instance used for time-based operations, defaults to the system clock.

installFeatures

A lambda function used to install additional features into the agent's feature context.