ask_perplexity: Search with Perplexity

ask_perplexityR Documentation

Search with Perplexity

Description

Searches with Perplexity AI, which provides answers with citations to sources. This makes it particularly useful for research-oriented queries.

Usage

ask_perplexity(query = geterrmessage(), prompt = NULL)

Arguments

query

Contents of string to send to AI Service. Default is the last error message.

prompt

Optional prompt prefix to add before your query to guide how the AI Service responds. If NULL, uses the service-specific default prompt option.

Value

The generated search URL or an empty string.

See Also

Other AI assistants: ask_bing_copilot(), ask_chatgpt(), ask_claude(), ask_grok(), ask_meta_ai(), ask_mistral()

Examples

# Basic query
ask_perplexity("Compare dplyr vs data.table")

# Using a custom prompt
ask_perplexity("Best packages for time series in R",
               prompt = "Provide citations and compare performance:")

coatless/searcher documentation built on June 2, 2025, 10:37 a.m.