invoke

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

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

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

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

Invokes the creation of a GraphAIAgentService with the provided dependencies, configuration, and optional parameters for customization.

Parameters

promptExecutor

The executor responsible for handling prompt-based interactions.

llmModel

The large language model to be used by the agent.

strategy

The graph strategy defining the agent's execution behavior. Defaults to a single-run


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

Invokes the creation of a FunctionalAIAgentService instance with the provided parameters.

Return

An instance of FunctionalAIAgentService 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 if not specified.

installFeatures

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