% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/api_voyage.R
\name{voyage_rerank}
\alias{voyage_rerank}
\title{Rerank Documents Using Voyage AI API}
\usage{
voyage_rerank(
  .query,
  .documents,
  .model = "rerank-2",
  .top_k = NULL,
  .api_key = Sys.getenv("VOYAGE_API_KEY"),
  .timeout = 60,
  .max_tries = 3
)
}
\arguments{
\item{.query}{A single character string representing the search query.}

\item{.documents}{A character vector of documents to rerank.}

\item{.model}{The reranking model identifier (default: "rerank-2").}

\item{.top_k}{Integer; return only the top-k results (default: NULL, returns all).}

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

\item{.timeout}{Integer; request timeout in seconds (default: 60).}

\item{.max_tries}{Integer; maximum retries (default: 3).}
}
\value{
A tibble with columns \code{index}, \code{document}, and \code{relevance_score}, sorted by score descending.
}
\description{
Rerank Documents Using Voyage AI API
}
