pub struct FastEmbedder { /* private fields */ }Expand description
A local FastEmbed text model, available with the fastembed feature.
The model is downloaded on first initialization and cached for offline use.
Ordinary git-vdb builds do not include FastEmbed or an ONNX runtime.
Implementations§
Source§impl FastEmbedder
impl FastEmbedder
Sourcepub fn try_new() -> Result<Self>
pub fn try_new() -> Result<Self>
Initializes FastEmbed’s default English model.
Examples found in repository?
examples/text_fastembed.rs (line 8)
5fn main() -> git_vdb::Result<()> {
6 let temporary = tempfile::TempDir::new()?;
7 let db = open(temporary.path().join("documents.git"))?;
8 let docs = db.text_collection("docs", FastEmbedder::try_new()?)?;
9 docs.upsert_documents([
10 Document::new("git", "Git-native vector search"),
11 Document::new("fruit", "Fresh fruit at the market"),
12 ])?;
13 let hits = docs.search_text("versioned database search", 1)?;
14 println!("{}", hits[0].id);
15 Ok(())
16}Sourcepub fn try_with_model(model: FastEmbedModel) -> Result<Self>
pub fn try_with_model(model: FastEmbedModel) -> Result<Self>
Initializes one of FastEmbed’s supported text models.
Sourcepub fn try_from_options(options: FastEmbedInitOptions) -> Result<Self>
pub fn try_from_options(options: FastEmbedInitOptions) -> Result<Self>
Initializes a model with explicit FastEmbed cache, runtime, and length options.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for FastEmbedder
impl RefUnwindSafe for FastEmbedder
impl Send for FastEmbedder
impl Sync for FastEmbedder
impl Unpin for FastEmbedder
impl UnsafeUnpin for FastEmbedder
impl UnwindSafe for FastEmbedder
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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