pub struct QueryService { /* private fields */ }Implementations§
Source§impl QueryService
impl QueryService
pub fn new(llm: Arc<dyn LlmClient>, config: AgentConfig) -> Self
pub fn with_embedder( llm: Arc<dyn LlmClient>, config: AgentConfig, embedder: Arc<dyn EmbeddingService>, ) -> Self
pub async fn query( &self, question: &str, namespace_id: i64, memory_repo: &MemoryRepository, relation_repo: &MemoryRelationRepository<'_>, ) -> Result<QueryAnswer, AgentError>
pub async fn query_with_representation( &self, question: &str, request: WorkingRepresentationRequest, memory_repo: &MemoryRepository, _relation_repo: &MemoryRelationRepository<'_>, ) -> Result<QueryAnswer, AgentError>
Sourcepub async fn query_introspection(
&self,
question: &str,
namespace_id: i64,
memory_repo: &MemoryRepository,
) -> Result<QueryIntrospection, AgentError>
pub async fn query_introspection( &self, question: &str, namespace_id: i64, memory_repo: &MemoryRepository, ) -> Result<QueryIntrospection, AgentError>
Compute introspection for a query without calling the LLM.
Builds the working representation, runs ranking with excluded-candidate
capture, and fetches recent reflective inferences. Returns a
QueryIntrospection suitable for observability surfaces.
Sourcepub async fn introspection_with_representation(
&self,
request: &WorkingRepresentationRequest,
question: &str,
memory_repo: &MemoryRepository,
) -> Result<QueryIntrospection, AgentError>
pub async fn introspection_with_representation( &self, request: &WorkingRepresentationRequest, question: &str, memory_repo: &MemoryRepository, ) -> Result<QueryIntrospection, AgentError>
Introspection with a custom representation request.
Auto Trait Implementations§
impl Freeze for QueryService
impl !RefUnwindSafe for QueryService
impl Send for QueryService
impl Sync for QueryService
impl Unpin for QueryService
impl UnsafeUnpin for QueryService
impl !UnwindSafe for QueryService
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