pub struct LoadMemoryTool { /* private fields */ }Expand description
Tool that searches the agent’s memory store.
When the model needs to recall previously stored information, it can call
this tool with a search query. If a MemoryService is wired via
with_memory_service, the call is
delegated to it; otherwise a placeholder response is returned (matching the
“runtime intercepts the call” model).
Implementations§
Source§impl LoadMemoryTool
impl LoadMemoryTool
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new load memory tool with no memory service wired.
Without a service, call returns a placeholder
indicating the query was received (the runtime is expected to intercept).
Sourcepub fn with_memory_service(self, service: Arc<dyn MemoryService>) -> Self
pub fn with_memory_service(self, service: Arc<dyn MemoryService>) -> Self
Wire a MemoryService that this tool delegates searches to.
Sourcepub fn with_session_id(self, session_id: impl Into<String>) -> Self
pub fn with_session_id(self, session_id: impl Into<String>) -> Self
Set the session ID used to scope memory searches.
Trait Implementations§
Source§impl Clone for LoadMemoryTool
impl Clone for LoadMemoryTool
Source§fn clone(&self) -> LoadMemoryTool
fn clone(&self) -> LoadMemoryTool
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LoadMemoryTool
impl Debug for LoadMemoryTool
Source§impl Default for LoadMemoryTool
impl Default for LoadMemoryTool
Source§fn default() -> LoadMemoryTool
fn default() -> LoadMemoryTool
Returns the “default value” for a type. Read more
Source§impl ToolFunction for LoadMemoryTool
impl ToolFunction for LoadMemoryTool
Source§fn description(&self) -> &str
fn description(&self) -> &str
Human-readable description of what this tool does.
Source§fn parameters(&self) -> Option<Value>
fn parameters(&self) -> Option<Value>
JSON Schema for the tool’s input parameters, or
None if parameterless.Source§fn call<'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 call<'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 the given arguments and return the result.
Source§fn requires_confirmation(&self) -> bool
fn requires_confirmation(&self) -> bool
Whether this tool must be confirmed before it runs. Defaults to
false. Read moreSource§fn confirmation_message(&self) -> Option<&str>
fn confirmation_message(&self) -> Option<&str>
Optional hint shown when confirmation is requested.
Auto Trait Implementations§
impl Freeze for LoadMemoryTool
impl !RefUnwindSafe for LoadMemoryTool
impl Send for LoadMemoryTool
impl Sync for LoadMemoryTool
impl Unpin for LoadMemoryTool
impl !UnwindSafe for LoadMemoryTool
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