pub enum ToolArguments {
Parsed(Value),
RawJsonString(String),
Invalid {
raw: String,
error: String,
},
}Expand description
Tool-call argument state preserved across provider mapping, retries, and replay.
Variants§
Parsed(Value)
Parsed JSON arguments ready for execution.
RawJsonString(String)
Raw JSON string preserved for delayed parsing or provider wire replay.
Invalid
Invalid JSON with original provider text and parser message.
Implementations§
Source§impl ToolArguments
impl ToolArguments
Sourcepub fn raw_json_string(raw: impl Into<String>) -> Self
pub fn raw_json_string(raw: impl Into<String>) -> Self
Build raw JSON string arguments.
Sourcepub fn invalid(raw: impl Into<String>, error: impl Into<String>) -> Self
pub fn invalid(raw: impl Into<String>, error: impl Into<String>) -> Self
Build invalid JSON arguments.
Sourcepub fn from_provider_value(value: &Value) -> Self
pub fn from_provider_value(value: &Value) -> Self
Parse provider argument payload while preserving invalid input.
Sourcepub fn execution_value(&self) -> Value
pub fn execution_value(&self) -> Value
JSON value used for local tool execution and output functions.
Sourcepub fn wire_json_string(&self) -> String
pub fn wire_json_string(&self) -> String
JSON string used in provider wire requests.
Sourcepub fn replay_value(&self) -> Value
pub fn replay_value(&self) -> Value
Replay/display value carrying state evidence.
Sourcepub const fn invalid_error(&self) -> Option<&str>
pub const fn invalid_error(&self) -> Option<&str>
Return the invalid parser error when present.
Trait Implementations§
Source§impl Clone for ToolArguments
impl Clone for ToolArguments
Source§fn clone(&self) -> ToolArguments
fn clone(&self) -> ToolArguments
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ToolArguments
impl Debug for ToolArguments
Source§impl Default for ToolArguments
impl Default for ToolArguments
Source§impl<'de> Deserialize<'de> for ToolArguments
impl<'de> Deserialize<'de> for ToolArguments
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 Eq for ToolArguments
Source§impl From<&str> for ToolArguments
impl From<&str> for ToolArguments
Source§impl From<String> for ToolArguments
impl From<String> for ToolArguments
Source§impl From<Value> for ToolArguments
impl From<Value> for ToolArguments
Source§impl PartialEq for ToolArguments
impl PartialEq for ToolArguments
Source§impl PartialEq<ToolArguments> for Value
impl PartialEq<ToolArguments> for Value
Source§impl PartialEq<Value> for ToolArguments
impl PartialEq<Value> for ToolArguments
Source§impl Serialize for ToolArguments
impl Serialize for ToolArguments
impl StructuralPartialEq for ToolArguments
Auto Trait Implementations§
impl Freeze for ToolArguments
impl RefUnwindSafe for ToolArguments
impl Send for ToolArguments
impl Sync for ToolArguments
impl Unpin for ToolArguments
impl UnsafeUnpin for ToolArguments
impl UnwindSafe for ToolArguments
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