pub struct RelationshipDetector { /* private fields */ }Expand description
Detects relationships between experiences based on semantic similarity and ExperienceType heuristics.
Created via RelationshipDetector::new() with a RelationshipDetectorConfig.
Implementations§
Source§impl RelationshipDetector
impl RelationshipDetector
Sourcepub fn new(config: RelationshipDetectorConfig) -> Self
pub fn new(config: RelationshipDetectorConfig) -> Self
Create a new detector with the given configuration.
Sourcepub fn with_defaults() -> Self
pub fn with_defaults() -> Self
Create a new detector with default configuration.
Sourcepub fn config(&self) -> &RelationshipDetectorConfig
pub fn config(&self) -> &RelationshipDetectorConfig
Access the configuration.
Sourcepub async fn infer_relations(
&self,
experience: &Experience,
substrate: &dyn SubstrateProvider,
) -> Vec<NewExperienceRelation>
pub async fn infer_relations( &self, experience: &Experience, substrate: &dyn SubstrateProvider, ) -> Vec<NewExperienceRelation>
Find semantically similar experiences and create relations for high-similarity pairs.
Searches for the top 20 similar experiences in the same collective. For each pair
with similarity above auto_threshold, creates a NewExperienceRelation with
the similarity score as strength.
Returns the relations to be stored — the caller is responsible for calling
substrate.store_relation() and emitting events.
Auto Trait Implementations§
impl Freeze for RelationshipDetector
impl RefUnwindSafe for RelationshipDetector
impl Send for RelationshipDetector
impl Sync for RelationshipDetector
impl Unpin for RelationshipDetector
impl UnsafeUnpin for RelationshipDetector
impl UnwindSafe for RelationshipDetector
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
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more