pub struct SessionSpec {
pub provider: Option<ProviderHandle>,
pub model: Option<String>,
pub model_variant: Option<Option<String>>,
pub execution_mode: Option<ExecutionMode>,
pub max_context_tokens: Option<usize>,
pub max_turns: Option<Option<usize>>,
pub prompt: Option<PromptLayer>,
/* private fields */
}Expand description
Reusable session configuration overlay.
SessionSpec is the public configuration shape for callers that want to
describe either a root session or a child session without constructing the
resolved runtime-only SessionPolicy directly.
Fields§
§provider: Option<ProviderHandle>§model: Option<String>§model_variant: Option<Option<String>>§execution_mode: Option<ExecutionMode>§max_context_tokens: Option<usize>§max_turns: Option<Option<usize>>§prompt: Option<PromptLayer>Implementations§
Source§impl SessionSpec
impl SessionSpec
Sourcepub fn new() -> Self
pub fn new() -> Self
Create an explicit root-style spec. Unset fields resolve from the runtime’s core defaults.
Sourcepub fn inherit() -> Self
pub fn inherit() -> Self
Create a parent-relative spec. Unset fields inherit from the live parent policy at resolution time.
pub fn inherits(&self) -> bool
pub fn provider(self, provider: ProviderHandle) -> Self
pub fn model(self, model: impl Into<String>, variant: Option<String>) -> Self
pub fn model_variant(self, variant: impl Into<String>) -> Self
pub fn clear_model_variant(self) -> Self
pub fn mode(self, mode: ExecutionMode) -> Self
pub fn max_context_tokens(self, max_context_tokens: usize) -> Self
pub fn max_turns(self, max_turns: usize) -> Self
pub fn clear_max_turns(self) -> Self
pub fn prompt_layer(self, prompt: PromptLayer) -> Self
pub fn resolve_against(&self, base: &SessionPolicy) -> SessionPolicy
Trait Implementations§
Source§impl Clone for SessionSpec
impl Clone for SessionSpec
Source§fn clone(&self) -> SessionSpec
fn clone(&self) -> SessionSpec
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 moreSource§impl Debug for SessionSpec
impl Debug for SessionSpec
Source§impl Default for SessionSpec
impl Default for SessionSpec
Source§impl PartialEq for SessionSpec
impl PartialEq for SessionSpec
Source§fn eq(&self, other: &SessionSpec) -> bool
fn eq(&self, other: &SessionSpec) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for SessionSpec
impl StructuralPartialEq for SessionSpec
Auto Trait Implementations§
impl Freeze for SessionSpec
impl !RefUnwindSafe for SessionSpec
impl Send for SessionSpec
impl Sync for SessionSpec
impl Unpin for SessionSpec
impl UnsafeUnpin for SessionSpec
impl !UnwindSafe for SessionSpec
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