pub struct OpenAiCompatProvider { /* private fields */ }Implementations§
Source§impl OpenAiCompatProvider
impl OpenAiCompatProvider
pub fn new( api_key: impl Into<String>, base_url: impl Into<String>, name: impl Into<String>, ) -> Self
Sourcepub fn openrouter(api_key: impl Into<String>) -> Self
pub fn openrouter(api_key: impl Into<String>) -> Self
OpenRouter
Sourcepub fn perplexity(api_key: impl Into<String>) -> Self
pub fn perplexity(api_key: impl Into<String>) -> Self
Perplexity AI
Sourcepub fn huggingface(api_key: impl Into<String>) -> Self
pub fn huggingface(api_key: impl Into<String>) -> Self
HuggingFace Inference
Sourcepub fn siliconflow(api_key: impl Into<String>) -> Self
pub fn siliconflow(api_key: impl Into<String>) -> Self
SiliconFlow
Sourcepub fn cloudflare(api_key: impl Into<String>, account_id: &str) -> Self
pub fn cloudflare(api_key: impl Into<String>, account_id: &str) -> Self
Cloudflare Workers AI
Trait Implementations§
Source§impl Provider for OpenAiCompatProvider
impl Provider for OpenAiCompatProvider
Source§fn capabilities(&self) -> ProviderCapabilities
fn capabilities(&self) -> ProviderCapabilities
Query capabilities
Source§fn chat<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
request: &'life1 ChatRequest<'life2>,
) -> Pin<Box<dyn Future<Output = Result<ChatResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn chat<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
request: &'life1 ChatRequest<'life2>,
) -> Pin<Box<dyn Future<Output = Result<ChatResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Send a chat request and get a response.
Source§fn simple_chat<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
message: &'life1 str,
model: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn simple_chat<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
message: &'life1 str,
model: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Simple one-shot message (convenience wrapper)
Auto Trait Implementations§
impl Freeze for OpenAiCompatProvider
impl RefUnwindSafe for OpenAiCompatProvider
impl Send for OpenAiCompatProvider
impl Sync for OpenAiCompatProvider
impl Unpin for OpenAiCompatProvider
impl UnsafeUnpin for OpenAiCompatProvider
impl UnwindSafe for OpenAiCompatProvider
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
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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