pub struct Read {
pub workspace: Arc<dyn Workspace>,
pub base: Option<PathBuf>,
pub confine: bool,
pub seen: Seen,
}Expand description
Reads a text file’s lines as they are, or a PNG, JPEG, GIF or WebP
image as a line saying what it is and the image. Publishes the file it
read (FilesRead), by its resolved path, with the hash
of the bytes it read and, for a text file, the lines it showed, and,
when lines after those were left out, OutputCut.
Fields§
§workspace: Arc<dyn Workspace>Where the file is read.
base: Option<PathBuf>The directory a relative path is read from; None is the
workspace’s working directory.
confine: boolWhether a path that resolves outside base is refused, before
anything is read.
seen: SeenWhere each file read is noted, for an Edit given
the same to tell whether a file changed since.
Trait Implementations§
Source§impl Tool for Read
impl Tool for Read
Source§type Output = ToolOutput
type Output = ToolOutput
Output convertible into Rig’s canonical model presentation. Read more
Source§type Error = ToolExecutionError
type Error = ToolExecutionError
Typed error returned by direct calls to this tool. Read more
Source§fn description(&self) -> String
fn description(&self) -> String
Model-facing description.
Source§fn parameters(&self) -> Value
fn parameters(&self) -> Value
JSON Schema for arguments.
Source§fn annotations(&self) -> ToolAnnotations
fn annotations(&self) -> ToolAnnotations
What calling the tool does to the world, for the host’s policies
(approval, plan mode, which calls run side by side). Nothing is
stated by default, which reads as the protocol’s defaults
(
ToolAnnotations).Source§fn footprint(&self, args: &ReadArgs) -> Touches
fn footprint(&self, args: &ReadArgs) -> Touches
What a call with
args may read and change, so a host runs the
calls of one reply that touch different things side by side. The
default reads it from the annotations: a
read-only tool reads anything, any other writes anything.Source§async fn call(
&self,
context: &mut ToolContext,
args: ReadArgs,
) -> Result<ToolOutput, ToolExecutionError>
async fn call( &self, context: &mut ToolContext, args: ReadArgs, ) -> Result<ToolOutput, ToolExecutionError>
Execute the tool.
Auto Trait Implementations§
impl !RefUnwindSafe for Read
impl !UnwindSafe for Read
impl Freeze for Read
impl Send for Read
impl Sync for Read
impl Unpin for Read
impl UnsafeUnpin for Read
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