pub struct JsonPathTool { /* private fields */ }Expand description
JSON Path tool for extracting values from JSON.
Supports simple dot-notation paths like “user.name” and array access “[0]”.
§Example
ⓘ
use vex_llm::JsonPathTool;
use vex_llm::Tool;
let jp = JsonPathTool::new();
let result = jp.execute(json!({
"data": {"user": {"name": "Alice"}},
"path": "user.name"
})).await?;
println!("{}", result["value"]); // "Alice"Implementations§
Source§impl JsonPathTool
impl JsonPathTool
Trait Implementations§
Source§impl Default for JsonPathTool
impl Default for JsonPathTool
Source§impl Tool for JsonPathTool
impl Tool for JsonPathTool
Source§fn definition(&self) -> &ToolDefinition
fn definition(&self) -> &ToolDefinition
Returns the tool’s metadata (name, description, schema)
Source§fn capabilities(&self) -> Vec<Capability>
fn capabilities(&self) -> Vec<Capability>
Required capabilities for sandboxing. Read more
Source§fn validate(&self, args: &Value) -> Result<(), ToolError>
fn validate(&self, args: &Value) -> Result<(), ToolError>
Validate arguments before execution. Read more
Source§fn execute<'life0, 'async_trait>(
&'life0 self,
args: Value,
) -> Pin<Box<dyn Future<Output = Result<Value, ToolError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn execute<'life0, 'async_trait>(
&'life0 self,
args: Value,
) -> Pin<Box<dyn Future<Output = Result<Value, ToolError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Execute the tool with given arguments. Read more
Source§fn is_available(&self) -> bool
fn is_available(&self) -> bool
Whether the tool is currently available. Read more
Auto Trait Implementations§
impl Freeze for JsonPathTool
impl RefUnwindSafe for JsonPathTool
impl Send for JsonPathTool
impl Sync for JsonPathTool
impl Unpin for JsonPathTool
impl UnwindSafe for JsonPathTool
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more