pub struct HitlPolicy {
pub gated_kinds: Vec<ProposedContentKind>,
pub confidence_threshold: Option<f32>,
pub gated_agent_ids: Vec<String>,
pub timeout: TimeoutPolicy,
}Expand description
Policy controlling when HITL approval is required.
Can be configured per-workspace or per-agent. A proposal triggers HITL if ANY of the configured conditions match.
Fields§
§gated_kinds: Vec<ProposedContentKind>Which proposal content kinds require HITL approval. Empty means no kind-based gating.
confidence_threshold: Option<f32>Confidence threshold: proposals below this trigger HITL.
None means no confidence-based gating.
gated_agent_ids: Vec<String>Suggestor IDs whose proposals always require HITL. Empty means no agent-based gating.
timeout: TimeoutPolicyTimeout behavior when human doesn’t respond.
Implementations§
Source§impl HitlPolicy
impl HitlPolicy
Sourcepub fn gate_all() -> HitlPolicy
pub fn gate_all() -> HitlPolicy
Create a policy that gates all proposals (strictest).
Sourcepub fn for_kinds(kinds: Vec<ProposedContentKind>) -> HitlPolicy
pub fn for_kinds(kinds: Vec<ProposedContentKind>) -> HitlPolicy
Create a policy that gates specific content kinds.
Sourcepub fn requires_approval(
&self,
proposal: &Proposal<Draft>,
agent_id: &str,
) -> bool
pub fn requires_approval( &self, proposal: &Proposal<Draft>, agent_id: &str, ) -> bool
Check if a proposal requires HITL approval under this policy.
Sourcepub fn with_timeout(self, timeout: TimeoutPolicy) -> HitlPolicy
pub fn with_timeout(self, timeout: TimeoutPolicy) -> HitlPolicy
Set custom timeout policy.
Trait Implementations§
Source§impl Clone for HitlPolicy
impl Clone for HitlPolicy
Source§fn clone(&self) -> HitlPolicy
fn clone(&self) -> HitlPolicy
Returns a duplicate of the value. Read more
1.0.0 · 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 HitlPolicy
impl Debug for HitlPolicy
Source§impl<'de> Deserialize<'de> for HitlPolicy
impl<'de> Deserialize<'de> for HitlPolicy
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<HitlPolicy, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<HitlPolicy, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for HitlPolicy
impl Serialize for HitlPolicy
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for HitlPolicy
impl RefUnwindSafe for HitlPolicy
impl Send for HitlPolicy
impl Sync for HitlPolicy
impl Unpin for HitlPolicy
impl UnsafeUnpin for HitlPolicy
impl UnwindSafe for HitlPolicy
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