pub struct ReadTool { /* private fields */ }Expand description
Agent tool that reads text and supported image files.
Implementations§
Source§impl ReadTool
impl ReadTool
Sourcepub fn with_options(options: ReadToolOptions) -> Self
pub fn with_options(options: ReadToolOptions) -> Self
Creates a read tool from explicit options.
Sourcepub fn parameters_schema() -> Value
pub fn parameters_schema() -> Value
Returns the JSON Schema for read arguments (normalized TypeBox shape).
Sourcepub fn parse_input(
args: &Map<String, Value>,
) -> Result<ReadToolInput, ToolError>
pub fn parse_input( args: &Map<String, Value>, ) -> Result<ReadToolInput, ToolError>
Validates raw tool arguments into ReadToolInput.
§Errors
Returns ToolError when required fields are missing or mistyped.
Trait Implementations§
Source§impl AgentTool for ReadTool
impl AgentTool for ReadTool
Source§fn description(&self) -> &str
fn description(&self) -> &str
Human-readable tool description.
Source§fn parameters(&self) -> &Value
fn parameters(&self) -> &Value
JSON Schema for tool arguments.
Source§fn validate_arguments(
&self,
args: &Map<String, Value>,
) -> Result<Map<String, Value>, ToolError>
fn validate_arguments( &self, args: &Map<String, Value>, ) -> Result<Map<String, Value>, ToolError>
Validates prepared arguments for this tool. Read more
Source§fn execute(
&self,
_tool_call_id: &str,
args: Map<String, Value>,
cancel: CancellationToken,
_updates: ToolUpdates,
) -> BoxFuture<'static, Result<AgentToolResult, ToolError>>
fn execute( &self, _tool_call_id: &str, args: Map<String, Value>, cancel: CancellationToken, _updates: ToolUpdates, ) -> BoxFuture<'static, Result<AgentToolResult, ToolError>>
Executes the tool call. Read more
Source§fn execution_mode(&self) -> Option<ToolExecutionMode>
fn execution_mode(&self) -> Option<ToolExecutionMode>
Optional per-tool execution mode override. Read more
Auto Trait Implementations§
impl Freeze for ReadTool
impl RefUnwindSafe for ReadTool
impl Send for ReadTool
impl Sync for ReadTool
impl Unpin for ReadTool
impl UnsafeUnpin for ReadTool
impl UnwindSafe for ReadTool
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 moreCreates a shared type from an unshared type.