View source: R/screen_errors.R
screen_errors | R Documentation |
This is a generic function to re-screen of failed title and abstract requests.
screen_errors(
object,
api_key = get_api_key(),
max_tries = 4,
max_seconds,
is_transient,
backoff,
after,
...
)
object |
An object of either 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'
or 'chatgpt'
similar to the object returned by tabscreen_gpt()
.
See documentation for tabscreen_gpt()
.
screen_errors.gpt()
, screen_errors.chatgpt()
## Not run:
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_error()
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.