pub enum LLMBackend {
OpenAI,
Anthropic,
Ollama,
DeepSeek,
XAI,
Phind,
Google,
Groq,
AzureOpenAI,
OpenRouter,
}Expand description
Supported LLM backend providers.
Variants§
OpenAI
OpenAI API provider (GPT-3, GPT-4, etc.)
Anthropic
Anthropic API provider (Claude models)
Ollama
Ollama local LLM provider for self-hosted models
DeepSeek
DeepSeek API provider for their LLM models
XAI
X.AI (formerly Twitter) API provider
Phind
Phind API provider for code-specialized models
Google Gemini API provider
Groq
Groq API provider
AzureOpenAI
Azure OpenAI API provider
OpenRouter
OpenRouter API provider for various models
Trait Implementations§
Source§impl Clone for LLMBackend
impl Clone for LLMBackend
Source§fn clone(&self) -> LLMBackend
fn clone(&self) -> LLMBackend
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LLMBackend
impl Debug for LLMBackend
Source§impl FromStr for LLMBackend
Implements string parsing for LLMBackend enum.
impl FromStr for LLMBackend
Implements string parsing for LLMBackend enum.
Converts a string representation of a backend provider name into the corresponding LLMBackend variant. The parsing is case-insensitive.
§Arguments
s- The string to parse
§Returns
Ok(LLMBackend)- The corresponding backend variant if validErr(LLMError)- An error if the string doesn’t match any known backend
§Examples
use std::str::FromStr;
use autoagents_llm::builder::LLMBackend;
let backend = LLMBackend::from_str("openai").unwrap();
assert!(matches!(backend, LLMBackend::OpenAI));
let err = LLMBackend::from_str("invalid").unwrap_err();
assert!(err.to_string().contains("Unknown LLM backend"));Auto Trait Implementations§
impl Freeze for LLMBackend
impl RefUnwindSafe for LLMBackend
impl Send for LLMBackend
impl Sync for LLMBackend
impl Unpin for LLMBackend
impl UnwindSafe 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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