Skip to content

feat(ai): integrate Perplexity adapter#77

Merged
ralyodio merged 1 commit into
profullstack:masterfrom
Photon101:photon101/ai-perplexity-adapter
May 13, 2026
Merged

feat(ai): integrate Perplexity adapter#77
ralyodio merged 1 commit into
profullstack:masterfrom
Photon101:photon101/ai-perplexity-adapter

Conversation

@Photon101
Copy link
Copy Markdown
Contributor

Summary

  • replace the Perplexity stub with a working Sonar API implementation
  • update the deprecated llama-3.1-sonar-* default to the current Sonar model family
  • map OpenAI-compatible response text and usage tokens, keep dry-run behavior, and pass Perplexity-specific options through opts.extra
  • cover request shape, dry-run short-circuiting, and HTTP error excerpts with focused Vitest tests

This implements another AI provider adapter for #6.

Notes

Perplexity's current docs describe Sonar as OpenAI Chat Completions compatible, with https://api.perplexity.ai as the base URL and canonical POST /v1/sonar for direct API calls. The old llama-3.1-sonar-* API model names were deprecated, so this adapter now defaults to sonar-pro and includes sonar, sonar-pro, sonar-reasoning-pro, and sonar-deep-research.

Validation

  • git diff --check
  • corepack pnpm exec vitest run packages/ai/perplexity/src/index.test.ts
  • corepack pnpm exec tsc -p packages/ai/perplexity/tsconfig.json --noEmit

As with #76, the repo's full workspace install is currently blocked by the unrelated packages/dns/azure dependency on missing workspace package @sh1pt/core; I validated this package with root dev tooling and a local link to packages/core.

@ralyodio ralyodio merged commit fbfe3c1 into profullstack:master May 13, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants