pub struct Native {
pub item: Value,
pub fingerprint: Fingerprint,
}Expand description
One provider item, verbatim in its API’s JSON shape, beside the canonical block (or message) it was decoded to.
fingerprint is the canonical form’s at decode time. When the block is
edited its fingerprint changes, the item is stale, and encoders rebuild
the wire item from the canonical fields instead.
Fields§
§item: ValueThe provider item.
fingerprint: FingerprintThe fingerprint of the canonical form the item was decoded to.
Implementations§
Source§impl Native
impl Native
Sourcepub fn reasoning_blob(&self, api: &Api) -> Option<Blob<'_>>
pub fn reasoning_blob(&self, api: &Api) -> Option<Blob<'_>>
The opaque part of this item when api, the wire that made it, keeps
one there: a reasoning signature or encrypted reasoning, which only
that provider can read and which it may refuse once anything around
it changed. None for an item with none, or a wire rig does not know
blobs of.
use rig_core::message::{Api, Fingerprint, Native};
let native = Native {
item: serde_json::json!({"type": "thinking", "thinking": "plan", "signature": "c2ln"}),
fingerprint: Fingerprint::of(&"plan"),
};
let api = Api::from_static("anthropic.messages");
assert_eq!(native.reasoning_blob(&api).map(|blob| blob.value), Some("c2ln"));Trait Implementations§
Source§impl<'de> Deserialize<'de> for Native
impl<'de> Deserialize<'de> for Native
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Native, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Native, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for Native
impl Serialize for Native
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
impl StructuralPartialEq for Native
Auto Trait Implementations§
impl Freeze for Native
impl RefUnwindSafe for Native
impl Send for Native
impl Sync for Native
impl Unpin for Native
impl UnsafeUnpin for Native
impl UnwindSafe for Native
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoToolOutput for Twhere
T: Serialize + 'static,
impl<T> IntoToolOutput for Twhere
T: Serialize + 'static,
Source§fn into_tool_output(self) -> Result<ToolOutput, ToolExecutionError>
fn into_tool_output(self) -> Result<ToolOutput, ToolExecutionError>
Convert this value without routing structured data through a string.