pub struct GraphExtractor { /* private fields */ }Implementations§
Source§impl GraphExtractor
impl GraphExtractor
pub fn new( provider: AnyProvider, max_entities: usize, max_edges: usize, llm_timeout_secs: u64, ) -> Self
Sourcepub fn with_system_prompt(self, prompt: &'static str) -> Self
pub fn with_system_prompt(self, prompt: &'static str) -> Self
Override the system prompt used during extraction.
The default (when None) is the built-in conversational SYSTEM_PROMPT.
Pass Some(prompt) to select an alternative prompt such as
crate::graph::ingest::prompt::TECH_DOC_SYSTEM_PROMPT.
The type is &'static str — prompts must be compile-time constants.
This is a known MVP limitation (spec-067 critic C7); runtime-configurable
prompts will require a breaking change to this signature.
Sourcepub async fn extract(
&self,
message: &str,
context_messages: &[&str],
) -> Result<Option<ExtractionResult>, MemoryError>
pub async fn extract( &self, message: &str, context_messages: &[&str], ) -> Result<Option<ExtractionResult>, MemoryError>
Extract entities and relations from a message with surrounding context.
Returns None if the message is empty, extraction fails, or the LLM returns
unparseable output. Callers should treat None as a graceful degradation.
§Errors
Returns an error only for transport-level failures (network, auth).
JSON parse failures are logged and return Ok(None).
Auto Trait Implementations§
impl !Freeze for GraphExtractor
impl !RefUnwindSafe for GraphExtractor
impl !UnwindSafe for GraphExtractor
impl Send for GraphExtractor
impl Sync for GraphExtractor
impl Unpin for GraphExtractor
impl UnsafeUnpin for GraphExtractor
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
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request