Skip to main content
Perplexity
current

Search documentation

Type to search this documentation.

On this pageOverview

Perplexity with AG2

Understand how AG2's Perplexity tools use the Search API and Sonar Chat Completions during the Agent API migration.

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.

Automatic routing keeps synchronous perplexity_answer requests available, but it does not guarantee exact compatibility for every Sonar-specific parameter or response field. Test the behavior your integration relies on.

To move generated-answer calls themselves to the Agent API, follow the Sonar migration guide. The recommended starting points are the fast preset for sonar and the low preset for 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.

Suggest an edit

Propose a replacement for this page. The site team reviews it before applying any changes.

Export
Documentation menu