llm_api_call | R Documentation |
Sends a prompt (with background academic definitions) to an LLM API (defaulting to 'OpenAI') and returns the LLM response.
llm_api_call(
prompt_text,
model = "gpt-3.5-turbo",
api_key = "",
top_p = 1,
temp = 0
)
prompt_text |
A character string containing the user prompt. |
model |
A character string specifying the LLM model (default "gpt-3.5-turbo"). |
api_key |
API key as a character string. |
top_p |
Numeric value for the probability mass (default 1). |
temp |
Numeric value for the sampling temperature (default 0). |
The system prompt includes academic definitions for word frequency, lexical coverage, Zipf's law, Levenshtein distance, and semantic transparency.
A character string containing the LLM's response.
## Not run:
response <- llm_api_call("Please provide a rating for the stimulus 'apple'.")
cat(response)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.