Skip to main content

Revision

Struct Revision 

Source
pub struct Revision<M: Client> { /* private fields */ }
Expand description

Owned immutable configuration snapshot identified within this process.

This is the unit that a Run freezes, and the exact extent of the rule that configuration does not change inside a Run: the model client, the tool registry including its provider roster, the hook roster, the gate, and the default system instruction, sampling params and model extensions. Changing any of them means stopping the Run, waiting for the Session lease to be released, and starting a successor Run with a new revision.

It is not a claim that everything downstream of those bindings is constant. Two things a revision deliberately leaves free:

  • The resolved tool set. tool::Provider::resolve runs once per Step, so the exposed tools may differ at every Step of one Run. The roster is frozen; the resolution is a per-Step observation of it. A proposal to relax Run granularity so that the tool set can vary is therefore answering a problem that does not exist.
  • The request. System instruction, sampling params and extensions are defaults seeded into each Step’s RequestPlan; ModelHooks::before_model and the plan’s own mutators adjust this one request without touching the binding. Anything that needs to change per Turn is request content, not configuration, and almost every proposal to make configuration mutable is really this.

Implementations§

Source§

impl<M: Client> Revision<M>

Source

pub const fn id(&self) -> NonZeroU64

Returns the process-monotonic nonzero revision identity.

Source

pub const fn model(&self) -> &Arc<M> ⓘ

Returns the shared model implementation.

Source

pub const fn tools(&self) -> &Registry

Returns the immutable tool registry.

Source

pub fn hook_names(&self) -> &[String]

Returns close-free hook names in registration order.

Source

pub fn hook_bindings(&self) -> &[Binding]

Returns close-free sticky bindings in registration order.

Source

pub const fn hooks_require_session_state(&self) -> bool

Reports whether any hook declared Session-state access.

Source

pub fn tool_gate(&self) -> Option<&Arc<dyn Gate>>

Returns the optional shared tool gate.

Source

pub fn system_instruction(&self) -> &[Part]

Returns the frozen default system instruction.

Source

pub const fn sampling(&self) -> &SamplingParams

Returns the frozen sampling controls.

Source

pub fn model_extensions(&self) -> &[Envelope]

Returns the frozen provider-hosted extensions.

Trait Implementations§

Source§

impl<M: Client> Clone for Revision<M>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<M: Client> Debug for Revision<M>

Source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Shows the frozen configuration, identified by its revision number.

As with Config, the model is the one field left out: M has no Debug bound, and the trailing .. records the omission.

Auto Trait Implementations§

§

impl<M> !RefUnwindSafe for Revision<M>

§

impl<M> !UnwindSafe for Revision<M>

§

impl<M> Freeze for Revision<M>
where Arc<M>: Freeze,

§

impl<M> Send for Revision<M>
where Arc<M>: Send,

§

impl<M> Sync for Revision<M>
where Arc<M>: Sync,

§

impl<M> Unpin for Revision<M>
where Arc<M>: Unpin,

§

impl<M> UnsafeUnpin for Revision<M>
where Arc<M>: UnsafeUnpin,

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.