Live Vertex AI Gemini comparisons for a tibble of pairs
Source:R/vertex_live.R
submit_vertex_pairs_live.RdThis is a row-wise wrapper around vertex_compare_pair_live(). It takes a
tibble of pairs (ID1 / text1 / ID2 / text2), submits each pair to the
Vertex AI Gemini API, and collects the results with optional incremental
saving and resume support.
Usage
submit_vertex_pairs_live(
pairs,
model,
trait_name,
trait_description,
prompt_template = set_prompt_template(),
api_key = NULL,
temperature = NULL,
top_p = NULL,
top_k = NULL,
max_output_tokens = NULL,
thinking_level = NULL,
thinking_budget = NULL,
service_tier = "standard",
api_version = "v1",
verbose = TRUE,
status_every = 1L,
progress = TRUE,
include_raw = FALSE,
include_thoughts = FALSE,
save_path = NULL,
parallel = FALSE,
workers = 1,
...
)Arguments
- pairs
Tibble/data frame with columns
ID1,text1,ID2,text2.- model
Vertex Gemini model name (for example
"gemini-2.5-flash").- trait_name
Trait name.
- trait_description
Trait description.
- prompt_template
Prompt template string, typically from
set_prompt_template().- api_key
Optional Vertex API key.
- temperature
Optional numeric temperature; forwarded to
vertex_compare_pair_live().- top_p
Optional numeric; forwarded to
vertex_compare_pair_live().- top_k
Optional numeric; forwarded to
vertex_compare_pair_live().- max_output_tokens
Optional integer; forwarded to
vertex_compare_pair_live().- thinking_level
Optional Gemini 3 thinking level; forwarded to
vertex_compare_pair_live().- thinking_budget
Optional integer; forwarded to
vertex_compare_pair_live().- service_tier
Vertex AI service tier forwarded to
vertex_compare_pair_live().- api_version
API version; default
"v1".- verbose
Logical; print status/timing every
status_everypairs.- status_every
Integer; how often to print status (default 1 = every pair).
- progress
Logical; show a text progress bar.
- include_raw
Logical; if
TRUE, each row of the returned tibble will include araw_responselist-column with the parsed JSON body.- include_thoughts
Logical; if
TRUE, requests explicit reasoning output and stores it in thethoughtscolumn of the result.- save_path
Character string; optional file path to save results incrementally. If the file exists, the function reads it to identify and skip pairs that have already been processed (resume mode). Requires the
readrpackage.- parallel
Logical; if
TRUE, enables parallel processing usingfuture.apply. Requires thefutureandfuture.applypackages.- workers
Integer; the number of parallel workers to use if
parallel = TRUE. Defaults to 1.- ...
Reserved for future extensions; passed through to
vertex_compare_pair_live().
Value
A list containing three elements:
- results
A tibble with one row per successfully processed pair.
- failed_pairs
A tibble containing the rows from
pairsthat failed to process, along with anerror_messagecolumn.- failed_attempts
A tibble of attempt-level failures separate from observed outcomes.
See also
check_llm_api_keys(), llm_compare_pair()
Other live backends:
anthropic_compare_pair_live(),
check_llm_api_keys(),
gemini_compare_pair_live(),
llm_compare_pair(),
ollama_compare_pair_live(),
openai_compare_pair_live(),
submit_anthropic_pairs_live(),
submit_gemini_pairs_live(),
submit_llm_pairs(),
submit_ollama_pairs_live(),
submit_openai_pairs_live(),
submit_together_pairs_live(),
together_compare_pair_live(),
vertex_compare_pair_live()
Examples
if (FALSE) { # \dontrun{
data("example_writing_samples", package = "pairwiseLLM")
pairs <- make_pairs(example_writing_samples[1:3, ])
td <- trait_description("overall_quality")
out <- submit_vertex_pairs_live(
pairs = pairs,
model = "gemini-3.8-flash",
trait_name = td$name,
trait_description = td$description,
thinking_level = "low",
parallel = FALSE
)
out$failed_pairs
} # }