pub struct MemoryTool { /* private fields */ }Expand description
The built-in memory tool, bound to one store and scope.
The agent adds it to a run on its own when memory is configured; you rarely build one by hand.
Implementations§
Source§impl MemoryTool
impl MemoryTool
Sourcepub fn new(store: Arc<dyn MemoryStore>, scope: MemoryScope) -> Self
pub fn new(store: Arc<dyn MemoryStore>, scope: MemoryScope) -> Self
Bind the tool to a store and scope.
Trait Implementations§
Source§impl Clone for MemoryTool
impl Clone for MemoryTool
Source§impl Debug for MemoryTool
impl Debug for MemoryTool
Source§impl Tool for MemoryTool
impl Tool for MemoryTool
Source§fn description(&self) -> &'static str
fn description(&self) -> &'static str
What the tool does, shown to the model.
Source§fn input_schema(&self) -> Value
fn input_schema(&self) -> Value
JSON Schema for the tool’s input object.
Source§fn effect(&self) -> ToolEffect
fn effect(&self) -> ToolEffect
What the tool can change. Defaults to
ToolEffect::Write: a tool
is trusted with less only when it says so.Source§fn execute<'a>(
&'a self,
input: Value,
_ctx: &'a ToolContext,
) -> Pin<Box<dyn Future<Output = Result<Value, AgentError>> + Send + 'a>>
fn execute<'a>( &'a self, input: Value, _ctx: &'a ToolContext, ) -> Pin<Box<dyn Future<Output = Result<Value, AgentError>> + Send + 'a>>
Run the tool against decoded JSON arguments.
Source§fn definition(&self) -> ToolDefinition
fn definition(&self) -> ToolDefinition
Bundle the metadata the model sees into a
ToolDefinition.Auto Trait Implementations§
impl !RefUnwindSafe for MemoryTool
impl !UnwindSafe for MemoryTool
impl Forget for MemoryTool
impl Freeze for MemoryTool
impl Send for MemoryTool
impl Sync for MemoryTool
impl Unpin for MemoryTool
impl UnsafeUnpin for MemoryTool
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> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> Scoped for T
impl<T> Scoped for T
Source§fn scope(ctx: &PolicyContext) -> ScopeQuery<'_, Self>
fn scope(ctx: &PolicyContext) -> ScopeQuery<'_, Self>
Open a deferred
ScopeQuery for this type. Resolves the
registered scope at .load() time, not here.