OptionalmodelThe model instance that the agent will use to make decisions. Accepts either a Model instance or a string representing a Bedrock model ID. When a string is provided, it will be used to create a BedrockModel instance.
// Using a string model ID (creates BedrockModel)
const agent = new Agent({
model: 'anthropic.claude-3-5-sonnet-20240620-v1:0'
})
// Using an explicit BedrockModel instance with configuration
const agent = new Agent({
model: new BedrockModel({
modelId: 'anthropic.claude-3-5-sonnet-20240620-v1:0',
temperature: 0.7,
maxTokens: 2048
})
})
OptionalmessagesAn initial set of messages to seed the agent's conversation history.
OptionaltoolsAn initial set of tools to register with the agent. Accepts nested arrays of tools at any depth, which will be flattened automatically.
OptionalsystemA system prompt which guides model behavior.
OptionalstateOptional initial state values for the agent.
OptionalprinterEnable automatic printing of agent output to console. When true, prints text generation, reasoning, and tool usage as they occur. Defaults to true.
OptionalconversationConversation manager for handling message history and context overflow. Defaults to SlidingWindowConversationManager with windowSize of 40.
OptionalhooksHook providers to register with the agent. Hooks enable observing and extending agent behavior.
Configuration object for creating a new Agent.