pub struct AfterModelScope<'a> { /* private fields */ }Expand description
ModelHooks::after_model scope over assembled but uncommitted assistant output.
Implementations§
Source§impl AfterModelScope<'_>
impl AfterModelScope<'_>
Sourcepub const fn session(&self) -> SessionIdentity<'_>
pub const fn session(&self) -> SessionIdentity<'_>
Returns stable Session identity without broader Session authority.
Sourcepub const fn session_state(&self) -> &Reader
pub const fn session_state(&self) -> &Reader
Returns owned-snapshot Session-state read authority.
Sourcepub fn transcript(&self) -> Result<Snapshot, Error>
pub fn transcript(&self) -> Result<Snapshot, Error>
Captures the complete transcript at this callback’s phase position.
§Errors
Returns store::Error::Poisoned if the underlying transcript lock
was poisoned.
Sourcepub const fn session_state_writer(&self) -> Option<&Writer>
pub const fn session_state_writer(&self) -> Option<&Writer>
Returns lease-bound write authority only for a hook which declared
requires_session_state(true).
Sourcepub fn emit_audit(&self, event: Event)
pub fn emit_audit(&self, event: Event)
Emits an audit fact through the capability-narrowed boundary.
Sourcepub fn emit_error(&self, error: Arc<dyn Error + Send + Sync>)
pub fn emit_error(&self, error: Arc<dyn Error + Send + Sync>)
Emits a non-fatal error through the capability-narrowed boundary.
Sourcepub fn snapshot(&self) -> &StepSnapshot
pub fn snapshot(&self) -> &StepSnapshot
Returns the exact frozen Step snapshot used for this generation.
Sourcepub const fn generated(&self) -> bool
pub const fn generated(&self) -> bool
Reports whether a real model generation produced this output.
Sourcepub const fn finish_reason(&self) -> &str
pub const fn finish_reason(&self) -> &str
Returns the provider’s verbatim finish label.
This is empty when no provider supplied a label, including when
BeforeModelDecision::ShortCircuit bypassed provider invocation.
Sourcepub const fn completion(&self) -> CompletionReason
pub const fn completion(&self) -> CompletionReason
Returns the portable completion classification.