invoke
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
The type of the input the AI agent will process.
The type of the output the AI agent will produce.
The executor responsible for processing prompts and interacting with the language model.
The configuration for the AI agent, including the prompt, model, and other parameters.
The strategy for executing the AI agent's graph logic, including workflows and decision-making.
The registry of tools available for use by the agent. Defaults to an empty registry.
Unique identifier for the agent. Random UUID will be generated if set to null.
The clock to be used for time-related operations. Defaults to the system clock.
A lambda expression to install additional features in the agent's feature context. Defaults to an empty implementation.
Operator function to create and invoke an AI agent with the given parameters.
Return
An instance of AIAgent configured with the graph strategy.
Parameters
The executor responsible for running the prompt and generating outputs.
Configuration settings for the AI agent.
The strategy to be used for the AI agent's execution graph. Defaults to a single-run strategy.
Registry of tools available for the AI agent to use. Defaults to an empty registry.
Unique identifier for the agent. Random UUID will be generated if set to null.
Lambda function for installing additional features into the feature context. Defaults to an empty lambda.
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
The type of the input the AI agent will process.
The type of the output the AI agent will produce.
The executor responsible for running prompts against the language model.
The configuration for the AI agent, including prompt setup, language model, and iteration limits.
The strategy for executing the agent's logic, including workflows and decision-making.
The registry containing available tools for the AI agent. Defaults to an empty registry.
Unique identifier for the agent. Random UUID will be generated if set to null.
The clock instance used for time-related operations. Defaults to the system clock.
A lambda expression to install additional features in the agent's feature context. Defaults to an empty implementation.
Construction of an AI agent with the specified configurations and parameters.
Return
An instance of AIAgent configured with the provided parameters.
Parameters
The executor responsible for processing language model prompts.
The specific large language model to be used for the agent.
The strategy that defines the agent's workflow, defaulting to the singleRunStrategy.
The set of tools available for the agent, defaulting to an empty registry.
Unique identifier for the agent. Random UUID will be generated if set to null.
Optional system prompt for the agent.
Optional model temperature, with valid values ranging typically from 0.0 to 1.0.
The number of response choices to be generated, defaulting to 1.
The maximum number of iterations the agent is allowed to perform, defaulting to 50.
A function to configure additional features into the agent during initialization. Defaults to an empty configuration.
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
The input type for the AI agent.
The output type for the AI agent.
An instance of PromptExecutor responsible for executing prompts with the language model.
The language model LLModel to be used by the agent.
The agent strategy AIAgentGraphStrategy defining how the agent processes inputs and outputs.
An optional ToolRegistry specifying the tools available to the agent for execution. Defaults to [ToolRegistry.EMPTY].
Unique identifier for the agent. Random UUID will be generated if set to null.
A Clock instance used for time-related operations. Defaults to Clock.System.
Optional system prompt for the agent.
Optional model temperature, with valid values ranging typically from 0.0 to 1.0.
The number of choices the model should generate per invocation. Defaults to 1.
The maximum number of iterations the agent can perform. Defaults to 50.
An extension function on FeatureContext to install custom features for the agent. Defaults to an empty lambda.
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
The type of input accepted by the agent.
The type of output produced by the agent.
The executor used to process prompts for the language model.
The language model configuration defining the underlying LLM instance and its behavior.
Registry containing tools available to the agent for use during execution. Default is an empty registry.
The strategy to be executed by the agent. Default is a single-run strategy.
Unique identifier for the agent. Random UUID will be generated if set to null.
Optional system prompt for the agent.
Optional model temperature, with valid values ranging typically from 0.0 to 1.0.
The number of response choices to generate when querying the language model. Default is 1.
The maximum number of iterations the agent is allowed to perform during execution. Default is 50.
A lambda to configure and install features in the agent's context.