Interface: AgentOptions
@providerprotocol/agents / index / AgentOptions
Interface: AgentOptions
Section titled “Interface: AgentOptions”Defined in: src/agent/types.ts:47
Configuration options for creating an agent instance.
Extends LLMOptions from @providerprotocol/ai for full UPP (Unified Provider Protocol)
passthrough, allowing all provider-specific parameters to be configured.
Remarks
Section titled “Remarks”The agent options combine UAP-specific configuration (execution strategy, middleware, checkpointing) with UPP LLM configuration (model, params, tools, system prompt). This enables agents to leverage the full power of the underlying LLM while adding agentic capabilities like state management and middleware pipelines.
Example
Section titled “Example”import { agent } from '@providerprotocol/agents';import { anthropic } from '@providerprotocol/ai/anthropic';import { loop } from '@providerprotocol/agents/execution';
const options: AgentOptions = { model: anthropic('claude-sonnet-4-20250514'), params: { max_tokens: 4096 }, tools: [myTool], system: 'You are a helpful assistant.', execution: loop({ maxIterations: 10 }), middleware: [loggingMiddleware],};Extends
Section titled “Extends”Partial<Omit<LLMOptions,"model">>
Properties
Section titled “Properties”_llmInstance?
Section titled “_llmInstance?”
optional_llmInstance:LLMInstance<unknown>
Defined in: src/agent/types.ts:123
Internal
Pre-created LLM instance for dependency injection.
Remarks
Section titled “Remarks”Used primarily for testing to inject mock LLM instances. Not intended for production use.
checkpoints?
Section titled “checkpoints?”
optionalcheckpoints:CheckpointStore
Defined in: src/agent/types.ts:104
Checkpoint store for step-level state persistence.
Remarks
Section titled “Remarks”When provided, the agent will persist state checkpoints after each execution step, enabling recovery and replay capabilities.
config?
Section titled “config?”
optionalconfig:ProviderConfig
Defined in: node_modules/@providerprotocol/ai/dist/index.d.ts:580
Provider infrastructure configuration (optional - uses env vars if omitted)
Inherited from
Section titled “Inherited from”Partial.config
execution?
Section titled “execution?”
optionalexecution:ExecutionStrategy
Defined in: src/agent/types.ts:72
Execution strategy that controls how the agent processes requests.
Remarks
Section titled “Remarks”The execution strategy determines the control flow of agent execution, including how tool calls are handled and when to stop iterating.
Default Value
Section titled “Default Value”loop() - Standard agentic loop with tool execution
middleware?
Section titled “middleware?”
optionalmiddleware:Middleware[]
Defined in: src/agent/types.ts:84
Ordered middleware pipeline for request/response processing.
Remarks
Section titled “Remarks”Middleware functions are executed in order for before hooks and in
reverse order for after hooks. This enables cross-cutting concerns
like logging, context management, and error handling.
model:
ModelReference
Defined in: src/agent/types.ts:61
Model reference from a UPP provider factory.
Remarks
Section titled “Remarks”Must be created using a provider factory function like anthropic(), openai(),
google(), etc. from @providerprotocol/ai.
Example
Section titled “Example”import { anthropic } from '@providerprotocol/ai/anthropic';model: anthropic('claude-sonnet-4-20250514')params?
Section titled “params?”
optionalparams:unknown
Defined in: node_modules/@providerprotocol/ai/dist/index.d.ts:582
Model-specific parameters (temperature, max_tokens, etc.)
Inherited from
Section titled “Inherited from”Partial.params
sessionId?
Section titled “sessionId?”
optionalsessionId:string
Defined in: src/agent/types.ts:113
Session identifier for checkpointing.
Remarks
Section titled “Remarks”Per UAP-1.0 Section 3.4, session IDs must be UUIDv4. If not provided and checkpoints are enabled, a UUIDv4 will be auto-generated.
strategy?
Section titled “strategy?”
optionalstrategy:AgentStrategy
Defined in: src/agent/types.ts:93
Agent lifecycle hooks for customizing execution behavior.
Remarks
Section titled “Remarks”Strategy hooks provide fine-grained control over the execution loop, including iteration limits and custom termination conditions.
structure?
Section titled “structure?”
optionalstructure:JSONSchema
Defined in: node_modules/@providerprotocol/ai/dist/index.d.ts:590
Structured output schema (JSON Schema)
Inherited from
Section titled “Inherited from”Partial.structure
system?
Section titled “system?”
optionalsystem:string
Defined in: node_modules/@providerprotocol/ai/dist/index.d.ts:584
System prompt for all inferences
Inherited from
Section titled “Inherited from”Partial.system
tools?
Section titled “tools?”
optionaltools:Tool<unknown,unknown>[]
Defined in: node_modules/@providerprotocol/ai/dist/index.d.ts:586
Tools available to the model
Inherited from
Section titled “Inherited from”Partial.tools
toolStrategy?
Section titled “toolStrategy?”
optionaltoolStrategy:ToolUseStrategy
Defined in: node_modules/@providerprotocol/ai/dist/index.d.ts:588
Tool execution strategy
Inherited from
Section titled “Inherited from”Partial.toolStrategy