pub struct RunOptions {
pub model: String,
pub system_prompt: String,
pub allowed_tools: Option<Vec<String>>,
pub disallowed_tools: Vec<String>,
pub max_turns: Option<u32>,
pub max_budget_usd: Option<f64>,
pub effort: EffortLevel,
pub permission_mode: PermissionMode,
pub pre_tool_hook: Option<Arc<dyn PreToolHook>>,
pub session_id: Option<String>,
pub base_url: String,
pub compaction: Option<CompactionConfig>,
}Expand description
Configuration for an agent run.
Mirrors ClaudeAgentOptions / Options from the Claude Agent SDK, scoped
to the fields meaningful for a non-streaming OpenAI-compatible loop.
Fields§
§model: String§system_prompt: String§allowed_tools: Option<Vec<String>>If Some, only listed tools may be invoked. Tools not on the list are
hidden from the model entirely.
disallowed_tools: Vec<String>Tools listed here are hidden from the model and any call is denied.
max_turns: Option<u32>§max_budget_usd: Option<f64>§effort: EffortLevel§permission_mode: PermissionMode§pre_tool_hook: Option<Arc<dyn PreToolHook>>§session_id: Option<String>§base_url: String§compaction: Option<CompactionConfig>Opt-in history compaction. None (default) disables compaction —
the full conversation is resent every turn. See CompactionConfig.
Implementations§
Source§impl RunOptions
impl RunOptions
pub fn new(model: impl Into<String>) -> Self
pub fn system_prompt(self, p: impl Into<String>) -> Self
pub fn max_turns(self, n: u32) -> Self
pub fn max_budget_usd(self, b: f64) -> Self
pub fn effort(self, e: EffortLevel) -> Self
pub fn permission_mode(self, m: PermissionMode) -> Self
pub fn allowed_tools<I, S>(self, tools: I) -> Self
pub fn disallowed_tools<I, S>(self, tools: I) -> Self
pub fn pre_tool_hook(self, hook: Arc<dyn PreToolHook>) -> Self
pub fn session_id(self, id: impl Into<String>) -> Self
pub fn base_url(self, url: impl Into<String>) -> Self
Sourcepub fn compaction(self, cfg: CompactionConfig) -> Self
pub fn compaction(self, cfg: CompactionConfig) -> Self
Enable natural-language history compaction with the given config.
Trait Implementations§
Source§impl Clone for RunOptions
impl Clone for RunOptions
Source§fn clone(&self) -> RunOptions
fn clone(&self) -> RunOptions
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for RunOptions
impl !RefUnwindSafe for RunOptions
impl Send for RunOptions
impl Sync for RunOptions
impl Unpin for RunOptions
impl UnsafeUnpin for RunOptions
impl !UnwindSafe for RunOptions
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