pub struct ContextQueryBuilder { /* private fields */ }Expand description
Builder for constructing CONTEXT SELECT queries programmatically
Implementations§
Source§impl ContextQueryBuilder
impl ContextQueryBuilder
Sourcepub fn from_session(self, session_id: &str) -> Self
pub fn from_session(self, session_id: &str) -> Self
Set session reference
Sourcepub fn from_agent(self, agent_id: &str) -> Self
pub fn from_agent(self, agent_id: &str) -> Self
Set agent reference
Sourcepub fn with_token_limit(self, limit: usize) -> Self
pub fn with_token_limit(self, limit: usize) -> Self
Set token limit
Sourcepub fn include_schema(self, include: bool) -> Self
pub fn include_schema(self, include: bool) -> Self
Include schema
Sourcepub fn format(self, format: OutputFormat) -> Self
pub fn format(self, format: OutputFormat) -> Self
Set output format
Sourcepub fn truncation(self, strategy: TruncationStrategy) -> Self
pub fn truncation(self, strategy: TruncationStrategy) -> Self
Set truncation strategy
Sourcepub fn last(self, name: &str, priority: i32, count: usize, table: &str) -> Self
pub fn last(self, name: &str, priority: i32, count: usize, table: &str) -> Self
Add a LAST section
Sourcepub fn search(
self,
name: &str,
priority: i32,
collection: &str,
query_var: &str,
top_k: usize,
) -> Self
pub fn search( self, name: &str, priority: i32, collection: &str, query_var: &str, top_k: usize, ) -> Self
Add a SEARCH section
Sourcepub fn build(self) -> ContextSelectQuery
pub fn build(self) -> ContextSelectQuery
Build the query
Auto Trait Implementations§
impl Freeze for ContextQueryBuilder
impl RefUnwindSafe for ContextQueryBuilder
impl Send for ContextQueryBuilder
impl Sync for ContextQueryBuilder
impl Unpin for ContextQueryBuilder
impl UnsafeUnpin for ContextQueryBuilder
impl UnwindSafe for ContextQueryBuilder
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