pub struct GuardCtx {Show 16 fields
pub session_id: SessionId,
pub turn_count: u32,
pub user_input: String,
pub model_response: String,
pub finish_reason: FinishReason,
pub available_tools: Vec<String>,
pub reasoning_only_strikes: usize,
pub empty_response_strikes: usize,
pub run_has_tool_calls: bool,
pub all_user_inputs: Vec<String>,
pub is_reasoning_only: bool,
pub is_empty_response: bool,
pub is_text_only: bool,
pub thinking_disabled: bool,
pub original_thinking_enabled: bool,
pub remaining_turns: u32,
}Expand description
Guard context information — built by runtime, passed to guard.
Fields§
§session_id: SessionId§turn_count: u32§user_input: String§model_response: String§finish_reason: FinishReason§available_tools: Vec<String>§reasoning_only_strikes: usize§empty_response_strikes: usize§run_has_tool_calls: bool§all_user_inputs: Vec<String>All user messages in the current session, ordered oldest-first. Guards can use this to reconstruct full conversation context (e.g. “继续” after a multi-turn discussion).
is_reasoning_only: bool§is_empty_response: bool§is_text_only: bool§thinking_disabled: bool§original_thinking_enabled: boolOriginal thinking configuration (for restoration)
From RunState.original_thinking_enabled
remaining_turns: u32Remaining turns before hitting max_turns limit
Guards can use this to nudge the model to wrap up when running low on turns. When remaining_turns == 0, the run will be terminated with MaxTurnsExceeded.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for GuardCtx
impl<'de> Deserialize<'de> for GuardCtx
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for GuardCtx
impl RefUnwindSafe for GuardCtx
impl Send for GuardCtx
impl Sync for GuardCtx
impl Unpin for GuardCtx
impl UnsafeUnpin for GuardCtx
impl UnwindSafe for GuardCtx
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