Liking cljdoc? Tell your friends :D

llm.sdk.providers.perplexity.chat

Perplexity Sonar transport. Builds the current /v1/sonar request shape and normalizes grounded citations, search results, usage/cost, and full or concise SSE streams.

Perplexity Sonar transport.
Builds the current /v1/sonar request shape and normalizes grounded
citations, search results, usage/cost, and full or concise SSE streams.
raw docstring

build-request-perplexityclj

(build-request-perplexity profile request)
source

extract-citation-partsclj

(extract-citation-parts raw)

Return a vector of CitationPart maps from a Perplexity raw response. Prefers :search_results (carries title + snippet); falls back to :citations (URL-only).

Return a vector of CitationPart maps from a Perplexity raw response.
Prefers :search_results (carries title + snippet); falls back to
:citations (URL-only).
sourceraw docstring

make-transportclj

(make-transport)
source

parse-error-perplexityclj

(parse-error-perplexity _profile status body)
source

parse-response-perplexityclj

(parse-response-perplexity profile raw)
source

parse-stream-event-perplexityclj

(parse-stream-event-perplexity _profile line)

Parse both full and concise Sonar SSE chunks. Full-mode metadata can repeat on content chunks, so citations and usage are emitted only when the choice finishes. Concise reasoning metadata is translated to canonical reasoning deltas and final search results are emitted from chat.completion.done.

Parse both full and concise Sonar SSE chunks.
Full-mode metadata can repeat on content chunks, so citations and usage are
emitted only when the choice finishes. Concise reasoning metadata is
translated to canonical reasoning deltas and final search results are
emitted from chat.completion.done.
sourceraw docstring

perplexity-cost-calculatorclj

(perplexity-cost-calculator {:keys [_provider _model usage pricing]})

Reads canonical token + search-query usage and produces a cost-result. Falls back to the default token cost when no :search-cost-per-call is set.

Reads canonical token + search-query usage and produces a
cost-result. Falls back to the default token cost when no
:search-cost-per-call is set.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close