pub struct SessionOptions {Show 19 fields
pub provider: Option<String>,
pub model: Option<String>,
pub api_key: Option<String>,
pub thinking: Option<ThinkingLevel>,
pub system_prompt: Option<String>,
pub append_system_prompt: Option<String>,
pub enabled_tools: Option<Vec<String>>,
pub working_directory: Option<PathBuf>,
pub no_session: bool,
pub session_path: Option<PathBuf>,
pub session_dir: Option<PathBuf>,
pub extension_paths: Vec<PathBuf>,
pub extension_policy: Option<String>,
pub repair_policy: Option<String>,
pub max_tool_iterations: usize,
pub on_event: Option<Arc<dyn Fn(AgentEvent) + Send + Sync>>,
pub on_tool_start: Option<OnToolStart>,
pub on_tool_end: Option<OnToolEnd>,
pub on_stream_event: Option<OnStreamEvent>,
}Expand description
SDK session construction options.
These options provide the programmatic equivalent of the core CLI startup
path used in src/main.rs.
Fields§
§provider: Option<String>§model: Option<String>§api_key: Option<String>§thinking: Option<ThinkingLevel>§system_prompt: Option<String>§append_system_prompt: Option<String>§enabled_tools: Option<Vec<String>>§working_directory: Option<PathBuf>§no_session: bool§session_path: Option<PathBuf>§session_dir: Option<PathBuf>§extension_paths: Vec<PathBuf>§extension_policy: Option<String>§repair_policy: Option<String>§max_tool_iterations: usize§on_event: Option<Arc<dyn Fn(AgentEvent) + Send + Sync>>Session-level event listener invoked for every AgentEvent.
Unlike the per-prompt callback passed to AgentSessionHandle::prompt,
this fires for all prompts throughout the session lifetime.
on_tool_start: Option<OnToolStart>Typed callback invoked when tool execution starts.
on_tool_end: Option<OnToolEnd>Typed callback invoked when tool execution ends.
on_stream_event: Option<OnStreamEvent>Callback for raw provider StreamEvents.
Trait Implementations§
Source§impl Clone for SessionOptions
impl Clone for SessionOptions
Source§fn clone(&self) -> SessionOptions
fn clone(&self) -> SessionOptions
Returns a duplicate of the value. Read more
1.0.0 · 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 SessionOptions
impl !RefUnwindSafe for SessionOptions
impl Send for SessionOptions
impl Sync for SessionOptions
impl Unpin for SessionOptions
impl UnsafeUnpin for SessionOptions
impl !UnwindSafe for SessionOptions
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().