pub struct BeforeGenerate {
pub model: String,
pub message_count: usize,
pub attempt: u32,
pub assistant_text: Option<String>,
}Expand description
before Generate: runs before the LLM call. Call-site hook — can modify request
fields, or set assistant_text to short-circuit (skip the real LLM call with a
synthetic reply).
Fields§
§model: String§message_count: usize§attempt: u32§assistant_text: Option<String>Short-circuit: Some = skip the LLM call and use this synthetic assistant text as
the reply. On commit, it is built into a Message.
Trait Implementations§
Source§impl Clone for BeforeGenerate
impl Clone for BeforeGenerate
Source§fn clone(&self) -> BeforeGenerate
fn clone(&self) -> BeforeGenerate
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 BeforeGenerate
impl Debug for BeforeGenerate
Source§impl HookStep for BeforeGenerate
impl HookStep for BeforeGenerate
Source§fn event_name(&self) -> &'static str
fn event_name(&self) -> &'static str
Event name (snake_case). Used in envelope headers and matchers.
Source§fn to_envelope(&self) -> Value
fn to_envelope(&self) -> Value
Projects the step into an input envelope — fed to command stdin / prompt
templates. Contains a common header plus step-specific fields.
Source§fn apply_verdict(
&mut self,
verdict: &Value,
) -> Result<HookControl, VerdictError>
fn apply_verdict( &mut self, verdict: &Value, ) -> Result<HookControl, VerdictError>
Apply the handler’s output verdict (JSON) back to this step: parse the common
control / additional_context fields, then handle the step-specific “fill
output” fields. Returns a control directive. Read moreAuto Trait Implementations§
impl Freeze for BeforeGenerate
impl RefUnwindSafe for BeforeGenerate
impl Send for BeforeGenerate
impl Sync for BeforeGenerate
impl Unpin for BeforeGenerate
impl UnsafeUnpin for BeforeGenerate
impl UnwindSafe for BeforeGenerate
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