Struct rig::providers::perplexity::Client
source · pub struct Client { /* private fields */ }
Implementations§
source§impl Client
impl Client
pub fn new(api_key: &str) -> Self
sourcepub fn from_env() -> Self
pub fn from_env() -> Self
Create a new Perplexity client from the PERPLEXITY_API_KEY
environment variable.
Panics if the environment variable is not set.
pub fn from_url(api_key: &str, base_url: &str) -> Self
pub fn post(&self, path: &str) -> RequestBuilder
pub fn completion_model(&self, model: &str) -> CompletionModel
pub fn model(&self, model: &str) -> ModelBuilder<CompletionModel>
pub fn agent(&self, model: &str) -> AgentBuilder<CompletionModel>
pub fn extractor<T: JsonSchema + for<'a> Deserialize<'a> + Serialize + Send + Sync>( &self, model: &str, ) -> ExtractorBuilder<T, CompletionModel>
pub fn rag_agent<C: VectorStoreIndex, T: VectorStoreIndex>( &self, model: &str, ) -> RagAgentBuilder<CompletionModel, C, T>
pub fn context_rag_agent<C: VectorStoreIndex>( &self, model: &str, ) -> RagAgentBuilder<CompletionModel, C, NoIndex>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
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
)