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, 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::resolveruns 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_modeland 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>
impl<M: Client> Revision<M>
Sourcepub const fn id(&self) -> NonZeroU64
pub const fn id(&self) -> NonZeroU64
Returns the process-monotonic nonzero revision identity.
Sourcepub fn hook_names(&self) -> &[String]
pub fn hook_names(&self) -> &[String]
Returns close-free hook names in registration order.
Sourcepub const fn hooks_require_session_state(&self) -> bool
pub const fn hooks_require_session_state(&self) -> bool
Reports whether any hook declared Session-state access.
Sourcepub fn system_instruction(&self) -> &[Part]
pub fn system_instruction(&self) -> &[Part]
Returns the frozen default system instruction.
Sourcepub const fn sampling(&self) -> &SamplingParams
pub const fn sampling(&self) -> &SamplingParams
Returns the frozen sampling controls.
Sourcepub fn model_extensions(&self) -> &[Envelope]
pub fn model_extensions(&self) -> &[Envelope]
Returns the frozen provider-hosted extensions.