pub struct DuplexOptions { /* private fields */ }Expand description
Configuration for DuplexSession::spawn.
Builder methods cover the most common spawn-time options. The
spawn call always includes
--print --verbose --input-format stream-json --output-format stream-json
regardless of these options.
Implementations§
Source§impl DuplexOptions
impl DuplexOptions
Sourcepub fn system_prompt(self, prompt: impl Into<String>) -> Self
pub fn system_prompt(self, prompt: impl Into<String>) -> Self
Set the system prompt for this session (--system-prompt).
Sourcepub fn append_system_prompt(self, prompt: impl Into<String>) -> Self
pub fn append_system_prompt(self, prompt: impl Into<String>) -> Self
Append to the default system prompt (--append-system-prompt).
Sourcepub fn arg(self, arg: impl Into<String>) -> Self
pub fn arg(self, arg: impl Into<String>) -> Self
Add a raw argument to the spawn command line.
Escape hatch for flags not covered by the dedicated builder methods.
Sourcepub fn subscriber_capacity(self, capacity: usize) -> Self
pub fn subscriber_capacity(self, capacity: usize) -> Self
Set the per-session broadcast::Sender capacity backing
DuplexSession::subscribe.
Defaults to DEFAULT_SUBSCRIBER_CAPACITY (256). Larger
values give slow subscribers more room before they
Lagged;
smaller values reclaim memory if you do not subscribe.
Sourcepub fn on_permission(self, handler: PermissionHandler) -> Self
pub fn on_permission(self, handler: PermissionHandler) -> Self
Register a PermissionHandler to answer the CLI’s tool-use
permission prompts in-flight.
When set, the spawn command line includes
--permission-prompt-tool stdio, which configures the CLI to
emit control_request messages for tool use over the duplex
channel rather than blocking on a TUI prompt.
Without a handler, the session does not pass
--permission-prompt-tool and the CLI applies its default
permission policy (driven by --permission-mode).
Trait Implementations§
Source§impl Clone for DuplexOptions
impl Clone for DuplexOptions
Source§fn clone(&self) -> DuplexOptions
fn clone(&self) -> DuplexOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more