pub struct SemanticQuery;Expand description
Builds SphereQL Regions from semantic constraints on embeddings.
Implementations§
Source§impl SemanticQuery
impl SemanticQuery
Sourcepub fn within_angle<P: Projection>(
query: &Embedding,
projection: &P,
max_angular_distance: f64,
) -> Region
pub fn within_angle<P: Projection>( query: &Embedding, projection: &P, max_angular_distance: f64, ) -> Region
Spherical cap: all points within max_angular_distance radians of the query.
Sourcepub fn above_similarity<P: Projection>(
query: &Embedding,
projection: &P,
min_similarity: f64,
) -> Region
pub fn above_similarity<P: Projection>( query: &Embedding, projection: &P, min_similarity: f64, ) -> Region
Spherical cap from a cosine similarity threshold. cos_sim >= threshold ↔ angular_distance <= arccos(threshold).
Sourcepub fn in_shell(inner: f64, outer: f64) -> Region
pub fn in_shell(inner: f64, outer: f64) -> Region
Radial shell: embeddings whose projected radius falls in [inner, outer].
§Panics
Panics if inner > outer or either bound is negative. Both are
caller contracts; use Shell::new directly if you need a Result.
Sourcepub fn similar_in_shell<P: Projection>(
query: &Embedding,
projection: &P,
min_similarity: f64,
shell_inner: f64,
shell_outer: f64,
) -> Region
pub fn similar_in_shell<P: Projection>( query: &Embedding, projection: &P, min_similarity: f64, shell_inner: f64, shell_outer: f64, ) -> Region
Intersection of a similarity cap with a radial shell. “Semantically similar AND within a magnitude/metadata range.”
Auto Trait Implementations§
impl Freeze for SemanticQuery
impl RefUnwindSafe for SemanticQuery
impl Send for SemanticQuery
impl Sync for SemanticQuery
impl Unpin for SemanticQuery
impl UnsafeUnpin for SemanticQuery
impl UnwindSafe for SemanticQuery
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