pub struct SessionSpec {
pub provider_id: Option<String>,
pub model: Option<ModelSpec>,
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
persisted SessionPolicy directly.
Fields§
§provider_id: Option<String>§model: Option<ModelSpec>§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_id(self, provider_id: impl Into<String>) -> Self
pub fn model(self, model: ModelSpec) -> 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
impl Eq 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 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