% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/api_perplexity.R
\name{perplexity_deep_research}
\alias{perplexity_deep_research}
\title{Submit a Deep Research Request to Perplexity}
\usage{
perplexity_deep_research(
  .llm,
  .background = FALSE,
  .reasoning_effort = "medium",
  .search_context_size = "medium",
  .search_domain_filter = NULL,
  .search_language_filter = NULL,
  .language_preference = NULL,
  .search_recency_filter = NULL,
  .search_mode = NULL,
  .search_after_date_filter = NULL,
  .search_before_date_filter = NULL,
  .last_updated_after_filter = NULL,
  .last_updated_before_filter = NULL,
  .user_location = NULL,
  .json_schema = NULL,
  .idempotency_key = NULL,
  .api_key = Sys.getenv("PERPLEXITY_API_KEY"),
  .timeout = 300,
  .max_tries = 3
)
}
\arguments{
\item{.llm}{An \code{LLMMessage} object containing the research question.}

\item{.background}{Logical; if TRUE, returns a \code{tidyllm_research_job} immediately without waiting (default: FALSE).}

\item{.reasoning_effort}{Reasoning level: "low", "medium" (default), or "high".}

\item{.search_context_size}{Amount of search context: "low", "medium" (default), or "high".}

\item{.search_domain_filter}{Character vector of domains to allowlist/denylist (max 10; prefix with "-" to denylist).}

\item{.search_language_filter}{ISO 639-1 language code to restrict search results (e.g. "en", "de").}

\item{.language_preference}{ISO 639-1 code for preferred response language.}

\item{.search_recency_filter}{Restrict search to recent results: "hour", "day", "week", "month", or "year".}

\item{.search_mode}{Search index to use: "web" (default), "academic", or "sec".}

\item{.search_after_date_filter}{Only include content published after this date (MM/DD/YYYY).}

\item{.search_before_date_filter}{Only include content published before this date (MM/DD/YYYY).}

\item{.last_updated_after_filter}{Only include content last updated after this date (MM/DD/YYYY).}

\item{.last_updated_before_filter}{Only include content last updated before this date (MM/DD/YYYY).}

\item{.user_location}{Named list for geographic search personalisation (fields: country, city, region, latitude, longitude).}

\item{.json_schema}{A tidyllm schema created with \code{tidyllm_schema()} for structured JSON output (optional).}

\item{.idempotency_key}{Optional string; unique key to prevent duplicate submissions.}

\item{.api_key}{Character; Perplexity API key (default: from environment variable).}

\item{.timeout}{Integer; request timeout in seconds for blocking polling (default: 300).}

\item{.max_tries}{Integer; maximum retries (default: 3).}
}
\value{
If \code{.background = FALSE}, an updated \code{LLMMessage} with the research reply.
If \code{.background = TRUE}, a \code{tidyllm_research_job} object.
}
\description{
Submit a Deep Research Request to Perplexity
}
