pub struct PreloadMemoryTool;Expand description
Tool that preloads relevant memories into the LLM request context.
Unlike crate::tools::LoadMemoryTool which is called by the model, this tool
automatically injects memories into the system instruction or context
before the model generates a response.
Implementations§
Source§impl PreloadMemoryTool
impl PreloadMemoryTool
Sourcepub fn process_llm_request(&self, request: &mut LlmRequest, memories: &[String])
pub fn process_llm_request(&self, request: &mut LlmRequest, memories: &[String])
Inject memory context into the LLM request.
Appends memory entries to the system instruction.
Trait Implementations§
Source§impl Clone for PreloadMemoryTool
impl Clone for PreloadMemoryTool
Source§fn clone(&self) -> PreloadMemoryTool
fn clone(&self) -> PreloadMemoryTool
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 PreloadMemoryTool
impl Debug for PreloadMemoryTool
Source§impl Default for PreloadMemoryTool
impl Default for PreloadMemoryTool
Source§fn default() -> PreloadMemoryTool
fn default() -> PreloadMemoryTool
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for PreloadMemoryTool
impl RefUnwindSafe for PreloadMemoryTool
impl Send for PreloadMemoryTool
impl Sync for PreloadMemoryTool
impl Unpin for PreloadMemoryTool
impl UnsafeUnpin for PreloadMemoryTool
impl UnwindSafe for PreloadMemoryTool
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