pub struct OptionsBuilder { /* private fields */ }Expand description
Builder for constructing Options.
Implementations§
Source§impl OptionsBuilder
impl OptionsBuilder
pub fn allowed_tools(self, tools: Vec<String>) -> Self
pub fn disallowed_tools(self, tools: Vec<String>) -> Self
pub fn permission_mode(self, mode: PermissionMode) -> Self
pub fn cwd(self, cwd: impl Into<String>) -> Self
pub fn additional_directories(self, dirs: Vec<String>) -> Self
pub fn env_blocklist(self, keys: Vec<String>) -> Self
pub fn model(self, model: impl Into<String>) -> Self
pub fn fallback_model(self, model: impl Into<String>) -> Self
pub fn effort(self, effort: Effort) -> Self
pub fn max_turns(self, max_turns: u32) -> Self
pub fn max_budget_usd(self, budget: f64) -> Self
pub fn context_budget(self, budget: u64) -> Self
pub fn compaction_model(self, model: impl Into<String>) -> Self
pub fn compaction_provider(self, provider: Box<dyn LlmProvider>) -> Self
pub fn system_prompt(self, prompt: SystemPrompt) -> Self
pub fn thinking(self, config: ThinkingConfig) -> Self
pub fn hook(self, event: HookEvent, matchers: Vec<HookCallbackMatcher>) -> Self
pub fn hook_dirs(self, dirs: Vec<PathBuf>) -> Self
pub fn mcp_server( self, name: impl Into<String>, config: McpServerConfig, ) -> Self
pub fn agent(self, name: impl Into<String>, definition: AgentDefinition) -> Self
pub fn continue_session(self, value: bool) -> Self
pub fn resume(self, session_id: impl Into<String>) -> Self
pub fn session_id(self, id: impl Into<String>) -> Self
pub fn fork_session(self, value: bool) -> Self
pub fn setting_sources(self, sources: Vec<SettingSource>) -> Self
pub fn debug(self, value: bool) -> Self
pub fn include_partial_messages(self, value: bool) -> Self
pub fn persist_session(self, value: bool) -> Self
pub fn enable_file_checkpointing(self, value: bool) -> Self
pub fn env(self, key: impl Into<String>, value: impl Into<String>) -> Self
pub fn output_format(self, schema: Value) -> Self
pub fn sandbox(self, settings: SandboxSettings) -> Self
pub fn external_tool_handler(self, handler: ExternalToolHandlerFn) -> Self
pub fn custom_tool(self, def: CustomToolDefinition) -> Self
pub fn custom_tools(self, defs: Vec<CustomToolDefinition>) -> Self
pub fn followup_rx(self, rx: UnboundedReceiver<String>) -> Self
pub fn api_key(self, key: impl Into<String>) -> Self
pub fn attachments(self, attachments: Vec<QueryAttachment>) -> Self
pub fn provider(self, provider: Box<dyn LlmProvider>) -> Self
pub fn pre_compact_handler(self, handler: PreCompactHandlerFn) -> Self
pub fn max_tokens(self, max_tokens: u32) -> Self
pub fn summary_max_tokens(self, tokens: u32) -> Self
pub fn min_keep_messages(self, count: usize) -> Self
pub fn max_tool_result_bytes(self, bytes: usize) -> Self
pub fn prune_threshold_pct(self, pct: u8) -> Self
pub fn prune_tool_result_max_chars(self, chars: usize) -> Self
pub fn build(self) -> Options
Trait Implementations§
Source§impl Default for OptionsBuilder
impl Default for OptionsBuilder
Source§fn default() -> OptionsBuilder
fn default() -> OptionsBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for OptionsBuilder
impl !RefUnwindSafe for OptionsBuilder
impl Send for OptionsBuilder
impl Sync for OptionsBuilder
impl Unpin for OptionsBuilder
impl UnsafeUnpin for OptionsBuilder
impl !UnwindSafe for OptionsBuilder
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 moreCreates a shared type from an unshared type.