pub struct AgentOptions {Show 22 fields
pub initial_state: Option<AgentState>,
pub convert_to_llm: Option<ConvertToLlm>,
pub transform_context: Option<TransformContext>,
pub transform_model_request: Option<TransformModelRequest>,
pub transform_message: Option<TransformMessage>,
pub provider_request_interceptor: Option<ProviderRequestInterceptorHandle>,
pub stream_fn: Option<StreamFn>,
pub get_api_key: Option<GetApiKey>,
pub before_tool_call: Option<BeforeToolCallHook>,
pub after_tool_call: Option<AfterToolCallHook>,
pub transform_tool_result: Option<AfterToolCallHook>,
pub on_control_plane_prompt: Option<OnControlPlanePromptHook>,
pub should_stop_after_turn: Option<ShouldStopHook>,
pub prepare_next_turn: Option<PrepareNextTurnHook>,
pub steering_mode: QueueMode,
pub follow_up_mode: QueueMode,
pub session_id: Option<String>,
pub observer: Arc<dyn RuntimeObserver>,
pub observation_context: ObservationContext,
pub observation_parent: Option<OperationId>,
pub tool_execution: ToolExecutionMode,
pub max_iterations: Option<u32>,
}Expand description
Options accepted by Agent::new.
Fields§
§initial_state: Option<AgentState>§convert_to_llm: Option<ConvertToLlm>§transform_context: Option<TransformContext>§transform_model_request: Option<TransformModelRequest>§transform_message: Option<TransformMessage>§provider_request_interceptor: Option<ProviderRequestInterceptorHandle>§stream_fn: Option<StreamFn>§get_api_key: Option<GetApiKey>§before_tool_call: Option<BeforeToolCallHook>§after_tool_call: Option<AfterToolCallHook>§transform_tool_result: Option<AfterToolCallHook>Final tool-result transform after execution-end observation and before construction of the model-visible tool-result message.
on_control_plane_prompt: Option<OnControlPlanePromptHook>§should_stop_after_turn: Option<ShouldStopHook>§prepare_next_turn: Option<PrepareNextTurnHook>§steering_mode: QueueMode§follow_up_mode: QueueMode§session_id: Option<String>§observer: Arc<dyn RuntimeObserver>Content-safe runtime observation port supplied by the embedding application.
observation_context: ObservationContextCorrelation values inherited by operations created by this agent.
observation_parent: Option<OperationId>Optional parent operation supplied by an embedding runtime or subagent launcher.
tool_execution: ToolExecutionMode§max_iterations: Option<u32>Hard cap on loop iterations (one LLM turn attempt each) for this agent.
None = unbounded (the interactive main agent). Sub-harnesses
(subagent tool, DAG nodes, goal evaluator) set it from their spec’s
max_iterations; the cap raises AgentRunError::Other("max iterations (N) exceeded") before the call that would exceed it.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for AgentOptions
impl !UnwindSafe for AgentOptions
impl Freeze for AgentOptions
impl Send for AgentOptions
impl Sync for AgentOptions
impl Unpin for AgentOptions
impl UnsafeUnpin for AgentOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more