Skip to main content
Sonar Chat Completions has been superseded by the Agent API (as of September 27, 2026), and Sonar’s async endpoints have been discontinued. AG2’s perplexity_answer tool sends synchronous requests, so the async discontinuation does not affect it.

How AG2 uses Perplexity

AG2’s PerplexitySearchToolkit contains two tools:
  • perplexity_search calls the Search API and returns ranked web results.
  • perplexity_answer calls synchronous Sonar Chat Completions for a generated answer. Passing the complete toolkit to an AG2 agent registers both tools.
Synchronous perplexity_answer requests may be routed to the Agent API. Routing does not guarantee exact compatibility for every Sonar-specific parameter or response field. Test the behavior your integration relies on.

Move to the Agent API directly

To move generated-answer calls themselves to the Agent API, follow the Sonar migration guide. The recommended starting points are the fast effort level for both sonar and sonar-pro. The Agent API uses a different request and response shape, and some Sonar features do not have direct equivalents, so review the guide’s parameter mappings rather than assuming feature parity. For a framework integration verified with the Agent API, use Perplexity with LangChain.