Feature · Search and research
Prism Perplexity provides access to Perplexity embeddings, web search and the long-running Agent API, in PHP, TypeScript and Python.
Capabilities
01
Retrieve web search results without requesting a generated answer, one query or several together.
const results = await search(http, 'what is prism php', {
max_results: 5,
search_domain_filter: ['github.com'],
});02
Generate embeddings, including contextualized embeddings that represent chunks of one document using the surrounding document context.
03
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
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
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
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
particle-academy/prism-perplexity PHP
@particle-academy/prism-perplexity TypeScript
prism-ai-perplexity Python
Related features
Provider interface
One API, every provider
One request shape for text, structured output, streaming, embeddings, media, audio, files and batches, in PHP, TypeScript and Python.
Context recall
Memory
Store what was said and recall the records that bear on a new question, sized to the token budget you have.
OpenTelemetry tracing
Observability
Generations, steps and tool calls as GenAI-convention OpenTelemetry spans, exported over OTLP.