
Define an annotation task (deprecated)
task.RdUsage
task(name, system_prompt, type_def, input_type = c("text", "image"))Arguments
- name
Name of the codebook (character).
- input_type
Type of input data:
"text"(default),"image","audio"or"video". For the other three the elements ofxinqlm_code()are file paths; for"image"they may also be URLs, and for"video"YouTube links or URLs of video files. See the sections "Image input", "Audio input" and "Video input" ofqlm_code()for how the files are handled and what is known about which providers accept them.
Details
task() has been deprecated in favor of qlm_codebook(). The new function
returns an object with dual class inheritance that works with both the old
and new APIs.
See also
qlm_codebook() for the replacement function.
Examples
if (FALSE) { # \dontrun{
# Deprecated usage
my_task <- task(
name = "Sentiment",
system_prompt = "Rate the sentiment from -1 (negative) to 1 (positive).",
type_def = type_object(
score = type_number("Sentiment score from -1 to 1"),
explanation = type_string("Brief explanation")
)
)
# New recommended usage
my_codebook <- qlm_codebook(
name = "Sentiment",
instructions = "Rate the sentiment from -1 (negative) to 1 (positive).",
schema = type_object(
score = type_number("Sentiment score from -1 to 1"),
explanation = type_string("Brief explanation")
)
)
} # }