pub struct Embedder { /* private fields */ }Implementations§
Source§impl Embedder
impl Embedder
pub fn new(config: &Config) -> Result<Self>
Sourcepub fn new_api_with_http_client(client: Client, api_key: &str) -> Result<Self>
pub fn new_api_with_http_client(client: Client, api_key: &str) -> Result<Self>
Create an embedder using the Gemini API backend with a pre-built HTTP client.
pub async fn test_api_key(&self) -> Result<()>
pub async fn embed_batch(&self, texts: &[String]) -> Result<Vec<Vec<f32>>>
pub async fn embed_single(&self, text: &str) -> Result<Vec<f32>>
pub fn dimensions(&self) -> usize
pub fn backend_name(&self) -> &str
Auto Trait Implementations§
impl Freeze for Embedder
impl !RefUnwindSafe for Embedder
impl Send for Embedder
impl Sync for Embedder
impl Unpin for Embedder
impl UnsafeUnpin for Embedder
impl !UnwindSafe for Embedder
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