View source: R/screen_errors.gpt.R
screen_errors.gpt | R Documentation |
This function supports re-screening of all failed title and abstract requests
screened with tabscreen_gpt()
/tabscreen_gpt.tools()
.
## S3 method for class 'gpt'
screen_errors(
object,
api_key = get_api_key(),
max_tries = 16,
max_seconds,
is_transient,
backoff,
after,
...
)
object |
An object of class |
api_key |
Numerical value with your personal API key. Default setting draws
on the |
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 |
... |
Further argument to pass to the request body. See https://platform.openai.com/docs/api-reference/chat/create.
If used in the original screening in |
An object of class 'gpt'
similar to the object returned by tabscreen_gpt()
.
See documentation for tabscreen_gpt()
.
Wickham H (2023). httr2: Perform HTTP Requests and Process the Responses. https://httr2.r-lib.org, https://github.com/r-lib/httr2.
tabscreen_gpt()
, tabscreen_gpt.tools()
## Not run:
prompt <- "Is this study about a Functional Family Therapy (FFT) intervention?"
obj_with_error <-
tabscreen_gpt(
data = filges2015_dat[1:10,],
prompt = prompt,
studyid = studyid,
title = title,
abstract = abstract,
model = "gpt-4o"
)
obj_rescreened <-
obj_with_error |>
screen_error()
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.