pub struct OpenRouterClient { /* private fields */ }Implementations§
Source§impl OpenRouterClient
impl OpenRouterClient
pub fn new( api_key: SecretBox<String>, model: String, dim: usize, ) -> Result<Self, AppError>
pub fn default_input_type(&self) -> Option<&'static str>
pub async fn embed_single( &self, text: &str, input_type: Option<&str>, ) -> Result<Vec<f32>, AppError>
pub async fn embed_batch( &self, texts: &[&str], input_type: Option<&str>, ) -> Result<Vec<Vec<f32>>, AppError>
Auto Trait Implementations§
impl !RefUnwindSafe for OpenRouterClient
impl !UnwindSafe for OpenRouterClient
impl Freeze for OpenRouterClient
impl Send for OpenRouterClient
impl Sync for OpenRouterClient
impl Unpin for OpenRouterClient
impl UnsafeUnpin for OpenRouterClient
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<T> ErasedDestructor for Twhere
T: 'static,
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