pub struct EmbeddingEngine { /* private fields */ }Implementations§
Source§impl EmbeddingEngine
impl EmbeddingEngine
pub fn load(_model_dir: &Path) -> Result<Self>
Sourcepub fn load_default() -> Result<Self>
pub fn load_default() -> Result<Self>
Load from default model directory (~/.nebu-ctx/models/).
Sourcepub fn embed(&self, text: &str) -> Result<Vec<f32>>
pub fn embed(&self, text: &str) -> Result<Vec<f32>>
Generate an embedding vector for a single text.
Sourcepub fn embed_batch(&self, texts: &[&str]) -> Result<Vec<Vec<f32>>>
pub fn embed_batch(&self, texts: &[&str]) -> Result<Vec<Vec<f32>>>
Generate embedding vectors for multiple texts.
pub fn dimensions(&self) -> usize
Sourcepub fn model_directory() -> PathBuf
pub fn model_directory() -> PathBuf
Resolve the model directory (respects NEBU_CTX_MODELS_DIR env).
Sourcepub fn is_available() -> bool
pub fn is_available() -> bool
Check if the model files are present and loadable.
Auto Trait Implementations§
impl Freeze for EmbeddingEngine
impl RefUnwindSafe for EmbeddingEngine
impl Send for EmbeddingEngine
impl Sync for EmbeddingEngine
impl Unpin for EmbeddingEngine
impl UnsafeUnpin for EmbeddingEngine
impl UnwindSafe for EmbeddingEngine
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