Test whether two strings match with an LLM prompt.
check_match.Rd
Test whether two strings match with an LLM prompt.
Usage
check_match(
string1,
string2,
model = "gpt-3.5-turbo-instruct",
record_type = "entity",
instructions = NULL,
openai_api_key = Sys.getenv("OPENAI_API_KEY"),
parallel = TRUE
)
Arguments
- string1
A string or vector of strings
- string2
A string or vector of strings
- model
Which LLM to prompt; defaults to 'gpt-3.5-turbo-instruct'
- record_type
A character describing what type of entity
string1
andstring2
represent. Should be a singular noun (e.g. "person", "organization", "interest group", "city").- instructions
A string containing additional instructions to include in the LLM prompt.
- openai_api_key
Your OpenAI API key. By default, looks for a system environment variable called "OPENAI_API_KEY" (recommended option). Otherwise, it will prompt you to enter the API key as an argument.
- parallel
TRUE to submit API requests in parallel. Setting to FALSE can reduce rate limit errors at the expense of longer runtime.