% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/http.R
\name{remote_reviewer}
\alias{remote_reviewer}
\title{Create a remote semantic reviewer}
\usage{
remote_reviewer(
  url,
  headers = list(),
  body_field = "prompt",
  response_path = NULL,
  timeout = 30
)
}
\arguments{
\item{url}{Endpoint URL.}

\item{headers}{Named character vector or list of HTTP headers.}

\item{body_field}{JSON field name used for the reviewer prompt.}

\item{response_path}{Optional character vector path to extract from a JSON
response, such as \code{c("data", "findings")}.}

\item{timeout}{Request timeout in seconds.}
}
\value{
A reviewer function suitable for \verb{reviewer =} in \code{\link[=scan_prompt]{scan_prompt()}},
\code{\link[=scan_output]{scan_output()}}, \code{\link[=scan_context]{scan_context()}}, or \code{\link[=secure_chat]{secure_chat()}}.
}
\description{
\code{remote_reviewer()} creates a reviewer function backed by an HTTP endpoint.
It is intended for teams that already have a policy service, review gateway,
or hosted model wrapper that returns llmshieldr-compatible JSON findings.
}
\details{
The returned function accepts the reviewer prompt generated by llmshieldr and
sends a JSON body to \code{url}. By default, the body is:

\if{html}{\out{<div class="sourceCode json">}}\preformatted{\{"prompt": "..."\}
}\if{html}{\out{</div>}}

The endpoint may return either a JSON response body or plain text containing
JSON. If the response body is JSON and \code{response_path} is supplied, the value
at that path is extracted before returning to the scanner. Otherwise the
response body is returned as text and parsed by llmshieldr's semantic-review
JSON extraction logic.

This helper requires the optional \code{httr2} package and performs no network
calls until the reviewer function is invoked.
}
\examples{
\dontrun{
reviewer <- remote_reviewer(
  "https://policy.example.com/review",
  headers = c(Authorization = "Bearer <token>")
)

scan_prompt("Review me", reviewer = reviewer, checks = "llm")
}
}
