pub struct LiteLLM { /* private fields */ }Implementations§
Source§impl LiteLLM
impl LiteLLM
pub fn new() -> Result<Self>
pub fn with_default_provider(self, provider: impl Into<String>) -> Self
pub fn with_provider( self, name: impl Into<String>, config: ProviderConfig, ) -> Self
pub fn with_client(self, client: Client) -> Self
pub fn registry(&self) -> &Registry
pub async fn completion(&self, req: ChatRequest) -> Result<ChatResponse>
pub async fn stream_completion(&self, req: ChatRequest) -> Result<ChatStream>
pub async fn embedding( &self, req: EmbeddingRequest, ) -> Result<EmbeddingResponse>
pub async fn image_generation(&self, req: ImageRequest) -> Result<ImageResponse>
pub async fn image_editing( &self, req: ImageEditRequest, ) -> Result<ImageResponse>
pub async fn video_generation(&self, req: VideoRequest) -> Result<VideoResponse>
pub fn estimate_cost( &self, model: &str, input_tokens: u32, output_tokens: u32, ) -> Option<f64>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LiteLLM
impl !RefUnwindSafe for LiteLLM
impl Send for LiteLLM
impl Sync for LiteLLM
impl Unpin for LiteLLM
impl !UnwindSafe for LiteLLM
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