withone-perplexity 0.1.0

Typed perplexity actions for the One SDK.
Documentation

Perplexity

Perplexity is an AI-powered search and answer engine that provides real-time, cited answers using large language models. It's designed for knowledge discovery and in-depth research.

What this package is

One is a unified API for third-party platforms: connect an account once, then call any of its actions through one client with the credentials, retries and routing handled for you. withone-perplexity holds the 30 typed Perplexity actions, each taking exactly the input that action needs and checked when you build. The client itself lives in withone, which every platform package shares.

Install

cargo add withone withone-perplexity

Quick start

  1. Create a secret key in the One dashboard and export it as ONE_SECRET.
  2. Connect a Perplexity account in the dashboard and copy its connection key.
  3. Run an action on that connection:
use one::One;
use withone_perplexity as perplexity;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let one = One::from_env()?;
    let response = one
        .connection(std::env::var("ONE_CONNECTION_KEY")?)
        .run(perplexity::create_embeddings() /* set the action's fields */)
        .await?;
    let body: serde_json::Value = response.json()?;
    println!("{body:#}");
    Ok(())
}

Actions

This package carries 30 typed actions, among them:

  • create_embeddings
  • get_async_chat_completion_response
  • search_web
  • list_async_chat_completions_authenticated_user
  • create_contextualized_embeddings
  • create_agent_response
  • create_chat_completion
  • create_async_chat_completion_sonar
  • download_file_content
  • delete_file
  • cancel_batch
  • create_batch

Every action, with its inputs, outputs and behaviour, is on Perplexity on One.

Links

License

MIT