#[non_exhaustive]pub enum Guardrail {
MaxOutputTokens(u32),
MustCiteSources,
NoCodeExecution,
MaxToolCallsPerTurn(u32),
Custom {
name: String,
description: String,
},
}Expand description
Output constraints enforced after execution.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Implementations§
Source§impl Guardrail
impl Guardrail
Sourcepub fn validate(&self, metrics: &ExecutionMetrics) -> Result<(), PeError>
pub fn validate(&self, metrics: &ExecutionMetrics) -> Result<(), PeError>
Validate execution metrics against this guardrail.
Returns Ok(()) if the guardrail is satisfied, or
Err(PeError::GuardrailViolation) with details.
Content-analysis guardrails (MustCiteSources, NoCodeExecution) are deferred to Plan 014 — they return Ok(()) for now.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Guardrail
impl<'de> Deserialize<'de> for Guardrail
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 Guardrail
impl RefUnwindSafe for Guardrail
impl Send for Guardrail
impl Sync for Guardrail
impl Unpin for Guardrail
impl UnsafeUnpin for Guardrail
impl UnwindSafe for Guardrail
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