pub struct Untrusted<T>(pub T);Expand description
Value wrapper neutralizing delimiters and wrapping strings in <tool_output_quarantine>.
Neutralizes all known LLM control/turn/tool
delimiters (DELIMITER_RULES) and idempotently wraps
strings in a <tool_output_quarantine> XML envelope.
Can be used both as a tool return type (-> Untrusted<String>, -> Result<Untrusted<T>, E>)
and as a struct field wrapper (field: Untrusted<String>) for JSON and md-tmpl response
templates.
Tuple Fields§
§0: TImplementations§
Trait Implementations§
impl<T: Copy> Copy for Untrusted<T>
Source§impl<'de, T> Deserialize<'de> for Untrusted<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for Untrusted<T>where
T: Deserialize<'de>,
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
impl<T: Eq> Eq for Untrusted<T>
Source§impl From<Untrusted<ToolOutput>> for ToolOutput
impl From<Untrusted<ToolOutput>> for ToolOutput
Source§impl<T> JsonSchema for Untrusted<T>where
T: JsonSchema,
impl<T> JsonSchema for Untrusted<T>where
T: JsonSchema,
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl<T: Ord> Ord for Untrusted<T>
impl<T: Ord> Ord for Untrusted<T>
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl<T: PartialOrd> PartialOrd for Untrusted<T>
impl<T: PartialOrd> PartialOrd for Untrusted<T>
impl<T: PartialEq> StructuralPartialEq for Untrusted<T>
Auto Trait Implementations§
impl<T> Freeze for Untrusted<T>where
T: Freeze,
impl<T> RefUnwindSafe for Untrusted<T>where
T: RefUnwindSafe,
impl<T> Send for Untrusted<T>where
T: Send,
impl<T> Sync for Untrusted<T>where
T: Sync,
impl<T> Unpin for Untrusted<T>where
T: Unpin,
impl<T> UnsafeUnpin for Untrusted<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Untrusted<T>where
T: UnwindSafe,
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,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.