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 registry of tools available for use by the agent. Defaults to an empty registry.
The strategy for executing the AI agent's graph logic, including workflows and decision-making.
An optional unique identifier for the agent. Defaults to null if not specified.
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.
The prompt to be processed by the AI agent.
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.
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 registry containing available tools for the AI agent. Defaults to an empty registry.
The suspendable functional context defining the behavior of the AI agent, processing the input of type Input
and producing the output of type Output
.
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.
An optional unique identifier for the agent.
The system-level prompt used as context for the agent, defaulting to an empty string.
The randomness or creativity of the model's responses, with valid values ranging typically from 0.0 to 1.0. Defaults 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]
.
An optional unique identifier for the agent. Defaults to null
.
A Clock
instance used for time-related operations. Defaults to Clock.System
.
A string representing the system-level prompt for the agent. Defaults to an empty string.
A double value controlling the randomness of the model's output. Defaults 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 executor used to process prompts for the language model.
The language model configuration defining the underlying LLM instance and its behavior.
The operational strategy for the AI agent, which determines how to handle the provided input.
Registry containing tools available to the agent for use during execution. Default is an empty registry.
An optional identifier for the AI agent.
The system prompt that sets the initial context or instructions for the AI agent.
The temperature setting for the language model, which adjusts the diversity of output. Default is 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.