pub struct EmbeddingWorker<'a> { /* private fields */ }Expand description
Embedding worker for one file.
Implementations§
Source§impl<'a> EmbeddingWorker<'a>
impl<'a> EmbeddingWorker<'a>
Sourcepub fn with_mock(catalog: &'a Catalog, cache: &'a CacheService) -> Self
pub fn with_mock(catalog: &'a Catalog, cache: &'a CacheService) -> Self
Use the mock model (tests, or when no real model is installed).
Sourcepub fn with_model(
catalog: &'a Catalog,
cache: &'a CacheService,
model: Box<dyn EmbeddingModel>,
model_id: ModelId,
) -> Self
pub fn with_model( catalog: &'a Catalog, cache: &'a CacheService, model: Box<dyn EmbeddingModel>, model_id: ModelId, ) -> Self
Use a specific embedding model (real or mock).
Supply a stable model_id string for registry lookup
(e.g. "mock_mock-v1" or "embedding_multilingual-e5-small-v1").
Sourcepub fn run(&self, file_id: &FileId) -> OrbokResult<()>
pub fn run(&self, file_id: &FileId) -> OrbokResult<()>
Embed all active chunks of a file and persist vectors.
pub fn model_id(&self) -> &ModelId
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for EmbeddingWorker<'a>
impl<'a> !UnwindSafe for EmbeddingWorker<'a>
impl<'a> Freeze for EmbeddingWorker<'a>
impl<'a> Send for EmbeddingWorker<'a>
impl<'a> Sync for EmbeddingWorker<'a>
impl<'a> Unpin for EmbeddingWorker<'a>
impl<'a> UnsafeUnpin for EmbeddingWorker<'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