Skip to contents

Get a description of a data frame

Usage

get_text_description(
  df,
  prompt,
  pcdas_token = NULL,
  throttle_rate = 1,
  max_tries = 10
)

Arguments

df

a data frame.

prompt

character. A prompt asking how the data should be described.

pcdas_token

character. PCDaS API token. If not provided, the function will look for it on renvirom.

throttle_rate

Rate of requests per second allowed. Defaults to 1 request per second.

max_tries

Max number of retries before fail. Defaults to 10.

Value

a character string.

Examples

get_text_description(df = iris, prompt = "This json data contains measurements of sepal length and width and petal length and width. Write a small paragraph describing the species. Do not mention the file format.")
#> Error in get_pcdas_token_renviron(): PCDaS token API not provided and not found on renviron. Please provide PCDaS API token.