pub enum ApiProvider {
OpenAi,
Groq,
Cohere,
Replicate,
Anthropic,
Ollama,
Dummy,
}
Variants§
OpenAi
Groq
Cohere
Replicate
Anthropic
Ollama
Dummy
for test
- doesn’t require api key
- needs no network
Implementations§
source§impl ApiProvider
impl ApiProvider
pub fn as_str(&self) -> &'static str
pub fn get_chat_api_url(&self) -> Option<&'static str>
pub fn get_image_create_api_url(&self, model_kind: ImageModel) -> Option<String>
pub fn get_image_get_api_url( &self, id: &str, url: &Option<String>, ) -> Option<String>
pub fn api_key_env_var(&self) -> Option<&str>
pub fn get_api_key_from_env(&self) -> String
pub fn parse_chat_response( &self, s: &str, ) -> Result<Box<dyn IntoChatResponse>, Error>
Trait Implementations§
source§impl Clone for ApiProvider
impl Clone for ApiProvider
source§fn clone(&self) -> ApiProvider
fn clone(&self) -> ApiProvider
Returns a copy 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 ApiProvider
impl Debug for ApiProvider
source§impl Hash for ApiProvider
impl Hash for ApiProvider
source§impl PartialEq for ApiProvider
impl PartialEq for ApiProvider
impl Copy for ApiProvider
impl Eq for ApiProvider
impl StructuralPartialEq for ApiProvider
Auto Trait Implementations§
impl Freeze for ApiProvider
impl RefUnwindSafe for ApiProvider
impl Send for ApiProvider
impl Sync for ApiProvider
impl Unpin for ApiProvider
impl UnwindSafe for ApiProvider
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.