View source: R/screen_errors.R
| screen_errors | R Documentation |
This is a generic function to re-screen failed title and abstract requests.
It reuses the arguments captured during the original screening and only re-submits
the rows stored in object$error_data to the appropriate backend.
screen_errors(
object,
api_key = NULL,
max_tries = NULL,
max_seconds = NULL,
is_transient = NULL,
backoff = NULL,
after = NULL,
studyid = NULL,
title = NULL,
abstract = NULL,
...
)
object |
An object of either class |
api_key |
Optional API key. If omitted, the selected backend uses its own default (e.g., |
max_tries, max_seconds |
'Cap the maximum number of attempts with
|
is_transient |
'A predicate function that takes a single argument
(the response) and returns |
backoff |
'A function that takes a single argument (the number of failed
attempts so far) and returns the number of seconds to wait' (Wickham, 2023).
If missing, the |
after |
'A function that takes a single argument (the response) and
returns either a number of seconds to wait or |
studyid |
Optional column (unquoted) for study id. Defaults to 'studyid'. |
title |
Optional column (unquoted) for title. If omitted, inferred (e.g., title, ti, t1). |
abstract |
Optional column (unquoted) for abstract. If omitted, inferred (e.g., abstract, ab, abs). |
... |
Further arguments forwarded to the underlying backend function
( |
The backend is derived from class(object) and mapped to either
tabscreen_gpt() or tabscreen_groq(). Only rows in object$error_data
are re-submitted. To avoid name collisions during unnesting in the backend,
columns that will be regenerated (currently decision_binary, decision_description,
error_message, res) are dropped from error_data before the call.
The original arguments from the first screening are taken from attr(object, "arg_list")
and are combined with any non-NULL overrides provided here.
An object of class 'gpt' or 'groq' similar to the object returned by
the original screening function, with:
answer_data updated to include newly successful rows,
error_data updated to include only remaining failures.
Other fields (e.g., price_data, price_dollar, and arg_list) are preserved or updated by the backend.
tabscreen_gpt(), tabscreen_groq()
## Not run:
# Example with openai
set_api_key()
prompt <- "Is this study about a Functional Family Therapy (FFT) intervention?"
obj_with_error <-
tabscreen_gpt(
data = filges2015_dat[1:2,],
prompt = prompt,
studyid = studyid,
title = title,
abstract = abstract,
model = "gpt-4o-mini"
)
obj_rescreened <-
obj_with_error |>
screen_errors()
# Example with groq
prompt <- "Is this study about a Functional Family Therapy (FFT) intervention?"
obj_with_error <-
tabscreen_groq(
data = filges2015_dat[1:2,],
prompt = prompt,
studyid = studyid,
title = title,
abstract = abstract,
model = "llama-3.3-70b-versatile"
)
obj_rescreened <-
obj_with_error |>
screen_errors()
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.