generate_ratings | R Documentation |
Generates ratings for a given stimulus by calling one of several LLM APIs.
generate_ratings(
model = "gpt-3.5-turbo",
stim = "kick the bucket",
prompt = "You are a native English speaker.",
question = "Please rate the following stim:",
top_p = 1,
temp = 0,
n_iterations = 30,
api_key = "",
debug = FALSE
)
model |
A character string specifying the LLM model (e.g., "gpt-3.5-turbo", "deepseek-chat"). |
stim |
A character string representing the stimulus (e.g., an idiom). |
prompt |
A character string for the system prompt (e.g., "You are a native English speaker."). |
question |
A character string for the user prompt (e.g., "Please rate the following stim:"). |
top_p |
Numeric value for the probability mass (default 1). |
temp |
Numeric value for the temperature (default 0). |
n_iterations |
An integer indicating how many times to query the API. |
api_key |
API key as a character string. |
debug |
Logical; if TRUE, debug information is printed. |
This function supports multiple APIs. Branching is based on the model
parameter.
A data frame containing the stimulus, the rating, and the iteration number.
## Not run:
ratings <- generate_ratings(
model = "gpt-3.5-turbo",
stim = "kick the bucket",
prompt = "You are a native English speaker.",
question = "Please rate the following stim:",
n_iterations = 5,
api_key = "your_api_key"
)
print(ratings)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.