pub struct Native {
pub item: Value,
pub fingerprint: Fingerprint,
pub baseline: Option<Value>,
pub edited: bool,
pub blob_slot: Option<Cow<'static, str>>,
}Expand description
One provider item, verbatim in its API’s JSON shape, beside the canonical block (or message) it was decoded to.
baseline compares calls after storage; other blocks and older records
use fingerprint. An edited block keeps its item for identity, but
encoders rebuild it from canonical fields.
Fields§
§item: ValueThe provider item.
fingerprint: FingerprintThe fingerprint of the canonical form the item was decoded to.
baseline: Option<Value>The original projection of a call containing floats. Floats stay
numeric; integers and strings carry text markers to preserve their type
and exact value. Other blocks and older records use fingerprint-only
validation. Construct this with super::AssistantContent::with_native.
Keep it unchanged when editing the call.
edited: boolWhether an edit was detected before serialization. A stored edit stays stale even if JSON parsing makes its numbers equal again.
blob_slot: Option<Cow<'static, str>>Where the item keeps its reasoning blob, as a JSON pointer such as
/signature, when it holds one. The reply fold sets it from the
wire’s ReplayTarget::blob_slots.
Implementations§
Source§impl Native
impl Native
Sourcepub fn reasoning_blob(&self) -> Option<Blob<'_>>
pub fn reasoning_blob(&self) -> Option<Blob<'_>>
The opaque part of this item, when it holds one: a reasoning signature or encrypted reasoning, which only the provider that made it can read and which it may refuse once anything around it changed.
use rig_core::message::{Fingerprint, Native};
let native = Native {
item: serde_json::json!({"type": "thinking", "thinking": "plan", "signature": "c2ln"}),
fingerprint: Fingerprint::of(&"plan"),
baseline: None,
edited: false,
blob_slot: Some("/signature".into()),
};
assert_eq!(native.reasoning_blob().map(|blob| blob.value), Some("c2ln"));