pub struct ZenProvider { /* private fields */ }Expand description
Zen provider implementation
Implementations§
Source§impl ZenProvider
impl ZenProvider
Sourcepub fn new(api_key: String) -> Result<Self, ProviderError>
pub fn new(api_key: String) -> Result<Self, ProviderError>
Create a new Zen provider instance
Sourcepub fn with_base_url(
api_key: String,
base_url: String,
) -> Result<Self, ProviderError>
pub fn with_base_url( api_key: String, base_url: String, ) -> Result<Self, ProviderError>
Create a new Zen provider with a custom base URL
Trait Implementations§
Source§impl Provider for ZenProvider
impl Provider for ZenProvider
Source§fn chat<'life0, 'async_trait>(
&'life0 self,
request: ChatRequest,
) -> Pin<Box<dyn Future<Output = Result<ChatResponse, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn chat<'life0, 'async_trait>(
&'life0 self,
request: ChatRequest,
) -> Pin<Box<dyn Future<Output = Result<ChatResponse, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Send a chat completion request
Source§fn chat_stream<'life0, 'async_trait>(
&'life0 self,
_request: ChatRequest,
) -> Pin<Box<dyn Future<Output = Result<ChatStream, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn chat_stream<'life0, 'async_trait>(
&'life0 self,
_request: ChatRequest,
) -> Pin<Box<dyn Future<Output = Result<ChatStream, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Stream a chat completion response
Source§fn count_tokens(
&self,
content: &str,
model: &str,
) -> Result<usize, ProviderError>
fn count_tokens( &self, content: &str, model: &str, ) -> Result<usize, ProviderError>
Count tokens for content
Source§fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<bool, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<bool, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Check if the provider is available and healthy
Auto Trait Implementations§
impl Freeze for ZenProvider
impl !RefUnwindSafe for ZenProvider
impl Send for ZenProvider
impl Sync for ZenProvider
impl Unpin for ZenProvider
impl !UnwindSafe for ZenProvider
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