check_api_key {gptstudio}R Documentation

Check API key

Description

This function checks whether the API key provided as an argument is in the correct format.

Usage

check_api_key(api_key, update_api = TRUE)

Arguments

api_key

An API key.

update_api

Whether to attempt to update api if invalid

Value

Nothing is returned. If the API key is in the correct format, a success message is printed. If the API key is not in the correct format, an error message is printed and the function aborts.

Examples

# Call the function with an API key
## Not run: 
check_api_key("my_api_key")

## End(Not run)
# Call the function with an API key and avoid updating the API key
## Not run: 
check_api_key("my_api_key", update_api = FALSE)

## End(Not run)

[Package gptstudio version 0.3.0 Index]