pub struct AgentContextIntegration<'a> { /* private fields */ }Expand description
Integration between CONTEXT SELECT and AgentContext
Provides:
- Session variable resolution
- Permission checking for data access
- Audit logging of context queries
- Budget integration via TokenBudgetEnforcer
- Vector search for SEARCH sections
- Embedding provider for text-to-vector search
Implementations§
Source§impl<'a> AgentContextIntegration<'a>
impl<'a> AgentContextIntegration<'a>
Sourcepub fn new(context: &'a mut AgentContext) -> Self
pub fn new(context: &'a mut AgentContext) -> Self
Create integration with an agent context
Sourcepub fn with_vector_index(
context: &'a mut AgentContext,
vector_index: Arc<dyn VectorIndex>,
) -> Self
pub fn with_vector_index( context: &'a mut AgentContext, vector_index: Arc<dyn VectorIndex>, ) -> Self
Create integration with a vector index for SEARCH operations
Sourcepub fn with_vector_and_embedding(
context: &'a mut AgentContext,
vector_index: Arc<dyn VectorIndex>,
embedding_provider: Arc<dyn EmbeddingProvider>,
) -> Self
pub fn with_vector_and_embedding( context: &'a mut AgentContext, vector_index: Arc<dyn VectorIndex>, embedding_provider: Arc<dyn EmbeddingProvider>, ) -> Self
Create integration with both vector index and embedding provider
Sourcepub fn set_embedding_provider(&mut self, provider: Arc<dyn EmbeddingProvider>)
pub fn set_embedding_provider(&mut self, provider: Arc<dyn EmbeddingProvider>)
Set the embedding provider for text-to-vector search
Sourcepub fn set_vector_index(&mut self, index: Arc<dyn VectorIndex>)
pub fn set_vector_index(&mut self, index: Arc<dyn VectorIndex>)
Set the vector index for SEARCH operations
Sourcepub fn execute(
&mut self,
query: &ContextSelectQuery,
) -> Result<ContextQueryResult, ContextQueryError>
pub fn execute( &mut self, query: &ContextSelectQuery, ) -> Result<ContextQueryResult, ContextQueryError>
Execute a CONTEXT SELECT query with agent context
Sourcepub fn execute_explain(
&mut self,
query: &ContextSelectQuery,
) -> Result<(ContextQueryResult, String), ContextQueryError>
pub fn execute_explain( &mut self, query: &ContextSelectQuery, ) -> Result<(ContextQueryResult, String), ContextQueryError>
Execute a CONTEXT SELECT with EXPLAIN output
Sourcepub fn get_session_context(&self) -> HashMap<String, String>
pub fn get_session_context(&self) -> HashMap<String, String>
Get session variables as context
Sourcepub fn set_variable(&mut self, name: &str, value: ContextValue)
pub fn set_variable(&mut self, name: &str, value: ContextValue)
Set a session variable
Sourcepub fn remaining_budget(&self) -> u64
pub fn remaining_budget(&self) -> u64
Get remaining token budget
Auto Trait Implementations§
impl<'a> !Freeze for AgentContextIntegration<'a>
impl<'a> !RefUnwindSafe for AgentContextIntegration<'a>
impl<'a> Send for AgentContextIntegration<'a>
impl<'a> Sync for AgentContextIntegration<'a>
impl<'a> Unpin for AgentContextIntegration<'a>
impl<'a> UnsafeUnpin for AgentContextIntegration<'a>
impl<'a> !UnwindSafe for AgentContextIntegration<'a>
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