pub struct ResponseExtractor { /* private fields */ }Implementations§
Source§impl ResponseExtractor
impl ResponseExtractor
pub fn new(store: Arc<dyn MemoryStore>, config: ExtractionConfig) -> Self
pub fn with_llm_extractor(self, extractor: Arc<dyn LlmExtractor>) -> Self
Sourcepub fn with_lazy_llm_extractor(self, extractor: LazyLlmExtractor) -> Self
pub fn with_lazy_llm_extractor(self, extractor: LazyLlmExtractor) -> Self
Production wiring: hand over a lazily-probed holder instead of a
one-shot startup result (see LazyLlmExtractor).
Sourcepub async fn extract_and_save(
&self,
response_text: &str,
agent_id: &str,
) -> ExtractionResult
pub async fn extract_and_save( &self, response_text: &str, agent_id: &str, ) -> ExtractionResult
Extract memories from an agent’s own response text and save to store as unreviewed (Inbox).
Sourcepub async fn extract_and_save_from_user(
&self,
user_text: &str,
agent_id: &str,
) -> ExtractionResult
pub async fn extract_and_save_from_user( &self, user_text: &str, agent_id: &str, ) -> ExtractionResult
Extract memories directly from the user’s own turn text. First-person
signal words (“我偏好”/“我喜欢”) match a user’s own statements about
themselves far more reliably than an assistant’s restatement of them,
so this path typically has higher recall than extract_and_save.
Sourcepub async fn extract_and_save_contextual(
&self,
user_text: Option<&str>,
response_text: &str,
agent_id: &str,
) -> ExtractionResult
pub async fn extract_and_save_contextual( &self, user_text: Option<&str>, response_text: &str, agent_id: &str, ) -> ExtractionResult
Extract from a paired user+assistant turn as one piece of context, rather than scanning each text independently for keyword signals. When an LLM extractor is configured, it sees both sides of the exchange together — recovering implicit preferences and cross-sentence references the line-by-line rule engine misses. Falls back to the rule-based per-text extraction (unchanged behavior) when no LLM extractor is configured, or if the LLM call fails — an LLM outage must never break the extraction pipeline.
Auto Trait Implementations§
impl !RefUnwindSafe for ResponseExtractor
impl !UnwindSafe for ResponseExtractor
impl Freeze for ResponseExtractor
impl Send for ResponseExtractor
impl Sync for ResponseExtractor
impl Unpin for ResponseExtractor
impl UnsafeUnpin for ResponseExtractor
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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> ⓘ
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> ⓘ
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