feat(perplexity): add Agent API presets and deprecate legacy Sonar models - #178
Draft
andrewmadson-pplx wants to merge 8 commits into
Draft
feat(perplexity): add Agent API presets and deprecate legacy Sonar models#178andrewmadson-pplx wants to merge 8 commits into
andrewmadson-pplx wants to merge 8 commits into
Conversation
andrewmadson-pplx
marked this pull request as draft
August 28, 2026 22:21
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
注册 for free
to join this conversation on GitHub.
Already have an account?
登录 to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds Perplexity Agent API support to the public BaseAI OSS local runtime while preserving the existing Sonar Chat Completions path during the migration window.
What changed
perplexity:fast,perplexity:low,perplexity:medium, andperplexity:high.POST https://api.perplexity.ai/v1/agentwith the matching preset./chat/completionstransport; existing Pipes are not migrated automatically.main.The initial adapter supports system, user, and assistant text; non-streaming responses; streaming answer text; preset search; and non-streaming citation metadata. It does not yet support custom tools, tool-result replay, background runs, file outputs, explicit Agent model selection, image content, or streamed citation metadata.
OSS-only scope
This PR is intentionally limited to BaseAI's public open-source local runtime, public types, tests, examples, and documentation.
This PR changes only the public BaseAI local runtime; Langbase-hosted execution and rollout are outside its scope.
Migration notes
The provider documentation includes a before/after Pipe example, environment-key guidance, local commands, preset-selection guidance, supported and unsupported behavior, the Agent API quickstart, and the Sonar migration guide.
BaseAI's required
max_tokens,temperature, andtop_pvalues are forwarded to Agent API (max_tokensbecomesmax_output_tokens) and therefore override the chosen preset's tuned defaults. Migrating users should review those values.Verification
Passed on this branch:
pnpm install --frozen-lockfile/v1/pipes/run -> callLLM -> callPerplexity -> fetch, included in both BaseAI suitesbaseaibuild@baseai/corebuildmainThe full Core suite still has four stale
pipe.generateText/pipe.streamTextfailures. The same four failures reproduce onmain. 仓库-wide type-check and lint commands also retain their existingmainfailures; the new targeted checks and builds pass.Fixtures and live validation
The golden response and SSE fixtures are sanitized, documentation-derived contract examples assembled from the current public Agent API schema and migration documentation. They are not captured live responses.
No Perplexity credential was available in the protected environment, so no live or billable request was made. A credentialed live smoke test and captured fixture verification remain pending. This PR intentionally remains a draft and is not ready to merge until that acceptance item is completed or explicitly waived.