Feature · Search and research

Research (Perplexity)

Prism Perplexity provides access to Perplexity embeddings, web search and the long-running Agent API, in PHP, TypeScript and Python.

  • PHP
  • TypeScript
  • Python

Capabilities

What it does

01

Search without an answer

Retrieve web search results without requesting a generated answer, one query or several together.

TypeScript
const results = await search(http, 'what is prism php', {
  max_results: 5,
  search_domain_filter: ['github.com'],
});

02

Embeddings

Generate embeddings, including contextualized embeddings that represent chunks of one document using the surrounding document context.

03

Agent API

Long research tasks run in the background: create starts a run and returns at once, retrieve reads its state, wait polls until it finishes, and cancel stops it.

04

Never an unfinished run

Waiting returns as soon as the run is terminal. If it is still running after the last attempt, wait throws; it never returns an unfinished run.

05

Errors inside a 200

Perplexity can report a failure inside an HTTP 200 response. Every call checks the body for an error and throws, so a failure is never returned as an empty result.

How it fits

Where it sits in the ecosystem

In PHP, the package extends Prism’s existing perplexity provider: text, structured output and streaming keep working through core, and embeddings, search and the Agent API are added to the same provider.

TypeScript and Python expose functions that take an HTTP transport. The package ships one built on the runtime’s own HTTP client.

Install

Add it to your project

  1. 01

    particle-academy/prism-perplexity PHP

  2. 02

    @particle-academy/prism-perplexity TypeScript

  3. 03

    prism-ai-perplexity Python

The packages

On the registries

PHP · Packagist

particle-academy/prism-perplexity

TypeScript · npm

@particle-academy/prism-perplexity

Python · PyPI

prism-ai-perplexity