pub struct SessionOptions {Show 18 fields
pub cwd: PathBuf,
pub model_override: Option<Model>,
pub model: Option<String>,
pub provider: Option<String>,
pub api_key: Option<String>,
pub thinking: Option<ThinkingLevel>,
pub mode: Option<AgentMode>,
pub max_turns: Option<u32>,
pub max_tokens: Option<u32>,
pub system_prompt: Option<String>,
pub no_tools: bool,
pub session: SessionChoice,
pub task: Option<TaskContext>,
pub facts: Vec<Fact>,
pub lua_loader: Option<LuaToolLoader>,
pub ui: Option<Arc<dyn UserInterface>>,
pub auth_path: Option<PathBuf>,
pub context_prefill: Vec<Message>,
}Expand description
Configuration for creating an ImpSession.
All fields have sensible defaults — only cwd is typically required.
Fields§
§cwd: PathBufWorking directory. Tools resolve paths relative to this.
model_override: Option<Model>Prebuilt model override for deterministic tests or embedded callers. When set, ImpSession skips runtime model/provider/auth resolution.
model: Option<String>Model hint — alias (“sonnet”) or full ID. Resolved against the model registry. Falls back to config, then “sonnet”.
provider: Option<String>Provider override. Usually auto-detected from the model.
api_key: Option<String>Runtime API key override (not persisted).
thinking: Option<ThinkingLevel>Thinking level override.
mode: Option<AgentMode>Agent mode (full, worker, orchestrator, …).
max_turns: Option<u32>Maximum turns before the agent stops.
max_tokens: Option<u32>Max output tokens per response.
system_prompt: Option<String>Replace the assembled system prompt entirely.
no_tools: boolSkip native tool registration.
session: SessionChoiceSession persistence strategy.
task: Option<TaskContext>Task context for headless / unit mode.
facts: Vec<Fact>Task-specific facts to inject into the system prompt.
lua_loader: Option<LuaToolLoader>Lua extension loader. Called after native tools are registered.
The binary crate typically provides this; library callers can
pass None to skip Lua extensions.
ui: Option<Arc<dyn UserInterface>>Custom UI implementation. Defaults to NullInterface.
auth_path: Option<PathBuf>Path to auth.json. Defaults to ~/.config/imp/auth.json.
context_prefill: Vec<Message>Pre-assembled context messages injected before the first prompt.
Built by context_prefill::assemble_context() at dispatch time.
The agent starts with these files already in its cached prefix.
Trait Implementations§
Auto 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<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
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>
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>
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 more