Skip to main content

SessionConfigBuilder

Struct SessionConfigBuilder 

Source
pub struct SessionConfigBuilder<C, S: State = Empty> { /* private fields */ }
Expand description

Use builder syntax to set the inputs and finish with build().

Implementations§

Source§

impl<C, S: State> SessionConfigBuilder<C, S>

Source

pub fn build(self) -> SessionConfig<C>
where S: IsComplete,

Finish building and return the requested object

Source

pub fn model( self, value: impl Into<String>, ) -> SessionConfigBuilder<C, SetModel<S>>
where S::Model: IsUnset,

Optional (Some / Option setters).

Source

pub fn maybe_model( self, value: Option<impl Into<String>>, ) -> SessionConfigBuilder<C, SetModel<S>>
where S::Model: IsUnset,

Optional (Some / Option setters).

Source

pub fn cwd(self, value: PathBuf) -> SessionConfigBuilder<C, SetCwd<S>>
where S::Cwd: IsUnset,

Optional (Some / Option setters).

Source

pub fn maybe_cwd( self, value: Option<PathBuf>, ) -> SessionConfigBuilder<C, SetCwd<S>>
where S::Cwd: IsUnset,

Optional (Some / Option setters).

Source

pub fn additional_dirs( self, value: Vec<PathBuf>, ) -> SessionConfigBuilder<C, SetAdditionalDirs<S>>
where S::AdditionalDirs: IsUnset,

Optional (Some / Option setters). Default: <Vec<PathBuf> as Default>::default().

Source

pub fn maybe_additional_dirs( self, value: Option<Vec<PathBuf>>, ) -> SessionConfigBuilder<C, SetAdditionalDirs<S>>
where S::AdditionalDirs: IsUnset,

Optional (Some / Option setters). Default: <Vec<PathBuf> as Default>::default().

Source

pub fn env( self, value: HashMap<String, String>, ) -> SessionConfigBuilder<C, SetEnv<S>>
where S::Env: IsUnset,

Optional (Some / Option setters). Default: <HashMap<String, String> as Default>::default().

Source

pub fn maybe_env( self, value: Option<HashMap<String, String>>, ) -> SessionConfigBuilder<C, SetEnv<S>>
where S::Env: IsUnset,

Optional (Some / Option setters). Default: <HashMap<String, String> as Default>::default().

Source

pub fn env_remove( self, value: HashSet<String>, ) -> SessionConfigBuilder<C, SetEnvRemove<S>>
where S::EnvRemove: IsUnset,

Optional (Some / Option setters). Default: <HashSet<String> as Default>::default().

Inherited environment variables to remove from the subprocess. Only meaningful when the subprocess inherits the parent environment.

Source

pub fn maybe_env_remove( self, value: Option<HashSet<String>>, ) -> SessionConfigBuilder<C, SetEnvRemove<S>>
where S::EnvRemove: IsUnset,

Optional (Some / Option setters). Default: <HashSet<String> as Default>::default().

Inherited environment variables to remove from the subprocess. Only meaningful when the subprocess inherits the parent environment.

Source

pub fn max_turns(self, value: u32) -> SessionConfigBuilder<C, SetMaxTurns<S>>
where S::MaxTurns: IsUnset,

Optional (Some / Option setters).

Source

pub fn maybe_max_turns( self, value: Option<u32>, ) -> SessionConfigBuilder<C, SetMaxTurns<S>>
where S::MaxTurns: IsUnset,

Optional (Some / Option setters).

Source

pub fn system_prompt( self, value: impl Into<String>, ) -> SessionConfigBuilder<C, SetSystemPrompt<S>>
where S::SystemPrompt: IsUnset,

Optional (Some / Option setters).

Source

pub fn maybe_system_prompt( self, value: Option<impl Into<String>>, ) -> SessionConfigBuilder<C, SetSystemPrompt<S>>
where S::SystemPrompt: IsUnset,

Optional (Some / Option setters).

Source

pub fn backend(self, value: C) -> SessionConfigBuilder<C, SetBackend<S>>
where S::Backend: IsUnset,

Required.

Auto Trait Implementations§

§

impl<C, S> Freeze for SessionConfigBuilder<C, S>
where C: Freeze,

§

impl<C, S> RefUnwindSafe for SessionConfigBuilder<C, S>
where C: RefUnwindSafe,

§

impl<C, S> Send for SessionConfigBuilder<C, S>
where C: Send,

§

impl<C, S> Sync for SessionConfigBuilder<C, S>
where C: Sync,

§

impl<C, S> Unpin for SessionConfigBuilder<C, S>
where C: Unpin,

§

impl<C, S> UnsafeUnpin for SessionConfigBuilder<C, S>
where C: UnsafeUnpin,

§

impl<C, S> UnwindSafe for SessionConfigBuilder<C, S>
where C: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.