pub struct PerplexityProvider { /* private fields */ }Implementations§
Source§impl PerplexityProvider
impl PerplexityProvider
pub fn new(config: ProviderConfig) -> Result<Self, ProviderError>
Trait Implementations§
Source§impl Provider for PerplexityProvider
impl Provider for PerplexityProvider
Source§fn supports_streaming(&self) -> bool
fn supports_streaming(&self) -> bool
Check if this provider supports streaming responses. Read more
Source§fn supports_function_calling(&self) -> bool
fn supports_function_calling(&self) -> bool
Check if this provider supports function calling. Read more
Source§fn supported_models(&self) -> Vec<String>
fn supported_models(&self) -> Vec<String>
Get the list of models supported by this provider. Read more
Source§fn chat_completion<'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_completion<'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,
Perform a chat completion request. Read more
Source§fn stream_chat_completion<'life0, 'async_trait>(
&'life0 self,
request: ChatRequest,
) -> Pin<Box<dyn Future<Output = Result<StreamResult, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn stream_chat_completion<'life0, 'async_trait>(
&'life0 self,
request: ChatRequest,
) -> Pin<Box<dyn Future<Output = Result<StreamResult, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Perform a streaming chat completion request. Read more
Source§fn embedding<'life0, 'async_trait>(
&'life0 self,
_request: EmbeddingRequest,
) -> Pin<Box<dyn Future<Output = Result<EmbeddingResponse, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn embedding<'life0, 'async_trait>(
&'life0 self,
_request: EmbeddingRequest,
) -> Pin<Box<dyn Future<Output = Result<EmbeddingResponse, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Generate embeddings for text input. Read more
Source§fn image_generation<'life0, 'async_trait>(
&'life0 self,
_request: ImageRequest,
) -> Pin<Box<dyn Future<Output = Result<ImageResponse, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn image_generation<'life0, 'async_trait>(
&'life0 self,
_request: ImageRequest,
) -> Pin<Box<dyn Future<Output = Result<ImageResponse, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Generate images from text prompts. Read more
Source§fn audio_transcription<'life0, 'async_trait>(
&'life0 self,
_request: AudioRequest,
) -> Pin<Box<dyn Future<Output = Result<AudioResponse, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn audio_transcription<'life0, 'async_trait>(
&'life0 self,
_request: AudioRequest,
) -> Pin<Box<dyn Future<Output = Result<AudioResponse, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Transcribe audio to text. Read more
Source§fn text_to_speech<'life0, 'async_trait>(
&'life0 self,
_request: SpeechRequest,
) -> Pin<Box<dyn Future<Output = Result<SpeechResponse, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn text_to_speech<'life0, 'async_trait>(
&'life0 self,
_request: SpeechRequest,
) -> Pin<Box<dyn Future<Output = Result<SpeechResponse, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Convert text to speech. Read more
Source§fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<ProviderHealth, 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<ProviderHealth, ProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Perform a health check on this provider. Read more
Auto Trait Implementations§
impl Freeze for PerplexityProvider
impl !RefUnwindSafe for PerplexityProvider
impl Send for PerplexityProvider
impl Sync for PerplexityProvider
impl Unpin for PerplexityProvider
impl !UnwindSafe for PerplexityProvider
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