pub enum LLMBackend {
OpenAI(OpenAIBackend),
Anthropic(AnthropicBackend),
GenericApi(GenericApiBackend),
}Variants§
Implementations§
Source§impl LLMBackend
impl LLMBackend
pub async fn clear_cache( self: &Arc<LLMBackend>, ) -> Result<CompletionResponse, CompletionError>
pub async fn set_cache( self: &Arc<LLMBackend>, prompt: &LLMPrompt, ) -> Result<CompletionResponse, CompletionError>
pub fn new_prompt(&self) -> LLMPrompt
pub fn get_total_prompt_tokens(&self, prompt: &LLMPrompt) -> Result<u64, Error>
pub fn model_id(&self) -> &str
pub fn model_ctx_size(&self) -> u64
pub fn inference_ctx_size(&self) -> u64
pub fn tokenizer(&self) -> &Arc<Tokenizer>
pub fn build_logit_bias( &self, logit_bias: &mut Option<LogitBias>, ) -> Result<(), Error>
pub fn openai(&self) -> Result<&OpenAIBackend, Error>
pub fn anthropic(&self) -> Result<&AnthropicBackend, Error>
pub fn generic_api(&self) -> Result<&GenericApiBackend, Error>
pub fn shutdown(&self)
Auto Trait Implementations§
impl !RefUnwindSafe for LLMBackend
impl !UnwindSafe for LLMBackend
impl Freeze for LLMBackend
impl Send for LLMBackend
impl Sync for LLMBackend
impl Unpin for LLMBackend
impl UnsafeUnpin for LLMBackend
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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