pub trait Deduplicator: Send + Sync {
// Required methods
fn check_duplicate(
&self,
content: &str,
namespace: Namespace,
) -> Result<DuplicateCheckResult>;
fn record_capture(&self, content_hash: &str, memory_id: &MemoryId);
}Expand description
Trait for deduplication checking.
Allows for different implementations (e.g., mock for testing).
Required Methods§
Sourcefn check_duplicate(
&self,
content: &str,
namespace: Namespace,
) -> Result<DuplicateCheckResult>
fn check_duplicate( &self, content: &str, namespace: Namespace, ) -> Result<DuplicateCheckResult>
Sourcefn record_capture(&self, content_hash: &str, memory_id: &MemoryId)
fn record_capture(&self, content_hash: &str, memory_id: &MemoryId)
Records a successful capture for recent-capture tracking.
§Arguments
content_hash- The SHA256 hash of the contentmemory_id- The ID of the captured memory
Implementors§
impl<E: Embedder + Send + Sync, V: VectorBackend + Send + Sync> Deduplicator for DeduplicationService<E, V>
Implementation of the Deduplicator trait.