pub struct DecisionSnapshot {
pub metadata: SnapshotMetadata,
pub context: ExecutionContext,
pub function_name: String,
pub module_name: Option<String>,
pub inputs: Vec<Input>,
pub outputs: Vec<Output>,
pub model_parameters: Option<ModelParameters>,
pub execution_time_ms: Option<f64>,
pub error: Option<String>,
pub error_type: Option<String>,
pub tags: HashMap<String, String>,
pub custom_data: HashMap<String, Value>,
}Expand description
A single AI decision capture
Fields§
§metadata: SnapshotMetadata§context: ExecutionContext§function_name: String§module_name: Option<String>§inputs: Vec<Input>§outputs: Vec<Output>§model_parameters: Option<ModelParameters>§execution_time_ms: Option<f64>§error: Option<String>§error_type: Option<String>§custom_data: HashMap<String, Value>Implementations§
Source§impl DecisionSnapshot
impl DecisionSnapshot
pub fn new(function_name: impl Into<String>) -> Self
pub fn with_module(self, module_name: impl Into<String>) -> Self
pub fn with_context(self, context: ExecutionContext) -> Self
pub fn add_input(self, input: Input) -> Self
pub fn add_output(self, output: Output) -> Self
pub fn with_model_parameters(self, params: ModelParameters) -> Self
pub fn with_execution_time(self, time_ms: f64) -> Self
pub fn with_error( self, error: impl Into<String>, error_type: Option<String>, ) -> Self
pub fn add_tag(self, key: impl Into<String>, value: impl Into<String>) -> Self
pub fn add_custom_data(self, key: impl Into<String>, value: Value) -> Self
Sourcepub fn to_canonical_json(&self) -> Result<String, Error>
pub fn to_canonical_json(&self) -> Result<String, Error>
Serialize to canonical JSON for consistent checksums
Trait Implementations§
Source§impl Clone for DecisionSnapshot
impl Clone for DecisionSnapshot
Source§fn clone(&self) -> DecisionSnapshot
fn clone(&self) -> DecisionSnapshot
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 DecisionSnapshot
impl Debug for DecisionSnapshot
Source§impl<'de> Deserialize<'de> for DecisionSnapshot
impl<'de> Deserialize<'de> for DecisionSnapshot
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 DecisionSnapshot
impl PartialEq for DecisionSnapshot
Source§impl Serialize for DecisionSnapshot
impl Serialize for DecisionSnapshot
impl StructuralPartialEq for DecisionSnapshot
Auto Trait Implementations§
impl Freeze for DecisionSnapshot
impl RefUnwindSafe for DecisionSnapshot
impl Send for DecisionSnapshot
impl Sync for DecisionSnapshot
impl Unpin for DecisionSnapshot
impl UnwindSafe for DecisionSnapshot
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