Skip to content

v0.1.0

Choose a tag to compare

@github-actions github-actions released this 22 Sep 03:50
· 8 commits to main since this release

First release: Perplexity's Search, embeddings and Agent API, in Python

prism-ai-perplexity is the Python port of
particle-academy/prism-perplexity — the parts of Perplexity that Prism core
does not carry.

pip install prism-ai-perplexity

Zero runtime dependencies. Python 3.10+.

search() for the Search API, embeddings(), and AgentClient for the
long-running Agent API. urllib_transport() is a transport built from the
standard library; any callable taking an HttpRequest and returning an
HttpResponse works, so the package never picks an HTTP client for you.

AgentClient.wait() polls until the run reaches a terminal state, and RAISES
rather than handing back a non-terminal response -- a caller given a queued
would have to check the status again to know the wait failed, and the ones who
forget treat an unfinished run as an empty answer.

max_attempts defaults to 300 at one-second intervals. It was 60, and that was
caught before this release rather than after: the reference measured a ROUTINE
deep-research call at 57-59 seconds, so the default was within two seconds of
timing out a call that was working perfectly.

Worth knowing if you are reading both packages: PHP holds ONE long request and
was capped by Laravel's 30-second HTTP timeout (fixed in its v0.3.0); this polls
with a short request each time and was capped by the attempt count. Same defect,
two mechanisms, which is why the fix did not travel with the port. The
transport's own 30-second timeout is correct here and stays.

ErrorCode is a closed set and PerplexityError carries one, so a caller
branches on AGENT_WAIT_TIMED_OUT rather than on message text. AgentStatus
says what a run is doing, and is_terminal() is the question worth asking.

The perplexity family has a prism-parity suite running one fixture through
PHP, TypeScript and Python. Read its findings before assuming the three agree:
ONE of seventeen rows does, registered as G-29..G-32. That is the honest state
of this family, and it is why the corpus exists.