autogen.tools.experimental.PerplexitySearchTool
PerplexitySearchTool
Tool for interacting with the Perplexity AI search API.
This tool uses the Perplexity API to perform web search, news search,
and conversational search, returning concise and precise responses.
Attributes:
url (str): API endpoint URL.
model (str): Name of the model to be used.
api_key (str): API key for authenticating with the Perplexity API.
max_tokens (int): Maximum tokens allowed for the API response.
search_domain_filters (Optional[list[str]]): Optional list of domain filters for the search.
Initializes a new instance of the PerplexitySearchTool.
Name | Description |
---|---|
model | Type: str Default: ‘sonar’ |
api_key | Type: str | None Default: None |
max_tokens | Type: int Default: 1000 |
search_domain_filter | Type: list[str]Â |Â None Default: None |
Instance Methods
search
Perform a search query using the Perplexity AI API.
Constructs the payload, executes the query, and parses the response to return
a concise search result along with any provided citations.
Name | Description |
---|---|
query | The search query. Type: str |
Type | Description |
---|---|
SearchResponse | SearchResponse: A model containing the search result content and citations. |