pub struct AiOutputEnvelope {
pub primary_output: String,
pub confidence: f64,
pub confidence_type: ConfidenceType,
pub escalate: bool,
pub reasoning: Option<String>,
}Expand description
Structured output a contract-bound AI node must return (RAO node-contract
expected_output). Anything outside this schema is a node failure.
Fields§
§primary_output: String§confidence: f64§confidence_type: ConfidenceType§escalate: bool§reasoning: Option<String>Implementations§
Source§impl AiOutputEnvelope
impl AiOutputEnvelope
Sourcepub fn from_value(value: &Value) -> Result<Self, ContractError>
pub fn from_value(value: &Value) -> Result<Self, ContractError>
Strictly validate a parsed model output against the envelope schema.
Missing fields, wrong types, or an out-of-range confidence are
ContractError::SchemaViolations - failed nodes, not degraded trust.
Sourcepub fn json_schema() -> Value
pub fn json_schema() -> Value
JSON Schema for the envelope, used both as a hard response_schema
where the provider supports it and inside the system instruction.
Trait Implementations§
Source§impl Clone for AiOutputEnvelope
impl Clone for AiOutputEnvelope
Source§fn clone(&self) -> AiOutputEnvelope
fn clone(&self) -> AiOutputEnvelope
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 AiOutputEnvelope
impl Debug for AiOutputEnvelope
Source§impl<'de> Deserialize<'de> for AiOutputEnvelope
impl<'de> Deserialize<'de> for AiOutputEnvelope
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
Source§impl PartialEq for AiOutputEnvelope
impl PartialEq for AiOutputEnvelope
Source§impl Serialize for AiOutputEnvelope
impl Serialize for AiOutputEnvelope
impl StructuralPartialEq for AiOutputEnvelope
Auto Trait Implementations§
impl Freeze for AiOutputEnvelope
impl RefUnwindSafe for AiOutputEnvelope
impl Send for AiOutputEnvelope
impl Sync for AiOutputEnvelope
impl Unpin for AiOutputEnvelope
impl UnsafeUnpin for AiOutputEnvelope
impl UnwindSafe for AiOutputEnvelope
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