Download the PHP package particle-academy/prism-perplexity without Composer

On this page you can find all versions of the php package particle-academy/prism-perplexity. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package prism-perplexity

Prism Perplexity

The rest of the Perplexity API for Prism — embeddings, direct web search, and the endpoints that do not fit Prism's provider abstraction.

That is the whole setup. The package registers under the same provider key as Prism core, so using('perplexity', …) gains capabilities and nothing that already worked changes.

Working on this package? Read AGENTS.md first — the boundary this package has to hold, the gates that must be green, and the traps that have already caught someone. @link AGENTS.md

Embeddings

Prism core throws unsupportedProviderAction for Perplexity embeddings. With this installed:

Contextualized embeddings

Perplexity has a second endpoint for chunks of one document, embedding each in light of the others — which is what you want when you have split a document for retrieval and do not want every chunk to read as though it arrived alone.

Prism's embeddings abstraction is text-in/vector-out and has no concept of "these belong together", so it is reached explicitly rather than inferred:

Vectors are ordered by the index the API returns, not by array position — lining vectors up with the inputs that produced them by position would be a silent mismatch if a response ever arrived out of order.

Search

Web results with no model in the loop — the sources a grounded answer would have been built from, without paying for the answer.

This is not a Prism:: verb because Prism has no "search" concept — every other provider it speaks to answers with a model. Bending a list of web results into a completion would lose the structure that makes it worth having, so it is its own method.

An empty result list is an answer, not a failure.

What lives here and what lives in core

Where
Text, structured output, streaming Prism core
Slug→preset translation, Agent API transport Prism core
Embeddings, contextualized embeddings here
Search API here
Durable Agent API lifecycle here

The split follows the abstraction: core carries what fits "prompt in, answer out". Anything that is a genuinely different operation lives out here rather than distorting core to fit.

Durable Agent responses

Long-running work has an explicit lifecycle instead of pretending a queued response is text:

Every snapshot carries a typed AgentStatus, an AgentProtocol discriminator, the resolved model, structured output, flattened annotations, the full provider usage/cost ledger, a typed error when present, and the unmodified response body in raw. Failed, incomplete, and cancelled runs are lifecycle results rather than transport exceptions. Malformed and non-successful HTTP responses still throw.

cancel($id) acknowledges a cancellation request: cancelling is neither terminal nor successful. The acknowledgement's response_id (or legacy id, only when response_id is absent) must match the requested ID exactly. A malformed or mismatched acknowledgement throws invalid_response; cancellation state is uncertain, so call retrieve($id) to check it. The client does not retry the cancellation automatically. create() and retrieve() continue to use their own id field, and raw keeps the provider body.

incompleteReason() returns the provider's string incomplete_details.reason, including an empty string, or null when absent or malformed.

wait() is deliberately bounded. Queue workers should normally persist the response id and retrieve it in a later job; the helper exists for short bounded waits, not indefinite polling.

Perplexity documents create, retrieve and cancel for Agent responses, but does not document an endpoint that lists every Agent response. This package does not guess one. The older async Sonar API does have a list endpoint, but it is a separate legacy protocol and is not silently mixed with Agent response ids or statuses.

Errors

Perplexity's agent surface returns failures inside an HTTP 200. This package assumes the same is possible on every endpoint and branches on the response body, because an empty vector set or an empty result list read as a valid answer is worse than an exception.

Requirements

PHP 8.2+, Laravel 12.61+ or 13.12+, and particle-academy/prism 0.113+.


All versions of prism-perplexity with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
laravel/framework Version ^12.69.0|^13.30.0
particle-academy/prism Version >=0.113 <1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package particle-academy/prism-perplexity contains the following files

Loading the files please wait ...