AIAgentService

fun <Input, Output> AIAgentService(promptExecutor: PromptExecutor, agentConfig: AIAgentConfig, strategy: AIAgentGraphStrategy<Input, Output>, toolRegistry: ToolRegistry = ToolRegistry.EMPTY, installFeatures: GraphAIAgent.FeatureContext.() -> Unit = {}): GraphAIAgentService<Input, Output>(source)

Creates a GraphAIAgentService instance with the provided configuration, strategy, tool registry, and optional feature installation logic.

Return

A GraphAIAgentService instance configured with the provided parameters.

Parameters

promptExecutor

The executor responsible for processing AI prompts and responses.

agentConfig

Configuration parameters for the AI agent.

strategy

A strategy defining the graph structure for AI agent interactions and processing.

toolRegistry

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

installFeatures

A lambda expression to install additional features in the agent's feature context.

Type Parameters

Input

The input type that the service processes.

Output

The output type that the service produces.


fun <Input, Output> AIAgentService(promptExecutor: PromptExecutor, agentConfig: AIAgentConfig, strategy: AIAgentFunctionalStrategy<Input, Output>, toolRegistry: ToolRegistry = ToolRegistry.EMPTY, installFeatures: FunctionalAIAgent.FeatureContext.() -> Unit = {}): FunctionalAIAgentService<Input, Output>(source)

Creates a FunctionalAIAgentService instance with the provided parameters.

Return

A FunctionalAIAgentService instance initialized with the given parameters.

Parameters

promptExecutor

The executor responsible for handling prompts and managing their execution.

agentConfig

The configuration parameters for the AI agent.

strategy

The functional strategy that defines the behavior and capabilities of the AI agent.

toolRegistry

The registry containing tools that can be used by the agent. Defaults to an empty registry.

installFeatures

A lambda expression to configure and install additional features to the AI agent context.

Type Parameters

Input

The type of input data expected by the service.

Output

The type of output data produced by the service.


fun AIAgentService(promptExecutor: PromptExecutor, agentConfig: AIAgentConfig, toolRegistry: ToolRegistry = ToolRegistry.EMPTY, installFeatures: GraphAIAgent.FeatureContext.() -> Unit = {}): GraphAIAgentService<String, String>(source)

Invokes the process to create and return an instance of GraphAIAgentService.

Parameters

promptExecutor

The executor responsible for handling prompts during the agent's operation.

agentConfig

The configuration object for the AI agent.

toolRegistry

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

installFeatures

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


fun <Input, Output> AIAgentService(promptExecutor: PromptExecutor, llmModel: LLModel, strategy: AIAgentGraphStrategy<Input, Output>, toolRegistry: ToolRegistry = ToolRegistry.EMPTY, systemPrompt: String? = null, temperature: Double? = null, maxIterations: Int = 50, responseProcessor: ResponseProcessor? = null, installFeatures: GraphAIAgent.FeatureContext.() -> Unit = {}): GraphAIAgentService<Input, Output>(source)

Creates a GraphAIAgentService with the default singleRunStrategy and the given model parameters.

Return

A GraphAIAgentService instance configured with the provided parameters.

Parameters

promptExecutor

Executor responsible for processing prompts and interacting with the language model.

llmModel

Language model to use.

strategy

Graph strategy defining the agent's workflow.

toolRegistry

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

systemPrompt

Optional system prompt for the agent.

temperature

Optional sampling temperature for the model, typically between 0.0 and 1.0.

maxIterations

Maximum number of agent iterations. Defaults to 50.

responseProcessor

Optional processor for the model's responses.

installFeatures

Lambda to install additional features into the agent's feature context.


fun AIAgentService(promptExecutor: PromptExecutor, llmModel: LLModel, toolRegistry: ToolRegistry = ToolRegistry.EMPTY, systemPrompt: String? = null, temperature: Double? = null, maxIterations: Int = 50, responseProcessor: ResponseProcessor? = null, installFeatures: GraphAIAgent.FeatureContext.() -> Unit = {}): GraphAIAgentService<String, String>(source)

Creates a GraphAIAgentService with the default singleRunStrategy and the given model parameters.

Return

A GraphAIAgentService instance configured with the provided parameters.

Parameters

promptExecutor

Executor responsible for processing prompts and interacting with the language model.

llmModel

Language model to use.

toolRegistry

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

systemPrompt

Optional system prompt for the agent.

temperature

Optional sampling temperature for the model, typically between 0.0 and 1.0.

maxIterations

Maximum number of agent iterations. Defaults to 50.

responseProcessor

Optional processor for the model's responses.

installFeatures

Lambda to install additional features into the agent's feature context.