pub struct ReadSkillResourceTool { /* private fields */ }Expand description
Tool for reading resource files from activated skill directories.
Only allows reading from skills that have been activated via activate_skill.
Rejects path traversal attempts for security.
Implementations§
Source§impl ReadSkillResourceTool
impl ReadSkillResourceTool
pub fn new(registry: Arc<RwLock<SkillRegistry>>) -> ReadSkillResourceTool
Sourcepub fn with_max_bytes(self, bytes: usize) -> ReadSkillResourceTool
pub fn with_max_bytes(self, bytes: usize) -> ReadSkillResourceTool
Set the maximum allowed resource file size in bytes.
Trait Implementations§
Source§impl Tool for ReadSkillResourceTool
impl Tool for ReadSkillResourceTool
Source§fn description(&self) -> &str
fn description(&self) -> &str
Human-readable tool description.
Source§fn parameters(&self) -> Value
fn parameters(&self) -> Value
JSON Schema describing accepted parameters.
Source§fn execute(
&self,
parameters: HashMap<String, Value>,
) -> Pin<Box<dyn Future<Output = Result<ToolResult, ReactError>> + Send + '_>>
fn execute( &self, parameters: HashMap<String, Value>, ) -> Pin<Box<dyn Future<Output = Result<ToolResult, ReactError>> + Send + '_>>
Execute the tool with untyped JSON parameters.
Source§fn validate_parameters(
&self,
_params: &HashMap<String, Value>,
) -> Pin<Box<dyn Future<Output = Result<(), ReactError>> + Send + '_>>
fn validate_parameters( &self, _params: &HashMap<String, Value>, ) -> Pin<Box<dyn Future<Output = Result<(), ReactError>> + Send + '_>>
Validate parameters before execution.
Source§fn permissions(&self) -> Vec<ToolPermission>
fn permissions(&self) -> Vec<ToolPermission>
Permissions required to invoke this tool.
Source§fn risk_level(&self) -> ToolRiskLevel
fn risk_level(&self) -> ToolRiskLevel
Risk level of this tool. Dangerous tools require explicit approval.
Auto Trait Implementations§
impl Freeze for ReadSkillResourceTool
impl !RefUnwindSafe for ReadSkillResourceTool
impl Send for ReadSkillResourceTool
impl Sync for ReadSkillResourceTool
impl Unpin for ReadSkillResourceTool
impl UnsafeUnpin for ReadSkillResourceTool
impl !UnwindSafe for ReadSkillResourceTool
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> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<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> 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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request