pub struct ClaudeAgentOptionsBuilder { /* private fields */ }Expand description
Builder for ClaudeAgentOptions
Implementations§
Source§impl ClaudeAgentOptionsBuilder
impl ClaudeAgentOptionsBuilder
pub fn new() -> Self
pub fn tools(self, tools: Vec<String>) -> Self
pub fn tools_preset(self, preset: ToolsPreset) -> Self
pub fn allowed_tools(self, tools: Vec<String>) -> Self
pub fn system_prompt(self, prompt: impl Into<String>) -> Self
pub fn system_prompt_preset(self, preset: SystemPromptPreset) -> Self
pub fn system_prompt_file(self, file: SystemPromptFile) -> Self
pub fn mcp_server( self, name: impl Into<String>, config: MCPServerConfig, ) -> Self
pub fn sdk_mcp_server( self, name: impl Into<String>, server: SimpleMCPServer, ) -> Self
pub fn mcp_servers(self, servers: HashMap<String, MCPServerConfig>) -> Self
pub fn mcp_servers_config(self, config: impl Into<String>) -> Self
pub fn permission_mode(self, mode: PermissionMode) -> Self
pub fn continue_conversation(self, continue_conv: bool) -> Self
pub fn resume(self, session_id: impl Into<String>) -> Self
pub fn session_id(self, session_id: impl Into<String>) -> Self
pub fn fork_session(self, fork: bool) -> Self
pub fn max_turns(self, turns: i32) -> Self
pub fn max_budget_usd(self, budget: f64) -> Self
pub fn task_budget(self, budget: TaskBudget) -> Self
pub fn task_budget_total(self, total: i32) -> Self
pub fn disallowed_tools(self, tools: Vec<String>) -> Self
pub fn model(self, model: impl Into<String>) -> Self
pub fn fallback_model(self, model: impl Into<String>) -> Self
pub fn betas(self, betas: Vec<SdkBeta>) -> Self
pub fn add_beta(self, beta: SdkBeta) -> Self
pub fn permission_prompt_tool_name(self, name: impl Into<String>) -> Self
pub fn can_use_tool<F, Fut>(self, callback: F) -> Self
pub fn hook(self, event: impl Into<String>, matcher: HookMatcher) -> Self
pub fn hooks(self, hooks: HookMap) -> Self
pub fn agent(self, name: impl Into<String>, agent: AgentDefinition) -> Self
pub fn agents(self, agents: HashMap<String, AgentDefinition>) -> Self
pub fn cwd(self, cwd: impl Into<String>) -> Self
pub fn cli_path(self, path: impl Into<String>) -> Self
pub fn settings(self, settings: impl Into<String>) -> Self
pub fn add_dir(self, dir: impl Into<String>) -> Self
pub fn add_dirs(self, dirs: Vec<String>) -> Self
pub fn env(self, env: HashMap<String, String>) -> Self
pub fn env_var(self, key: impl Into<String>, value: impl Into<String>) -> Self
pub fn extra_arg(self, key: impl Into<String>, value: Option<String>) -> Self
pub fn max_buffer_size(self, size: usize) -> Self
pub fn user(self, user: impl Into<String>) -> Self
pub fn include_partial_messages(self, include: bool) -> Self
pub fn include_hook_events(self, include: bool) -> Self
pub fn strict_mcp_config(self, strict: bool) -> Self
pub fn setting_sources(self, sources: Vec<SettingSource>) -> Self
pub fn add_setting_source(self, source: SettingSource) -> Self
pub fn skills_all(self) -> Self
pub fn skills(self, skills: Vec<String>) -> Self
pub fn sandbox(self, sandbox: SandboxSettings) -> Self
pub fn plugin(self, plugin: SDKPluginConfig) -> Self
pub fn plugins(self, plugins: Vec<SDKPluginConfig>) -> Self
pub fn max_thinking_tokens(self, tokens: i32) -> Self
pub fn thinking(self, thinking: ThinkingConfig) -> Self
pub fn effort(self, effort: impl Into<String>) -> Self
pub fn output_format(self, format: Map<String, Value>) -> Self
pub fn enable_file_checkpointing(self, enable: bool) -> Self
pub fn stderr<F>(self, callback: F) -> Self
pub fn session_store<S>(self, store: S) -> Selfwhere
S: SessionStore + 'static,
pub fn session_store_handle(self, store: SessionStoreHandle) -> Self
pub fn session_store_flush(self, mode: SessionStoreFlushMode) -> Self
pub fn load_timeout_ms(self, timeout_ms: i32) -> Self
pub fn build(self) -> ClaudeAgentOptions
Trait Implementations§
Source§impl Debug for ClaudeAgentOptionsBuilder
impl Debug for ClaudeAgentOptionsBuilder
Source§impl Default for ClaudeAgentOptionsBuilder
impl Default for ClaudeAgentOptionsBuilder
Source§fn default() -> ClaudeAgentOptionsBuilder
fn default() -> ClaudeAgentOptionsBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for ClaudeAgentOptionsBuilder
impl !UnwindSafe for ClaudeAgentOptionsBuilder
impl Freeze for ClaudeAgentOptionsBuilder
impl Send for ClaudeAgentOptionsBuilder
impl Sync for ClaudeAgentOptionsBuilder
impl Unpin for ClaudeAgentOptionsBuilder
impl UnsafeUnpin for ClaudeAgentOptionsBuilder
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more